From a3b63c88afc4ea977e6711419128438c3c003a24 Mon Sep 17 00:00:00 2001 From: GabrielMartinezRodriguez Date: Thu, 19 Oct 2023 11:15:26 +0200 Subject: [PATCH 01/37] chore: polkadot v0.9.37 --- Cargo.lock | 2921 +++++++++++------ Cargo.toml | 197 +- primitives/runner/src/lib.rs | 4 +- runtime/Cargo.toml | 2 + runtime/src/lib.rs | 3 +- rust-toolchain.toml | 4 +- test-utils/stability-client/src/lib.rs | 24 +- .../stability-runtime-client/src/lib.rs | 2 - .../src/trait_tests.rs | 513 --- test-utils/stability-runtime/Cargo.toml | 4 +- test-utils/stability-runtime/build.rs | 40 +- 11 files changed, 2113 insertions(+), 1601 deletions(-) delete mode 100644 test-utils/stability-runtime-client/src/trait_tests.rs diff --git a/Cargo.lock b/Cargo.lock index 1a9ae3d4..d9fdcebc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,11 +43,11 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli 0.27.3", + "gimli 0.28.0", ] [[package]] @@ -56,6 +56,15 @@ 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" @@ -63,6 +72,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" dependencies = [ "generic-array 0.14.7", + "rand_core 0.6.4", +] + +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "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]] @@ -72,25 +103,70 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ "cfg-if", - "cipher", + "cipher 0.3.0", "cpufeatures", "opaque-debug 0.3.0", ] +[[package]] +name = "aes" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +dependencies = [ + "cfg-if", + "cipher 0.4.4", + "cpufeatures", +] + [[package]] name = "aes-gcm" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" dependencies = [ - "aead", - "aes", - "cipher", - "ctr", - "ghash", + "aead 0.4.3", + "aes 0.7.5", + "cipher 0.3.0", + "ctr 0.8.0", + "ghash 0.4.4", + "subtle", +] + +[[package]] +name = "aes-gcm" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" +dependencies = [ + "aead 0.5.2", + "aes 0.8.3", + "cipher 0.4.4", + "ctr 0.9.2", + "ghash 0.5.0", "subtle", ] +[[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 = "affix" version = "0.1.2" @@ -113,9 +189,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -144,60 +220,11 @@ dependencies = [ "winapi", ] -[[package]] -name = "anstream" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is-terminal", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" - -[[package]] -name = "anstyle-parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" -dependencies = [ - "windows-sys 0.48.0", -] - -[[package]] -name = "anstyle-wincon" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" -dependencies = [ - "anstyle", - "windows-sys 0.48.0", -] - [[package]] name = "anyhow" -version = "1.0.72" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "approx" @@ -208,6 +235,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "arc-swap" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" + [[package]] name = "array-bytes" version = "4.2.0" @@ -242,57 +275,84 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] -name = "asn1_der" -version = "0.7.6" +name = "asn1-rs" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "155a5a185e42c6b77ac7b88a15143d930a9e9727a5b7b77eed417404ab15c247" +checksum = "30ff05a702273012438132f449575dbc804e27b2f3cbe3069aa237d26c98fa33" +dependencies = [ + "asn1-rs-derive 0.1.0", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time", +] [[package]] -name = "assert_matches" -version = "1.5.0" +name = "asn1-rs" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" +checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" +dependencies = [ + "asn1-rs-derive 0.4.0", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time", +] [[package]] -name = "async-channel" -version = "1.9.0" +name = "asn1-rs-derive" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" dependencies = [ - "concurrent-queue", - "event-listener", - "futures-core", + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", ] [[package]] -name = "async-executor" -version = "1.5.1" +name = "asn1-rs-derive" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" +checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ - "async-lock", - "async-task", - "concurrent-queue", - "fastrand 1.9.0", - "futures-lite", - "slab", + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", ] [[package]] -name = "async-global-executor" -version = "2.3.1" +name = "asn1-rs-impl" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1b6f5d7df27bd294849f8eec66ecfc63d11814df7a4f5d74168a2394467b776" +checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ - "async-channel", - "async-executor", - "async-io", - "async-lock", - "blocking", - "futures-lite", - "once_cell", + "proc-macro2", + "quote", + "syn 1.0.109", ] +[[package]] +name = "asn1_der" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "155a5a185e42c6b77ac7b88a15143d930a9e9727a5b7b77eed417404ab15c247" + +[[package]] +name = "assert_matches" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" + [[package]] name = "async-io" version = "1.13.0" @@ -307,7 +367,7 @@ dependencies = [ "log", "parking", "polling", - "rustix 0.37.23", + "rustix 0.37.25", "slab", "socket2 0.4.9", "waker-fn", @@ -315,28 +375,22 @@ dependencies = [ [[package]] name = "async-lock" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ "event-listener", ] -[[package]] -name = "async-task" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" - [[package]] name = "async-trait" -version = "0.1.72" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -349,14 +403,14 @@ dependencies = [ "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.11", + "pin-project-lite 0.2.13", ] [[package]] name = "atomic-waker" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "atty" @@ -389,16 +443,16 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ - "addr2line 0.20.0", + "addr2line 0.21.0", "cc", "cfg-if", "libc", "miniz_oxide", - "object 0.31.1", + "object 0.32.1", "rustc-demangle", ] @@ -428,9 +482,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "base64ct" @@ -459,7 +513,7 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "sp-api", "sp-beefy", @@ -503,9 +557,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "bitvec" @@ -540,31 +594,31 @@ dependencies = [ [[package]] name = "blake2b_simd" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" +checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq 0.2.6", + "constant_time_eq 0.3.0", ] [[package]] name = "blake2s_simd" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6637f448b9e61dfadbdcbae9a885fadee1f3eaffb1f8d3c1965d3ade8bdfd44f" +checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq 0.2.6", + "constant_time_eq 0.3.0", ] [[package]] name = "blake3" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5" +checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" dependencies = [ "arrayref", "arrayvec 0.7.4", @@ -604,6 +658,16 @@ 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" @@ -619,21 +683,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" -[[package]] -name = "blocking" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" -dependencies = [ - "async-channel", - "async-lock", - "async-task", - "atomic-waker", - "fastrand 1.9.0", - "futures-lite", - "log", -] - [[package]] name = "bs58" version = "0.4.0" @@ -653,9 +702,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" +checksum = "c79ad7fb2dd38f3dabd76b09c6a5a20c038fc0213ef1e9afd30eb777f120f019" dependencies = [ "memchr", "serde", @@ -672,9 +721,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byte-slice-cast" @@ -690,15 +739,15 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "bzip2-sys" @@ -722,9 +771,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" +checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" dependencies = [ "serde", ] @@ -737,7 +786,7 @@ checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ "camino", "cargo-platform", - "semver 1.0.18", + "semver 1.0.20", "serde", "serde_json", ] @@ -750,14 +799,25 @@ checksum = "fd6c0e7b807d60291f42f33f58480c0bfafe28ed08286446f45e463728cf9c1c" [[package]] name = "cc" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", "libc", ] +[[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", +] + [[package]] name = "cexpr" version = "0.6.0" @@ -795,7 +855,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" dependencies = [ "cfg-if", - "cipher", + "cipher 0.3.0", "cpufeatures", "zeroize", ] @@ -806,26 +866,25 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" dependencies = [ - "aead", + "aead 0.4.3", "chacha20", - "cipher", + "cipher 0.3.0", "poly1305", "zeroize", ] [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", - "time", "wasm-bindgen", - "winapi", + "windows-targets 0.48.5", ] [[package]] @@ -836,11 +895,20 @@ checksum = "f6ed9c8b2d17acb8110c46f1da5bf4a696d745e1474a16db0cd2b49cd0249bf2" dependencies = [ "core2", "multibase", - "multihash", + "multihash 0.16.3", "serde", "unsigned-varint", ] +[[package]] +name = "cipher" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" +dependencies = [ + "generic-array 0.14.7", +] + [[package]] name = "cipher" version = "0.3.0" @@ -850,6 +918,16 @@ dependencies = [ "generic-array 0.14.7", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + [[package]] name = "ckb-merkle-mountain-range" version = "0.5.2" @@ -872,44 +950,40 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.21" +version = "4.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c27cdf28c0f604ba3f512b0c9a409f8de8513e4816705deb0498b627e7c3a3fd" +checksum = "f13b9c79b5d1dd500d20ef541215a6423c75829ef43117e1b4d17fd8af0b5d76" dependencies = [ - "clap_builder", + "bitflags 1.3.2", "clap_derive", - "once_cell", -] - -[[package]] -name = "clap_builder" -version = "4.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08a9f1ab5e9f01a9b81f202e8562eb9a10de70abf9eaeac1be465c28b75aa4aa" -dependencies = [ - "anstream", - "anstyle", "clap_lex", + "is-terminal", + "once_cell", "strsim", + "termcolor", ] [[package]] name = "clap_derive" -version = "4.3.12" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" +checksum = "684a277d672e91966334af371f1a7b5833f9aa00b07c84e92fbce95e00208ce8" dependencies = [ "heck", + "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.28", + "syn 1.0.109", ] [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade" +dependencies = [ + "os_str_bytes", +] [[package]] name = "codespan-reporting" @@ -921,12 +995,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "colorchoice" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" - [[package]] name = "comfy-table" version = "6.2.0" @@ -940,9 +1008,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" dependencies = [ "crossbeam-utils", ] @@ -971,12 +1039,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" -[[package]] -name = "constant_time_eq" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" - [[package]] name = "constant_time_eq" version = "0.3.0" @@ -1137,22 +1199,27 @@ dependencies = [ ] [[package]] -name = "crc32fast" -version = "1.3.2" +name = "crc" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" dependencies = [ - "cfg-if", + "crc-catalog", ] [[package]] -name = "crossbeam-channel" -version = "0.5.8" +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" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if", - "crossbeam-utils", ] [[package]] @@ -1213,6 +1280,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array 0.14.7", + "rand_core 0.6.4", "typenum", ] @@ -1242,12 +1310,21 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" dependencies = [ - "cipher", + "cipher 0.3.0", ] [[package]] -name = "curve25519-dalek" -version = "2.1.3" +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher 0.4.4", +] + +[[package]] +name = "curve25519-dalek" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" dependencies = [ @@ -1273,23 +1350,37 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.0.0-rc.1" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d4ba9852b42210c7538b75484f9daa0655e9a3ac04f693747bb0f02cf3cfe16" +checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" dependencies = [ "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", "fiat-crypto", - "packed_simd_2", - "platforms 3.0.2", + "platforms 3.1.2", + "rustc_version", "subtle", "zeroize", ] +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + [[package]] name = "cxx" -version = "1.0.104" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1ba0a82363c553ecb7b4cd58ba6e1c017baef8e3cca4e7d66ca17879201144" +checksum = "c390c123d671cc547244943ecad81bdaab756c6ea332d9ca9c1f48d952a24895" dependencies = [ "cc", "cxxbridge-flags", @@ -1299,9 +1390,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.104" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac9ec8372f860c6ee7c6463b96a26d08dd590bcbcd9bf2d1894db09ae81410d3" +checksum = "00d3d3ac9ffb900304edf51ca719187c779f4001bb544f26c4511d621de905cf" dependencies = [ "cc", "codespan-reporting", @@ -1309,24 +1400,59 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] name = "cxxbridge-flags" -version = "1.0.104" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "409667bbb937bae87f7cfa91ca29e1415bb92d415371e3344b5269c10d90d595" +checksum = "94415827ecfea0f0c74c8cad7d1a86ddb3f05354d6a6ddeda0adee5e875d2939" [[package]] name = "cxxbridge-macro" -version = "1.0.104" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33dbbe9f5621c9247f97ec14213b04f350bff4b6cebefe834c60055db266ecf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb2a9757fb085d6d97856b28d4f049141ca4a61a64c697f4426433b5f6caa1f" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" dependencies = [ + "fnv", + "ident_case", "proc-macro2", "quote", - "syn 2.0.28", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", ] [[package]] @@ -1360,11 +1486,59 @@ 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.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ "const-oid", "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", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] + +[[package]] +name = "deranged" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +dependencies = [ + "powerfmt", +] + [[package]] name = "derivative" version = "2.2.0" @@ -1376,6 +1550,37 @@ 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", + "proc-macro2", + "quote", + "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" @@ -1472,13 +1677,14 @@ dependencies = [ ] [[package]] -name = "dns-parser" -version = "0.8.0" +name = "displaydoc" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4d33be9473d06f75f58220f71f7a9317aca647dc061dbd3c361b0bef505fbea" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ - "byteorder", - "quick-error", + "proc-macro2", + "quote", + "syn 2.0.38", ] [[package]] @@ -1522,9 +1728,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "304e6508efa593091e97a9abbc10f90aa7ca635b6d2784feff3c89d41dd12272" +checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd" [[package]] name = "ecdsa" @@ -1532,10 +1738,10 @@ version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" dependencies = [ - "der", + "der 0.6.1", "elliptic-curve", "rfc6979", - "signature", + "signature 1.6.4", ] [[package]] @@ -1544,7 +1750,17 @@ version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" dependencies = [ - "signature", + "signature 1.6.4", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8 0.10.2", + "signature 2.1.0", ] [[package]] @@ -1554,13 +1770,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ "curve25519-dalek 3.2.0", - "ed25519", + "ed25519 1.5.3", "rand 0.7.3", "serde", "sha2 0.9.9", "zeroize", ] +[[package]] +name = "ed25519-dalek" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" +dependencies = [ + "curve25519-dalek 4.1.1", + "ed25519 2.2.3", + "rand_core 0.6.4", + "serde", + "sha2 0.10.8", + "zeroize", +] + [[package]] name = "ed25519-zebra" version = "3.1.0" @@ -1568,7 +1798,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" dependencies = [ "curve25519-dalek 3.2.0", - "hashbrown", + "hashbrown 0.12.3", "hex", "rand_core 0.6.4", "sha2 0.9.9", @@ -1589,11 +1819,14 @@ checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" dependencies = [ "base16ct", "crypto-bigint", - "der", + "der 0.6.1", "digest 0.10.7", "ff", "generic-array 0.14.7", "group", + "hkdf", + "pem-rfc7468", + "pkcs8 0.9.0", "rand_core 0.6.4", "sec1", "subtle", @@ -1608,9 +1841,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] @@ -1646,6 +1879,12 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" version = "0.2.8" @@ -1659,11 +1898,10 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.2" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" +checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" dependencies = [ - "errno-dragonfly", "libc", "windows-sys 0.48.0", ] @@ -1829,14 +2067,14 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fc-cli" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "clap", "ethereum-types", @@ -1854,7 +2092,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "async-trait", "fc-db", @@ -1873,7 +2111,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "fp-storage", "kvdb-rocksdb", @@ -1892,7 +2130,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "fc-db", "fp-consensus", @@ -1909,7 +2147,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "ethereum", "ethereum-types", @@ -1951,7 +2189,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "ethereum", "ethereum-types", @@ -1982,9 +2220,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.1.20" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" +checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" [[package]] name = "file-per-thread-logger" @@ -2044,9 +2282,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "libz-sys", @@ -2086,7 +2324,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "parity-scale-codec", ] @@ -2103,7 +2341,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "ethereum", "parity-scale-codec", @@ -2115,7 +2353,7 @@ dependencies = [ [[package]] name = "fp-ethereum" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "ethereum", "ethereum-types", @@ -2129,20 +2367,21 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "evm", "frame-support", "parity-scale-codec", "serde", "sp-core", + "sp-runtime", "sp-std", ] [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "ethereum", "ethereum-types", @@ -2158,7 +2397,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "frame-support", "parity-scale-codec", @@ -2170,7 +2409,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "parity-scale-codec", "serde", @@ -2185,7 +2424,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "frame-support", "frame-system", @@ -2208,7 +2447,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#f38bd6671d460293c93062cc1e4fe9e9e490cb29" dependencies = [ "Inflector", "array-bytes", @@ -2220,16 +2459,13 @@ dependencies = [ "frame-system", "gethostname", "handlebars", - "hash-db", "itertools", - "kvdb", "lazy_static", "linked-hash-map", "log", - "memory-db", "parity-scale-codec", "rand 0.8.5", - "rand_pcg 0.3.1", + "rand_pcg", "sc-block-builder", "sc-cli", "sc-client-api", @@ -2239,7 +2475,6 @@ dependencies = [ "sc-sysinfo", "serde", "serde_json", - "serde_nanos", "sp-api", "sp-blockchain", "sp-core", @@ -2252,7 +2487,6 @@ dependencies = [ "sp-std", "sp-storage", "sp-trie", - "tempfile", "thiserror", "thousands", ] @@ -2260,7 +2494,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "frame-support", "frame-system", @@ -2288,7 +2522,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "bitflags 1.3.2", "frame-metadata", @@ -2320,7 +2554,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "Inflector", "cfg-expr", @@ -2334,7 +2568,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2346,7 +2580,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "proc-macro2", "quote", @@ -2356,7 +2590,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "frame-support", "log", @@ -2374,7 +2608,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "frame-benchmarking", "frame-support", @@ -2389,7 +2623,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "parity-scale-codec", "sp-api", @@ -2471,7 +2705,7 @@ dependencies = [ "futures-io", "memchr", "parking", - "pin-project-lite 0.2.11", + "pin-project-lite 0.2.13", "waker-fn", ] @@ -2483,7 +2717,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -2493,8 +2727,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" dependencies = [ "futures-io", - "rustls", - "webpki", + "rustls 0.20.9", + "webpki 0.22.4", ] [[package]] @@ -2528,7 +2762,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.11", + "pin-project-lite 0.2.13", "pin-utils", "slab", ] @@ -2578,10 +2812,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi 0.9.0+wasi-snapshot-preview1", - "wasm-bindgen", ] [[package]] @@ -2602,7 +2834,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" dependencies = [ "opaque-debug 0.3.0", - "polyval", + "polyval 0.5.3", +] + +[[package]] +name = "ghash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" +dependencies = [ + "opaque-debug 0.3.0", + "polyval 0.6.1", ] [[package]] @@ -2612,15 +2854,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" dependencies = [ "fallible-iterator", - "indexmap", + "indexmap 1.9.3", "stable_deref_trait", ] [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "glob" @@ -2635,7 +2877,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" dependencies = [ "aho-corasick", - "bstr 1.6.0", + "bstr 1.7.0", "fnv", "log", "regex", @@ -2654,9 +2896,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -2664,7 +2906,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -2673,9 +2915,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "4.3.7" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c3372087601b532857d332f5957cbae686da52bb7810bf038c3e3c3cc2fa0d" +checksum = "c39b3bc2a8f715298032cf5087e58573809374b08160aa7d750582bdb82d2683" dependencies = [ "log", "pest", @@ -2709,6 +2951,12 @@ dependencies = [ "ahash", ] +[[package]] +name = "hashbrown" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" + [[package]] name = "heck" version = "0.4.1" @@ -2726,9 +2974,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -2742,6 +2990,15 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +[[package]] +name = "hkdf" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +dependencies = [ + "hmac 0.12.1", +] + [[package]] name = "hmac" version = "0.8.1" @@ -2782,6 +3039,15 @@ dependencies = [ "hmac 0.8.1", ] +[[package]] +name = "home" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +dependencies = [ + "windows-sys 0.48.0", +] + [[package]] name = "hostname" version = "0.3.1" @@ -2812,7 +3078,7 @@ checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", "http", - "pin-project-lite 0.2.11", + "pin-project-lite 0.2.13", ] [[package]] @@ -2829,9 +3095,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" @@ -2855,7 +3121,7 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project-lite 0.2.11", + "pin-project-lite 0.2.13", "socket2 0.4.9", "tokio", "tower-service", @@ -2872,7 +3138,7 @@ dependencies = [ "http", "hyper", "log", - "rustls", + "rustls 0.20.9", "rustls-native-certs", "tokio", "tokio-rustls", @@ -2893,16 +3159,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.57" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows 0.48.0", + "windows-core", ] [[package]] @@ -2914,6 +3180,12 @@ dependencies = [ "cc", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.2.3" @@ -2947,9 +3219,9 @@ dependencies = [ [[package]] name = "if-watch" -version = "2.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "065c008e570a43c00de6aed9714035e5ea6a498c255323db9091722af6ee67dd" +checksum = "bbb892e5777fe09e16f3d44de7802f4daa7267ecbe8c466f19d94e25bb0c303e" dependencies = [ "async-io", "core-foundation", @@ -2960,7 +3232,8 @@ dependencies = [ "log", "rtnetlink", "system-configuration", - "windows 0.34.0", + "tokio", + "windows", ] [[package]] @@ -3017,10 +3290,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", "serde", ] +[[package]] +name = "indexmap" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +dependencies = [ + "equivalent", + "hashbrown 0.14.1", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array 0.14.7", +] + [[package]] name = "instant" version = "0.1.12" @@ -3039,6 +3331,25 @@ 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 = "io-lifetimes" version = "0.7.5" @@ -3051,7 +3362,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.3", "libc", "windows-sys 0.48.0", ] @@ -3068,10 +3379,10 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.3", + "socket2 0.5.4", "widestring", "windows-sys 0.48.0", - "winreg 0.50.0", + "winreg", ] [[package]] @@ -3086,8 +3397,8 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.2", - "rustix 0.38.7", + "hermit-abi 0.3.3", + "rustix 0.38.19", "windows-sys 0.48.0", ] @@ -3108,9 +3419,9 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" dependencies = [ "libc", ] @@ -3126,22 +3437,22 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d291e3a5818a2384645fd9756362e6d89cf0541b0b916fa7702ea4a9833608e" +checksum = "367a292944c07385839818bb71c8d76611138e2dedb0677d035b8da21d29c78b" dependencies = [ - "jsonrpsee-core 0.16.2", + "jsonrpsee-core 0.16.3", "jsonrpsee-proc-macros", "jsonrpsee-server", - "jsonrpsee-types 0.16.2", + "jsonrpsee-types 0.16.3", "tracing", ] [[package]] name = "jsonrpsee-core" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e70b4439a751a5de7dd5ed55eacff78ebf4ffe0fc009cb1ebb11417f5b536b" +checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803" dependencies = [ "anyhow", "arrayvec 0.7.4", @@ -3151,7 +3462,7 @@ dependencies = [ "futures-util", "globset", "hyper", - "jsonrpsee-types 0.16.2", + "jsonrpsee-types 0.16.3", "parking_lot 0.12.1", "rand 0.8.5", "rustc-hash", @@ -3181,9 +3492,9 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baa6da1e4199c10d7b1d0a6e5e8bd8e55f351163b6f4b3cbb044672a69bd4c1c" +checksum = "44e8ab85614a08792b9bff6c8feee23be78c98d0182d4c622c05256ab553892a" dependencies = [ "heck", "proc-macro-crate", @@ -3194,16 +3505,16 @@ dependencies = [ [[package]] name = "jsonrpsee-server" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb69dad85df79527c019659a992498d03f8495390496da2f07e6c24c2b356fc" +checksum = "cf4d945a6008c9b03db3354fb3c83ee02d2faa9f2e755ec1dfb69c3551b8f4ba" dependencies = [ "futures-channel", "futures-util", "http", "hyper", - "jsonrpsee-core 0.16.2", - "jsonrpsee-types 0.16.2", + "jsonrpsee-core 0.16.3", + "jsonrpsee-types 0.16.3", "serde", "serde_json", "soketto", @@ -3216,9 +3527,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd522fe1ce3702fd94812965d7bb7a3364b1c9aba743944c5a00529aae80f8c" +checksum = "245ba8e5aa633dd1c1e4fae72bce06e71f42d34c14a2767c6b4d173b57bee5e5" dependencies = [ "anyhow", "beef", @@ -3251,7 +3562,7 @@ dependencies = [ "cfg-if", "ecdsa", "elliptic-curve", - "sha2 0.10.7", + "sha2 0.10.8", ] [[package]] @@ -3302,7 +3613,7 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" dependencies = [ - "spin", + "spin 0.5.2", ] [[package]] @@ -3313,9 +3624,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "libloading" @@ -3329,29 +3640,22 @@ dependencies = [ [[package]] name = "libm" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" - -[[package]] -name = "libm" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libp2p" -version = "0.49.0" +version = "0.50.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec878fda12ebec479186b3914ebc48ff180fa4c51847e11a1a68bf65249e02c1" +checksum = "9c7b0104790be871edcf97db9bd2356604984e623a08d825c3f27852290266b8" dependencies = [ "bytes", "futures", "futures-timer", "getrandom 0.2.10", "instant", - "lazy_static", - "libp2p-core", + "libp2p-core 0.38.0", "libp2p-dns", "libp2p-identify", "libp2p-kad", @@ -3360,14 +3664,15 @@ dependencies = [ "libp2p-mplex", "libp2p-noise", "libp2p-ping", + "libp2p-quic", "libp2p-request-response", "libp2p-swarm", - "libp2p-swarm-derive", "libp2p-tcp", "libp2p-wasm-ext", + "libp2p-webrtc", "libp2p-websocket", "libp2p-yamux", - "multiaddr", + "multiaddr 0.16.0", "parking_lot 0.12.1", "pin-project", "smallvec", @@ -3375,30 +3680,31 @@ dependencies = [ [[package]] name = "libp2p-core" -version = "0.37.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799676bb0807c788065e57551c6527d461ad572162b0519d1958946ff9e0539d" +checksum = "b6a8fcd392ff67af6cc3f03b1426c41f7f26b6b9aff2dc632c1c56dd649e571f" dependencies = [ "asn1_der", "bs58", - "ed25519-dalek", + "ed25519-dalek 1.0.1", "either", "fnv", "futures", "futures-timer", "instant", - "lazy_static", "log", - "multiaddr", - "multihash", + "multiaddr 0.16.0", + "multihash 0.16.3", "multistream-select", + "once_cell", "parking_lot 0.12.1", "pin-project", "prost", "prost-build", "rand 0.8.5", "rw-stream-sink", - "sha2 0.10.7", + "sec1", + "sha2 0.10.8", "smallvec", "thiserror", "unsigned-varint", @@ -3406,14 +3712,42 @@ dependencies = [ "zeroize", ] +[[package]] +name = "libp2p-core" +version = "0.39.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c1df63c0b582aa434fb09b2d86897fa2b419ffeccf934b36f87fcedc8e835c2" +dependencies = [ + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "libp2p-identity", + "log", + "multiaddr 0.17.1", + "multihash 0.17.0", + "multistream-select", + "once_cell", + "parking_lot 0.12.1", + "pin-project", + "quick-protobuf", + "rand 0.8.5", + "rw-stream-sink", + "smallvec", + "thiserror", + "unsigned-varint", + "void", +] + [[package]] name = "libp2p-dns" -version = "0.37.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2322c9fb40d99101def6a01612ee30500c89abbbecb6297b3cd252903a4c1720" +checksum = "8e42a271c1b49f789b92f7fc87749fa79ce5c7bdc88cbdfacb818a4bca47fec5" dependencies = [ "futures", - "libp2p-core", + "libp2p-core 0.38.0", "log", "parking_lot 0.12.1", "smallvec", @@ -3422,14 +3756,14 @@ dependencies = [ [[package]] name = "libp2p-identify" -version = "0.40.0" +version = "0.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf9a121f699e8719bda2e6e9e9b6ddafc6cff4602471d6481c1067930ccb29b" +checksum = "c052d0026f4817b44869bfb6810f4e1112f43aec8553f2cb38881c524b563abf" dependencies = [ "asynchronous-codec", "futures", "futures-timer", - "libp2p-core", + "libp2p-core 0.38.0", "libp2p-swarm", "log", "lru", @@ -3442,26 +3776,44 @@ dependencies = [ ] [[package]] -name = "libp2p-kad" -version = "0.41.0" +name = "libp2p-identity" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6721c200e2021f6c3fab8b6cf0272ead8912d871610ee194ebd628cecf428f22" +checksum = "276bb57e7af15d8f100d3c11cbdd32c6752b7eef4ba7a18ecf464972c07abcce" dependencies = [ - "arrayvec 0.7.4", - "asynchronous-codec", + "bs58", + "ed25519-dalek 2.0.0", + "log", + "multiaddr 0.17.1", + "multihash 0.17.0", + "quick-protobuf", + "rand 0.8.5", + "sha2 0.10.8", + "thiserror", + "zeroize", +] + +[[package]] +name = "libp2p-kad" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2766dcd2be8c87d5e1f35487deb22d765f49c6ae1251b3633efe3b25698bd3d2" +dependencies = [ + "arrayvec 0.7.4", + "asynchronous-codec", "bytes", "either", "fnv", "futures", "futures-timer", "instant", - "libp2p-core", + "libp2p-core 0.38.0", "libp2p-swarm", "log", "prost", "prost-build", "rand 0.8.5", - "sha2 0.10.7", + "sha2 0.10.8", "smallvec", "thiserror", "uint", @@ -3471,31 +3823,31 @@ dependencies = [ [[package]] name = "libp2p-mdns" -version = "0.41.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "761704e727f7d68d58d7bc2231eafae5fc1b9814de24290f126df09d4bd37a15" +checksum = "04f378264aade9872d6ccd315c0accc18be3a35d15fc1b9c36e5b6f983b62b5b" dependencies = [ "data-encoding", - "dns-parser", "futures", "if-watch", - "libp2p-core", + "libp2p-core 0.38.0", "libp2p-swarm", "log", "rand 0.8.5", "smallvec", "socket2 0.4.9", "tokio", + "trust-dns-proto", "void", ] [[package]] name = "libp2p-metrics" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ee31b08e78b7b8bfd1c4204a9dd8a87b4fcdf6dafc57eb51701c1c264a81cb9" +checksum = "5ad8a64f29da86005c86a4d2728b8a0719e9b192f4092b609fd8790acb9dec55" dependencies = [ - "libp2p-core", + "libp2p-core 0.38.0", "libp2p-identify", "libp2p-kad", "libp2p-ping", @@ -3505,14 +3857,14 @@ dependencies = [ [[package]] name = "libp2p-mplex" -version = "0.37.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692664acfd98652de739a8acbb0a0d670f1d67190a49be6b4395e22c37337d89" +checksum = "03805b44107aa013e7cbbfa5627b31c36cbedfdfb00603c0311998882bc4bace" dependencies = [ "asynchronous-codec", "bytes", "futures", - "libp2p-core", + "libp2p-core 0.38.0", "log", "nohash-hasher", "parking_lot 0.12.1", @@ -3523,53 +3875,75 @@ dependencies = [ [[package]] name = "libp2p-noise" -version = "0.40.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "048155686bd81fe6cb5efdef0c6290f25ad32a0a42e8f4f72625cf6a505a206f" +checksum = "a978cb57efe82e892ec6f348a536bfbd9fee677adbe5689d7a93ad3a9bffbf2e" dependencies = [ "bytes", "curve25519-dalek 3.2.0", "futures", - "lazy_static", - "libp2p-core", + "libp2p-core 0.38.0", "log", + "once_cell", "prost", "prost-build", "rand 0.8.5", - "sha2 0.10.7", + "sha2 0.10.8", "snow", "static_assertions", - "x25519-dalek", + "thiserror", + "x25519-dalek 1.1.1", "zeroize", ] [[package]] name = "libp2p-ping" -version = "0.40.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7228b9318d34689521349a86eb39a3c3a802c9efc99a0568062ffb80913e3f91" +checksum = "929fcace45a112536e22b3dcfd4db538723ef9c3cb79f672b98be2cc8e25f37f" dependencies = [ "futures", "futures-timer", "instant", - "libp2p-core", + "libp2p-core 0.38.0", "libp2p-swarm", "log", "rand 0.8.5", "void", ] +[[package]] +name = "libp2p-quic" +version = "0.7.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01e7c867e95c8130667b24409d236d37598270e6da69b3baf54213ba31ffca59" +dependencies = [ + "bytes", + "futures", + "futures-timer", + "if-watch", + "libp2p-core 0.38.0", + "libp2p-tls", + "log", + "parking_lot 0.12.1", + "quinn-proto", + "rand 0.8.5", + "rustls 0.20.9", + "thiserror", + "tokio", +] + [[package]] name = "libp2p-request-response" -version = "0.22.1" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8827af16a017b65311a410bb626205a9ad92ec0473967618425039fa5231adc1" +checksum = "3236168796727bfcf4927f766393415361e2c644b08bedb6a6b13d957c9a4884" dependencies = [ "async-trait", "bytes", "futures", "instant", - "libp2p-core", + "libp2p-core 0.38.0", "libp2p-swarm", "log", "rand 0.8.5", @@ -3579,29 +3953,31 @@ dependencies = [ [[package]] name = "libp2p-swarm" -version = "0.40.1" +version = "0.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46d13df7c37807965d82930c0e4b04a659efcb6cca237373b206043db5398ecf" +checksum = "b2a35472fe3276b3855c00f1c032ea8413615e030256429ad5349cdf67c6e1a0" dependencies = [ "either", "fnv", "futures", "futures-timer", "instant", - "libp2p-core", + "libp2p-core 0.38.0", + "libp2p-swarm-derive", "log", "pin-project", "rand 0.8.5", "smallvec", "thiserror", + "tokio", "void", ] [[package]] name = "libp2p-swarm-derive" -version = "0.30.1" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0eddc4497a8b5a506013c40e8189864f9c3a00db2b25671f428ae9007f3ba32" +checksum = "9d527d5827582abd44a6d80c07ff8b50b4ee238a8979e05998474179e79dc400" dependencies = [ "heck", "quote", @@ -3610,44 +3986,94 @@ dependencies = [ [[package]] name = "libp2p-tcp" -version = "0.37.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9839d96761491c6d3e238e70554b856956fca0ab60feb9de2cd08eed4473fa92" +checksum = "b4b257baf6df8f2df39678b86c578961d48cc8b68642a12f0f763f56c8e5858d" dependencies = [ "futures", "futures-timer", "if-watch", "libc", - "libp2p-core", + "libp2p-core 0.38.0", "log", "socket2 0.4.9", "tokio", ] +[[package]] +name = "libp2p-tls" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff08d13d0dc66e5e9ba6279c1de417b84fa0d0adc3b03e5732928c180ec02781" +dependencies = [ + "futures", + "futures-rustls", + "libp2p-core 0.39.2", + "libp2p-identity", + "rcgen 0.10.0", + "ring 0.16.20", + "rustls 0.20.9", + "thiserror", + "webpki 0.22.4", + "x509-parser 0.14.0", + "yasna", +] + [[package]] name = "libp2p-wasm-ext" -version = "0.37.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b5b8e7a73e379e47b1b77f8a82c4721e97eca01abcd18e9cd91a23ca6ce97" +checksum = "1bb1a35299860e0d4b3c02a3e74e3b293ad35ae0cee8a056363b0c862d082069" dependencies = [ "futures", "js-sys", - "libp2p-core", + "libp2p-core 0.38.0", "parity-send-wrapper", "wasm-bindgen", "wasm-bindgen-futures", ] +[[package]] +name = "libp2p-webrtc" +version = "0.4.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb6cd86dd68cba72308ea05de1cebf3ba0ae6e187c40548167955d4e3970f6a" +dependencies = [ + "async-trait", + "asynchronous-codec", + "bytes", + "futures", + "futures-timer", + "hex", + "if-watch", + "libp2p-core 0.38.0", + "libp2p-noise", + "log", + "multihash 0.16.3", + "prost", + "prost-build", + "prost-codec", + "rand 0.8.5", + "rcgen 0.9.3", + "serde", + "stun", + "thiserror", + "tinytemplate", + "tokio", + "tokio-util", + "webrtc", +] + [[package]] name = "libp2p-websocket" -version = "0.39.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3758ae6f89b2531a24b6d9f5776bda6a626b60a57600d7185d43dfa75ca5ecc4" +checksum = "1d705506030d5c0aaf2882437c70dab437605f21c5f9811978f694e6917a3b54" dependencies = [ "either", "futures", "futures-rustls", - "libp2p-core", + "libp2p-core 0.38.0", "log", "parking_lot 0.12.1", "quicksink", @@ -3659,12 +4085,12 @@ dependencies = [ [[package]] name = "libp2p-yamux" -version = "0.41.1" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6874d66543c4f7e26e3b8ca9a6bead351563a13ab4fafd43c7927f7c0d6c12" +checksum = "4f63594a0aa818642d9d4915c791945053877253f08a3626f13416b5cd928a29" dependencies = [ "futures", - "libp2p-core", + "libp2p-core 0.38.0", "log", "parking_lot 0.12.1", "thiserror", @@ -3793,15 +4219,15 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.5" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -3809,9 +4235,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lru" @@ -3819,7 +4245,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" dependencies = [ - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -3898,27 +4324,37 @@ checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "matrixmultiply" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090126dc04f95dc0d1c1c91f61bdd474b3930ca064c1edc8a849da2c6cbe1e77" +checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" dependencies = [ "autocfg", "rawpointer", ] +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest 0.10.7", +] + [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memfd" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.37.23", + "rustix 0.38.19", ] [[package]] @@ -3955,7 +4391,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e0c7cba9ce19ac7ffd2053ac9f49843bbd3f4318feedfd74e85c19d5fb0ba66" dependencies = [ "hash-db", - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -4037,15 +4473,34 @@ dependencies = [ [[package]] name = "multiaddr" -version = "0.14.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c580bfdd8803cce319b047d239559a22f809094aaea4ac13902a1fdcfcd4261" +checksum = "a4aebdb21e90f81d13ed01dc84123320838e53963c2ca94b60b305d3fa64f31e" dependencies = [ "arrayref", - "bs58", "byteorder", "data-encoding", - "multihash", + "multibase", + "multihash 0.16.3", + "percent-encoding", + "serde", + "static_assertions", + "unsigned-varint", + "url", +] + +[[package]] +name = "multiaddr" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b36f567c7099511fa8612bbbb52dda2419ce0bdbacf31714e3a5ffdb766d3bd" +dependencies = [ + "arrayref", + "byteorder", + "data-encoding", + "log", + "multibase", + "multihash 0.17.0", "percent-encoding", "serde", "static_assertions", @@ -4076,11 +4531,22 @@ dependencies = [ "core2", "digest 0.10.7", "multihash-derive", - "sha2 0.10.7", + "sha2 0.10.8", "sha3 0.10.8", "unsigned-varint", ] +[[package]] +name = "multihash" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" +dependencies = [ + "core2", + "multihash-derive", + "unsigned-varint", +] + [[package]] name = "multihash-derive" version = "0.8.1" @@ -4230,11 +4696,11 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" dependencies = [ - "async-io", "bytes", "futures", "libc", "log", + "tokio", ] [[package]] @@ -4246,6 +4712,7 @@ dependencies = [ "bitflags 1.3.2", "cfg-if", "libc", + "memoffset 0.6.5", ] [[package]] @@ -4292,9 +4759,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", @@ -4303,9 +4770,9 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" dependencies = [ "num-traits", ] @@ -4355,12 +4822,12 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", - "libm 0.2.7", + "libm", ] [[package]] @@ -4369,7 +4836,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.3", "libc", ] @@ -4401,20 +4868,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" dependencies = [ "crc32fast", - "hashbrown", - "indexmap", + "hashbrown 0.12.3", + "indexmap 1.9.3", "memchr", ] [[package]] name = "object" -version = "0.31.1" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" 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", +] + [[package]] name = "once_cell" version = "1.18.0" @@ -4435,11 +4920,11 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.56" +version = "0.10.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729b745ad4a5575dd06a3e1af1414bd330ee561c01b3899eb584baeaa8def17e" +checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", "cfg-if", "foreign-types", "libc", @@ -4456,7 +4941,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -4467,9 +4952,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.91" +version = "0.9.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "866b5f16f90776b9bb8dc1e1802ac6f0513de3a7a7465867bfbc563dc737faac" +checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" dependencies = [ "cc", "libc", @@ -4478,19 +4963,37 @@ dependencies = [ ] [[package]] -name = "packed_simd_2" -version = "0.3.8" +name = "os_str_bytes" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" + +[[package]] +name = "p256" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1914cd452d8fccd6f9db48147b29fd4ae05bea9dc5d9ad578509f72415de282" +checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" dependencies = [ - "cfg-if", - "libm 0.1.4", + "ecdsa", + "elliptic-curve", + "sha2 0.10.8", +] + +[[package]] +name = "p384" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" +dependencies = [ + "ecdsa", + "elliptic-curve", + "sha2 0.10.8", ] [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "frame-support", "frame-system", @@ -4506,7 +5009,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "frame-support", "frame-system", @@ -4521,7 +5024,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "frame-benchmarking", "frame-support", @@ -4545,7 +5048,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "frame-benchmarking", "frame-support", @@ -4560,7 +5063,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "fp-evm", "frame-support", @@ -4574,7 +5077,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "frame-benchmarking", "frame-support", @@ -4661,7 +5164,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "ethereum", "ethereum-types", @@ -4687,7 +5190,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "environmental", "evm", @@ -4696,6 +5199,7 @@ dependencies = [ "frame-support", "frame-system", "hex", + "impl-trait-for-tuples", "log", "pallet-timestamp", "parity-scale-codec", @@ -4710,7 +5214,7 @@ dependencies = [ [[package]] name = "pallet-evm-chain-id" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "frame-support", "frame-system", @@ -4721,7 +5225,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-blake2" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "fp-evm", ] @@ -4729,7 +5233,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-bn128" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "fp-evm", "sp-core", @@ -4739,7 +5243,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "fp-evm", "num", @@ -4748,7 +5252,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-sha3fips" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "fp-evm", "tiny-keccak", @@ -4757,7 +5261,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "fp-evm", "ripemd", @@ -4783,7 +5287,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "frame-benchmarking", "frame-support", @@ -4806,7 +5310,7 @@ dependencies = [ [[package]] name = "pallet-hotfix-sufficients" version = "1.0.0" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.36#977dab0774152e0be5779b73cccb6756ce48de38" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" dependencies = [ "frame-benchmarking", "frame-support", @@ -4836,7 +5340,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "frame-support", "frame-system", @@ -4887,7 +5391,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "frame-support", "frame-system", @@ -4917,7 +5421,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "frame-benchmarking", "frame-support", @@ -4935,7 +5439,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "frame-support", "frame-system", @@ -4951,7 +5455,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -4967,7 +5471,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5113,9 +5617,9 @@ dependencies = [ [[package]] name = "parity-db" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78f19d20a0d2cc52327a88d131fa1c4ea81ea4a04714aedcfeca2dd410049cf8" +checksum = "59e9ab494af9e6e813c72170f0d3c1de1500990d62c97cc05cc7576f91aa402f" dependencies = [ "blake2", "crc32fast", @@ -5133,9 +5637,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.4" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8e946cc0cc711189c0b0249fb8b599cbeeab9784d83c415719368bb8d4ac64" +checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" dependencies = [ "arrayvec 0.7.4", "bitvec", @@ -5148,9 +5652,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.4" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a296c3079b5fefbc499e1de58dc26c09b1b9a5952d26694ee89f04a43ebbb3e" +checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -5172,9 +5676,9 @@ checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" [[package]] name = "parking" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" @@ -5194,7 +5698,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.8", + "parking_lot_core 0.9.9", ] [[package]] @@ -5213,15 +5717,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall 0.4.1", "smallvec", - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -5232,20 +5736,20 @@ checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "pbkdf2" -version = "0.4.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" +checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" dependencies = [ - "crypto-mac 0.8.0", + "crypto-mac 0.11.1", ] [[package]] name = "pbkdf2" -version = "0.8.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "crypto-mac 0.11.1", + "digest 0.10.7", ] [[package]] @@ -5254,6 +5758,24 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" +[[package]] +name = "pem" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +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" @@ -5262,19 +5784,20 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" +checksum = "c022f1e7b65d6a24c0dbbd5fb344c66881bc01f3e5ae74a1c8100f2f985d98a4" dependencies = [ + "memchr", "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "666d00490d4ac815001da55838c500eafb0320019bbaa44444137c48b443a853" +checksum = "35513f630d46400a977c4cb58f78e1bfbe01434316e60c37d27b9ad6139c66d8" dependencies = [ "pest", "pest_generator", @@ -5282,36 +5805,36 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ca01446f50dbda87c1786af8770d535423fa8a53aec03b8f4e3d7eb10e0929" +checksum = "bc9fc1b9e7057baba189b5c626e2d6f40681ae5b6eb064dc7c7834101ec8123a" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] name = "pest_meta" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56af0a30af74d0445c0bf6d9d051c979b516a1a5af790d251daee76005420a48" +checksum = "1df74e9e7ec4053ceb980e7c0c8bd3594e977fde1af91daba9c928e8e8c6708d" dependencies = [ "once_cell", "pest", - "sha2 0.10.7", + "sha2 0.10.8", ] [[package]] name = "petgraph" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 2.0.2", ] [[package]] @@ -5331,7 +5854,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -5342,9 +5865,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.11" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c516611246607d0c04186886dbb3a754368ef82c79e9827a802c6d836dd111c" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -5358,8 +5881,18 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" dependencies = [ - "der", - "spki", + "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.8", + "spki 0.7.2", ] [[package]] @@ -5376,9 +5909,9 @@ checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" [[package]] name = "platforms" -version = "3.0.2" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" +checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" [[package]] name = "polling" @@ -5392,7 +5925,7 @@ dependencies = [ "concurrent-queue", "libc", "log", - "pin-project-lite 0.2.11", + "pin-project-lite 0.2.13", "windows-sys 0.48.0", ] @@ -5404,7 +5937,7 @@ checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" dependencies = [ "cpufeatures", "opaque-debug 0.3.0", - "universal-hash", + "universal-hash 0.4.1", ] [[package]] @@ -5416,9 +5949,27 @@ dependencies = [ "cfg-if", "cpufeatures", "opaque-debug 0.3.0", - "universal-hash", + "universal-hash 0.4.1", +] + +[[package]] +name = "polyval" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug 0.3.0", + "universal-hash 0.5.1", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -5694,9 +6245,9 @@ dependencies = [ [[package]] name = "primitive-types" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", @@ -5742,9 +6293,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -5820,9 +6371,9 @@ dependencies = [ [[package]] name = "prost-codec" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "011ae9ff8359df7915f97302d591cdd9e0e27fbd5a4ddc5bd13b71079bb20987" +checksum = "0dc34979ff898b6e141106178981ce2596c387ea6e62533facfc61a37fc879c0" dependencies = [ "asynchronous-codec", "bytes", @@ -5868,6 +6419,15 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quick-protobuf" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" +dependencies = [ + "byteorder", +] + [[package]] name = "quicksink" version = "0.1.2" @@ -5879,11 +6439,29 @@ dependencies = [ "pin-project-lite 0.1.12", ] +[[package]] +name = "quinn-proto" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" +dependencies = [ + "bytes", + "rand 0.8.5", + "ring 0.16.20", + "rustc-hash", + "rustls 0.20.9", + "slab", + "thiserror", + "tinyvec", + "tracing", + "webpki 0.22.4", +] + [[package]] name = "quote" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -5905,7 +6483,6 @@ dependencies = [ "rand_chacha 0.2.2", "rand_core 0.5.1", "rand_hc", - "rand_pcg 0.2.1", ] [[package]] @@ -5976,15 +6553,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rand_pcg" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" -dependencies = [ - "rand_core 0.5.1", -] - [[package]] name = "rand_pcg" version = "0.3.1" @@ -6002,9 +6570,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" dependencies = [ "either", "rayon-core", @@ -6012,21 +6580,44 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] -name = "redox_syscall" -version = "0.2.16" +name = "rcgen" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" +dependencies = [ + "pem", + "ring 0.16.20", + "time", + "x509-parser 0.13.2", + "yasna", +] + +[[package]] +name = "rcgen" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" +dependencies = [ + "pem", + "ring 0.16.20", + "time", + "yasna", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ "bitflags 1.3.2", ] @@ -6040,6 +6631,15 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_users" version = "0.4.3" @@ -6053,22 +6653,22 @@ dependencies = [ [[package]] name = "ref-cast" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ef7e18e8841942ddb1cf845054f8008410030a3997875d9e49b7a363063df1" +checksum = "acde58d073e9c79da00f2b5b84eed919c8326832648a5b109b3fce1bb1175280" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfaf0c85b766276c797f3791f5bc6d5bd116b41d53049af2789666b0c0bc9fa" +checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -6085,14 +6685,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.3" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.6", - "regex-syntax 0.7.4", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] @@ -6106,13 +6706,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.6" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.4", + "regex-syntax 0.8.2", ] [[package]] @@ -6123,17 +6723,17 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.18" +version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", "bytes", "encoding_rs", "futures-core", @@ -6150,10 +6750,11 @@ dependencies = [ "native-tls", "once_cell", "percent-encoding", - "pin-project-lite 0.2.11", + "pin-project-lite 0.2.13", "serde", "serde_json", "serde_urlencoded", + "system-configuration", "tokio", "tokio-native-tls", "tower-service", @@ -6161,7 +6762,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "winreg 0.10.1", + "winreg", ] [[package]] @@ -6194,12 +6795,26 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", - "untrusted", + "spin 0.5.2", + "untrusted 0.7.1", "web-sys", "winapi", ] +[[package]] +name = "ring" +version = "0.17.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fce3045ffa7c981a6ee93f640b538952e155f1ae3a1a02b84547fc7a56b7059a" +dependencies = [ + "cc", + "getrandom 0.2.10", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.48.0", +] + [[package]] name = "ripemd" version = "0.1.3" @@ -6252,19 +6867,30 @@ dependencies = [ "winapi", ] +[[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" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" dependencies = [ - "async-global-executor", "futures", "log", "netlink-packet-route", "netlink-proto", "nix", "thiserror", + "tokio", ] [[package]] @@ -6277,6 +6903,20 @@ dependencies = [ "winapi", ] +[[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 = "runner" version = "0.1.0" @@ -6330,14 +6970,23 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.18", + "semver 1.0.20", +] + +[[package]] +name = "rusticata-macros" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" +dependencies = [ + "nom", ] [[package]] name = "rustix" -version = "0.35.14" +version = "0.35.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6380889b07a03b5ecf1d44dc9ede6fd2145d84b502a2a9ca0b03c48e0cc3220f" +checksum = "413c4d41e2f1b0814c63567d11618483de0bd64f451b452f2ca43896579486ba" dependencies = [ "bitflags 1.3.2", "errno 0.2.8", @@ -6349,12 +6998,12 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.23" +version = "0.37.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +checksum = "d4eb579851244c2c03e7c24f501c3432bed80b8f720af1d6e5b0e0f01555a035" dependencies = [ "bitflags 1.3.2", - "errno 0.3.2", + "errno 0.3.5", "io-lifetimes 1.0.11", "libc", "linux-raw-sys 0.3.8", @@ -6363,27 +7012,40 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.7" +version = "0.38.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "172891ebdceb05aa0005f533a6cbfca599ddd7d966f6f5d4d9b2e70478e70399" +checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed" dependencies = [ - "bitflags 2.3.3", - "errno 0.3.2", + "bitflags 2.4.1", + "errno 0.3.5", "libc", - "linux-raw-sys 0.4.5", + "linux-raw-sys 0.4.10", "windows-sys 0.48.0", ] [[package]] name = "rustls" -version = "0.20.8" +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.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" dependencies = [ "log", - "ring", - "sct", - "webpki", + "ring 0.16.20", + "sct 0.7.0", + "webpki 0.22.4", ] [[package]] @@ -6404,7 +7066,7 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", ] [[package]] @@ -6442,7 +7104,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "log", "sp-core", @@ -6453,7 +7115,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -6469,11 +7131,9 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ - "impl-trait-for-tuples", "memmap2", - "parity-scale-codec", "sc-chain-spec-derive", "sc-network-common", "sc-telemetry", @@ -6486,7 +7146,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6497,7 +7157,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#f38bd6671d460293c93062cc1e4fe9e9e490cb29" dependencies = [ "array-bytes", "chrono", @@ -6508,7 +7168,7 @@ dependencies = [ "log", "names", "parity-scale-codec", - "rand 0.7.3", + "rand 0.8.5", "regex", "rpassword", "sc-client-api", @@ -6537,11 +7197,10 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "fnv", "futures", - "hash-db", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -6558,14 +7217,13 @@ dependencies = [ "sp-runtime", "sp-state-machine", "sp-storage", - "sp-trie", "substrate-prometheus-endpoint", ] [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "hash-db", "kvdb", @@ -6590,7 +7248,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "async-trait", "futures", @@ -6615,7 +7273,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "async-trait", "futures", @@ -6644,7 +7302,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "async-trait", "fork-tree", @@ -6663,7 +7321,6 @@ dependencies = [ "sc-keystore", "sc-telemetry", "schnorrkel", - "serde", "sp-api", "sp-application-crypto", "sp-block-builder", @@ -6674,10 +7331,8 @@ dependencies = [ "sp-consensus-vrf", "sp-core", "sp-inherents", - "sp-io", "sp-keystore", "sp-runtime", - "sp-version", "substrate-prometheus-endpoint", "thiserror", ] @@ -6685,7 +7340,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "fork-tree", "parity-scale-codec", @@ -6698,7 +7353,7 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "assert_matches", "async-trait", @@ -6732,7 +7387,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "async-trait", "futures", @@ -6750,13 +7405,12 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", - "thiserror", ] [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "lru", "parity-scale-codec", @@ -6780,7 +7434,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -6793,7 +7447,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "log", "sc-allocator", @@ -6806,13 +7460,13 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "cfg-if", "libc", "log", "once_cell", - "rustix 0.35.14", + "rustix 0.35.15", "sc-allocator", "sc-executor-common", "sp-runtime-interface", @@ -6823,7 +7477,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "ahash", "array-bytes", @@ -6841,7 +7495,6 @@ dependencies = [ "sc-chain-spec", "sc-client-api", "sc-consensus", - "sc-keystore", "sc-network", "sc-network-common", "sc-network-gossip", @@ -6864,7 +7517,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "ansi_term", "futures", @@ -6872,7 +7525,6 @@ dependencies = [ "log", "sc-client-api", "sc-network-common", - "sc-transaction-pool-api", "sp-blockchain", "sp-runtime", ] @@ -6880,7 +7532,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "array-bytes", "async-trait", @@ -6895,30 +7547,25 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "array-bytes", "async-trait", "asynchronous-codec", - "bitflags 1.3.2", + "backtrace", "bytes", - "cid", "either", "fnv", - "fork-tree", "futures", "futures-timer", "ip_network", "libp2p", - "linked-hash-map", - "linked_hash_set", "log", "lru", "parity-scale-codec", "parking_lot 0.12.1", "pin-project", - "prost", - "rand 0.7.3", + "rand 0.8.5", "sc-block-builder", "sc-client-api", "sc-consensus", @@ -6942,7 +7589,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "cid", "futures", @@ -6956,13 +7603,12 @@ dependencies = [ "sp-runtime", "thiserror", "unsigned-varint", - "void", ] [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "async-trait", "bitflags 1.3.2", @@ -6988,7 +7634,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "ahash", "futures", @@ -7006,7 +7652,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "array-bytes", "futures", @@ -7027,7 +7673,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "array-bytes", "async-trait", @@ -7059,17 +7705,17 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "array-bytes", "futures", - "hex", "libp2p", "log", "parity-scale-codec", "pin-project", "sc-network-common", "sc-peerset", + "sc-utils", "sp-consensus", "sp-runtime", "substrate-prometheus-endpoint", @@ -7078,7 +7724,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "array-bytes", "bytes", @@ -7092,7 +7738,7 @@ dependencies = [ "once_cell", "parity-scale-codec", "parking_lot 0.12.1", - "rand 0.7.3", + "rand 0.8.5", "sc-client-api", "sc-network-common", "sc-peerset", @@ -7108,7 +7754,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "futures", "libp2p", @@ -7121,7 +7767,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -7130,10 +7776,9 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "futures", - "hash-db", "jsonrpsee", "log", "parity-scale-codec", @@ -7160,13 +7805,10 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ - "futures", "jsonrpsee", - "log", "parity-scale-codec", - "parking_lot 0.12.1", "sc-chain-spec", "sc-transaction-pool-api", "scale-info", @@ -7175,7 +7817,6 @@ dependencies = [ "sp-core", "sp-rpc", "sp-runtime", - "sp-tracing", "sp-version", "thiserror", ] @@ -7183,9 +7824,8 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ - "futures", "http", "jsonrpsee", "log", @@ -7199,39 +7839,45 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ + "array-bytes", "futures", + "futures-util", "hex", "jsonrpsee", + "log", "parity-scale-codec", + "parking_lot 0.12.1", "sc-chain-spec", + "sc-client-api", "sc-transaction-pool-api", "serde", "sp-api", "sp-blockchain", "sp-core", "sp-runtime", + "sp-version", "thiserror", + "tokio-stream", ] [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "async-trait", "directories", "exit-future", "futures", "futures-timer", - "hash-db", "jsonrpsee", "log", "parity-scale-codec", "parking_lot 0.12.1", "pin-project", - "rand 0.7.3", + "rand 0.8.5", "sc-block-builder", "sc-chain-spec", "sc-client-api", @@ -7259,19 +7905,15 @@ dependencies = [ "serde", "serde_json", "sp-api", - "sp-application-crypto", - "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-core", "sp-externalities", - "sp-inherents", "sp-keystore", "sp-runtime", "sp-session", "sp-state-machine", "sp-storage", - "sp-tracing", "sp-transaction-pool", "sp-transaction-storage-proof", "sp-trie", @@ -7288,25 +7930,24 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "log", "parity-scale-codec", "parking_lot 0.12.1", - "sc-client-api", "sp-core", ] [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "futures", "libc", "log", - "rand 0.7.3", - "rand_pcg 0.2.1", + "rand 0.8.5", + "rand_pcg", "regex", "sc-telemetry", "serde", @@ -7319,7 +7960,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "chrono", "futures", @@ -7327,7 +7968,8 @@ dependencies = [ "log", "parking_lot 0.12.1", "pin-project", - "rand 0.7.3", + "rand 0.8.5", + "sc-utils", "serde", "serde_json", "thiserror", @@ -7337,7 +7979,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "ansi_term", "atty", @@ -7368,7 +8010,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -7379,7 +8021,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "async-trait", "futures", @@ -7405,7 +8047,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "async-trait", "futures", @@ -7419,8 +8061,9 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ + "backtrace", "futures", "futures-timer", "lazy_static", @@ -7494,14 +8137,36 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" +[[package]] +name = "sct" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +dependencies = [ + "ring 0.16.20", + "untrusted 0.7.1", +] + [[package]] name = "sct" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", +] + +[[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]] @@ -7511,9 +8176,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" dependencies = [ "base16ct", - "der", + "der 0.6.1", "generic-array 0.14.7", - "pkcs8", + "pkcs8 0.9.0", "subtle", "zeroize", ] @@ -7579,9 +8244,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" dependencies = [ "serde", ] @@ -7594,44 +8259,35 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.183" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.183" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] name = "serde_json" -version = "1.0.104" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", "serde", ] -[[package]] -name = "serde_nanos" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae801b7733ca8d6a2b580debe99f67f36826a0f5b8a36055dc6bc40f8d6bc71" -dependencies = [ - "serde", -] - [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -7657,6 +8313,17 @@ dependencies = [ "opaque-debug 0.3.0", ] +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + [[package]] name = "sha2" version = "0.8.2" @@ -7684,9 +8351,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -7717,18 +8384,18 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] [[package]] name = "shlex" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" +checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" [[package]] name = "signal-hook-registry" @@ -7749,6 +8416,12 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "signature" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" + [[package]] name = "simba" version = "0.5.1" @@ -7763,9 +8436,9 @@ dependencies = [ [[package]] name = "similar" -version = "2.2.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" +checksum = "2aeaf503862c419d66959f5d7ca015337d864e9c49485d771b732e2a20453597" dependencies = [ "bstr 0.2.17", "unicode-segmentation", @@ -7773,9 +8446,9 @@ dependencies = [ [[package]] name = "similar-asserts" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf644ad016b75129f01a34a355dcb8d66a5bc803e417c7a77cc5d5ee9fa0f18" +checksum = "e041bb827d1bfca18f213411d51b665309f1afb37a04a5d1464530e13779fc0f" dependencies = [ "console", "similar", @@ -7783,15 +8456,15 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -7816,9 +8489,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "snap" @@ -7828,18 +8501,18 @@ checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" [[package]] name = "snow" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ccba027ba85743e09d15c03296797cad56395089b832b48b5a5217880f57733" +checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155" dependencies = [ - "aes-gcm", + "aes-gcm 0.9.4", "blake2", "chacha20poly1305", - "curve25519-dalek 4.0.0-rc.1", + "curve25519-dalek 4.1.1", "rand_core 0.6.4", - "ring", + "ring 0.16.20", "rustc_version", - "sha2 0.10.7", + "sha2 0.10.8", "subtle", ] @@ -7855,9 +8528,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" dependencies = [ "libc", "windows-sys 0.48.0", @@ -7883,7 +8556,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "hash-db", "log", @@ -7901,7 +8574,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "blake2", "proc-macro-crate", @@ -7913,7 +8586,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "parity-scale-codec", "scale-info", @@ -7926,14 +8599,13 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "integer-sqrt", "num-traits", "parity-scale-codec", "scale-info", "serde", - "sp-debug-derive", "sp-std", "static_assertions", ] @@ -7941,7 +8613,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "async-trait", "parity-scale-codec", @@ -7953,7 +8625,7 @@ dependencies = [ [[package]] name = "sp-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "parity-scale-codec", "scale-info", @@ -7970,7 +8642,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "parity-scale-codec", "sp-api", @@ -7982,7 +8654,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "futures", "log", @@ -8000,11 +8672,10 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "async-trait", "futures", - "futures-timer", "log", "parity-scale-codec", "sp-core", @@ -8019,7 +8690,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "async-trait", "parity-scale-codec", @@ -8037,7 +8708,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "async-trait", "merlin", @@ -8060,13 +8731,11 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic", - "sp-runtime", "sp-std", "sp-timestamp", ] @@ -8074,7 +8743,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "parity-scale-codec", "scale-info", @@ -8087,13 +8756,12 @@ dependencies = [ [[package]] name = "sp-core" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "array-bytes", "base58", "bitflags 1.3.2", "blake2", - "byteorder", "dyn-clonable", "ed25519-zebra", "futures", @@ -8104,11 +8772,10 @@ dependencies = [ "libsecp256k1", "log", "merlin", - "num-traits", "parity-scale-codec", "parking_lot 0.12.1", "primitive-types", - "rand 0.7.3", + "rand 0.8.5", "regex", "scale-info", "schnorrkel", @@ -8125,19 +8792,18 @@ dependencies = [ "substrate-bip39", "thiserror", "tiny-bip39", - "wasmi", "zeroize", ] [[package]] name = "sp-core-hashing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "blake2", "byteorder", "digest 0.10.7", - "sha2 0.10.7", + "sha2 0.10.8", "sha3 0.10.8", "sp-std", "twox-hash", @@ -8146,7 +8812,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "proc-macro2", "quote", @@ -8157,7 +8823,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -8166,7 +8832,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "proc-macro2", "quote", @@ -8176,7 +8842,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "environmental", "parity-scale-codec", @@ -8187,7 +8853,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "finality-grandpa", "log", @@ -8205,7 +8871,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -8219,16 +8885,15 @@ dependencies = [ [[package]] name = "sp-io" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "bytes", - "ed25519-dalek", + "ed25519 1.5.3", + "ed25519-dalek 1.0.1", "futures", - "hash-db", "libsecp256k1", "log", "parity-scale-codec", - "parking_lot 0.12.1", "secp256k1", "sp-core", "sp-externalities", @@ -8238,7 +8903,6 @@ dependencies = [ "sp-std", "sp-tracing", "sp-trie", - "sp-wasm-interface", "tracing", "tracing-core", ] @@ -8246,7 +8910,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "lazy_static", "sp-core", @@ -8257,7 +8921,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "async-trait", "futures", @@ -8274,7 +8938,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "thiserror", "zstd", @@ -8283,7 +8947,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -8301,7 +8965,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "sp-api", "sp-core", @@ -8311,7 +8975,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "backtrace", "lazy_static", @@ -8321,7 +8985,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "rustc-hash", "serde", @@ -8331,7 +8995,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "either", "hash256-std-hasher", @@ -8339,7 +9003,7 @@ dependencies = [ "log", "parity-scale-codec", "paste", - "rand 0.7.3", + "rand 0.8.5", "scale-info", "serde", "sp-application-crypto", @@ -8353,7 +9017,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -8371,7 +9035,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "Inflector", "proc-macro-crate", @@ -8383,7 +9047,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "parity-scale-codec", "scale-info", @@ -8397,7 +9061,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "parity-scale-codec", "scale-info", @@ -8409,14 +9073,13 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "hash-db", "log", - "num-traits", "parity-scale-codec", "parking_lot 0.12.1", - "rand 0.7.3", + "rand 0.8.5", "smallvec", "sp-core", "sp-externalities", @@ -8425,18 +9088,17 @@ dependencies = [ "sp-trie", "thiserror", "tracing", - "trie-root", ] [[package]] name = "sp-std" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" [[package]] name = "sp-storage" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "impl-serde 0.4.0", "parity-scale-codec", @@ -8449,13 +9111,12 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "async-trait", "futures-timer", "log", "parity-scale-codec", - "sp-api", "sp-inherents", "sp-runtime", "sp-std", @@ -8465,7 +9126,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "parity-scale-codec", "sp-std", @@ -8477,7 +9138,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "sp-api", "sp-runtime", @@ -8486,7 +9147,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "async-trait", "log", @@ -8502,11 +9163,11 @@ dependencies = [ [[package]] name = "sp-trie" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "ahash", "hash-db", - "hashbrown", + "hashbrown 0.12.3", "lazy_static", "lru", "memory-db", @@ -8525,7 +9186,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "impl-serde 0.4.0", "parity-scale-codec", @@ -8542,7 +9203,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -8553,7 +9214,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "impl-trait-for-tuples", "log", @@ -8566,9 +9227,8 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ - "impl-trait-for-tuples", "parity-scale-codec", "scale-info", "serde", @@ -8585,6 +9245,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "spki" version = "0.6.0" @@ -8592,14 +9258,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" dependencies = [ "base64ct", - "der", + "der 0.6.1", +] + +[[package]] +name = "spki" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +dependencies = [ + "base64ct", + "der 0.7.8", ] [[package]] name = "ss58-registry" -version = "1.41.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfc443bad666016e012538782d9e3006213a7db43e9fb1dda91657dc06a6fa08" +checksum = "5e6915280e2d0db8911e5032a5c275571af6bdded2916abd691a659be25d3439" dependencies = [ "Inflector", "num-format", @@ -8729,6 +9405,7 @@ name = "stability-runtime" version = "0.0.0" dependencies = [ "account", + "fp-evm", "fp-rpc", "fp-self-contained", "frame-benchmarking", @@ -9098,6 +9775,25 @@ dependencies = [ "syn 1.0.109", ] +[[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", + "thiserror", + "tokio", + "url", + "webrtc-util", +] + [[package]] name = "substrate-bip39" version = "0.4.4" @@ -9127,7 +9823,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "platforms 2.0.0", ] @@ -9135,17 +9831,15 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "frame-system-rpc-runtime-api", "futures", "jsonrpsee", "log", "parity-scale-codec", - "sc-client-api", "sc-rpc-api", "sc-transaction-pool-api", - "serde_json", "sp-api", "sp-block-builder", "sp-blockchain", @@ -9156,9 +9850,8 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ - "futures-util", "hyper", "log", "prometheus", @@ -9169,7 +9862,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "array-bytes", "async-trait", @@ -9195,7 +9888,7 @@ dependencies = [ [[package]] name = "substrate-test-runtime" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "beefy-merkle-tree", "cfg-if", @@ -9238,7 +9931,7 @@ dependencies = [ [[package]] name = "substrate-test-runtime-client" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "futures", "parity-scale-codec", @@ -9257,7 +9950,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "ansi_term", "build-helper", @@ -9271,6 +9964,15 @@ dependencies = [ "wasm-opt", ] +[[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 = "2.4.1" @@ -9290,9 +9992,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.28" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -9346,22 +10048,22 @@ checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] name = "tempfile" -version = "3.7.1" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if", - "fastrand 2.0.0", + "fastrand 2.0.1", "redox_syscall 0.3.5", - "rustix 0.38.7", + "rustix 0.38.19", "windows-sys 0.48.0", ] [[package]] name = "termcolor" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" dependencies = [ "winapi-util", ] @@ -9374,22 +10076,22 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.44" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.44" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -9429,28 +10131,46 @@ dependencies = [ [[package]] name = "time" -version = "0.1.45" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", + "deranged", + "itoa", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +dependencies = [ + "time-core", ] [[package]] name = "tiny-bip39" -version = "0.8.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" +checksum = "62cc94d358b5a1e84a5cb9109f559aa3c4d634d2b1b4de3d0fa4adc7c78e2861" dependencies = [ "anyhow", - "hmac 0.8.1", + "hmac 0.12.1", "once_cell", - "pbkdf2 0.4.0", - "rand 0.7.3", + "pbkdf2 0.11.0", + "rand 0.8.5", "rustc-hash", - "sha2 0.9.9", + "sha2 0.10.8", "thiserror", "unicode-normalization", "wasm-bindgen", @@ -9467,7 +10187,17 @@ dependencies = [ ] [[package]] -name = "tinyvec" +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" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" @@ -9483,20 +10213,19 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.29.1" +version = "1.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" dependencies = [ - "autocfg", "backtrace", "bytes", "libc", "mio", "num_cpus", "parking_lot 0.12.1", - "pin-project-lite 0.2.11", + "pin-project-lite 0.2.13", "signal-hook-registry", - "socket2 0.4.9", + "socket2 0.5.4", "tokio-macros", "windows-sys 0.48.0", ] @@ -9509,7 +10238,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -9528,9 +10257,9 @@ version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "rustls", + "rustls 0.20.9", "tokio", - "webpki", + "webpki 0.22.4", ] [[package]] @@ -9540,21 +10269,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", - "pin-project-lite 0.2.11", + "pin-project-lite 0.2.13", "tokio", + "tokio-util", ] [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes", "futures-core", "futures-io", "futures-sink", - "pin-project-lite 0.2.11", + "pin-project-lite 0.2.13", "tokio", "tracing", ] @@ -9592,7 +10322,7 @@ dependencies = [ "http", "http-body", "http-range-header", - "pin-project-lite 0.2.11", + "pin-project-lite 0.2.13", "tower-layer", "tower-service", ] @@ -9611,33 +10341,32 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "ee2ef2af84856a50c1d430afce2fdded0a4ec7eda868db86409b4543df0797f9" dependencies = [ - "cfg-if", "log", - "pin-project-lite 0.2.11", + "pin-project-lite 0.2.13", "tracing-attributes", "tracing-core", ] [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -9704,7 +10433,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "004e1e8f92535694b4cb1444dc5a8073ecf0815e3357f729638b9f8fc4062908" dependencies = [ "hash-db", - "hashbrown", + "hashbrown 0.12.3", "log", "rustc-hex", "smallvec", @@ -9747,6 +10476,7 @@ dependencies = [ "lazy_static", "rand 0.8.5", "smallvec", + "socket2 0.4.9", "thiserror", "tinyvec", "tokio", @@ -9782,9 +10512,9 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "trybuild" -version = "1.0.82" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a84e0202ea606ba5ebee8507ab2bfbe89b98551ed9b8f0be198109275cff284b" +checksum = "196a58260a906cedb9bf6d8034b6379d0c11f552416960452f267402ceeddff1" dependencies = [ "basic-toml", "glob", @@ -9801,6 +10531,25 @@ 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" @@ -9815,9 +10564,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" @@ -9845,9 +10594,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -9866,9 +10615,9 @@ checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" @@ -9886,11 +10635,21 @@ dependencies = [ "subtle", ] +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + [[package]] name = "unsigned-varint" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" +checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" dependencies = [ "asynchronous-codec", "bytes", @@ -9904,11 +10663,17 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna 0.4.0", @@ -9916,10 +10681,13 @@ dependencies = [ ] [[package]] -name = "utf8parse" -version = "0.2.1" +name = "uuid" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" +dependencies = [ + "getrandom 0.2.10", +] [[package]] name = "valuable" @@ -9945,17 +10713,26 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +[[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" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" [[package]] name = "walkdir" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", @@ -9976,12 +10753,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" @@ -10009,7 +10780,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", "wasm-bindgen-shared", ] @@ -10043,7 +10814,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -10146,7 +10917,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" dependencies = [ "downcast-rs", - "libm 0.2.7", + "libm", "memory_units", "num-rational", "num-traits", @@ -10158,7 +10929,7 @@ version = "0.89.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5d3e08b13876f96dd55608d03cd4883a0545884932d5adf11925876c96daef" dependencies = [ - "indexmap", + "indexmap 1.9.3", ] [[package]] @@ -10170,7 +10941,7 @@ dependencies = [ "anyhow", "bincode", "cfg-if", - "indexmap", + "indexmap 1.9.3", "libc", "log", "object 0.29.0", @@ -10210,7 +10981,7 @@ dependencies = [ "directories-next", "file-per-thread-logger", "log", - "rustix 0.35.14", + "rustix 0.35.15", "serde", "sha2 0.9.9", "toml", @@ -10248,7 +11019,7 @@ dependencies = [ "anyhow", "cranelift-entity", "gimli 0.26.2", - "indexmap", + "indexmap 1.9.3", "log", "object 0.29.0", "serde", @@ -10273,7 +11044,7 @@ dependencies = [ "log", "object 0.29.0", "rustc-demangle", - "rustix 0.35.14", + "rustix 0.35.15", "serde", "target-lexicon", "thiserror", @@ -10291,7 +11062,7 @@ checksum = "f671b588486f5ccec8c5a3dba6b4c07eac2e66ab8c60e6f4e53717c77f709731" dependencies = [ "object 0.29.0", "once_cell", - "rustix 0.35.14", + "rustix 0.35.15", ] [[package]] @@ -10303,7 +11074,7 @@ dependencies = [ "anyhow", "cc", "cfg-if", - "indexmap", + "indexmap 1.9.3", "libc", "log", "mach", @@ -10311,7 +11082,7 @@ dependencies = [ "memoffset 0.6.5", "paste", "rand 0.8.5", - "rustix 0.35.14", + "rustix 0.35.15", "thiserror", "wasmtime-asm-macros", "wasmtime-environ", @@ -10343,12 +11114,22 @@ dependencies = [ [[package]] name = "webpki" -version = "0.22.0" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +dependencies = [ + "ring 0.16.20", + "untrusted 0.7.1", +] + +[[package]] +name = "webpki" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring", - "untrusted", + "ring 0.17.4", + "untrusted 0.9.0", ] [[package]] @@ -10357,18 +11138,227 @@ version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ - "webpki", + "webpki 0.22.4", +] + +[[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.8", + "stun", + "thiserror", + "time", + "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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a00f4242f2db33307347bd5be53263c52a0331c96c14292118c9a6bb48d267" +dependencies = [ + "aes 0.6.0", + "aes-gcm 0.10.3", + "async-trait", + "bincode", + "block-modes", + "byteorder", + "ccm", + "curve25519-dalek 3.2.0", + "der-parser 8.2.0", + "elliptic-curve", + "hkdf", + "hmac 0.12.1", + "log", + "p256", + "p384", + "rand 0.8.5", + "rand_core 0.6.4", + "rcgen 0.10.0", + "ring 0.16.20", + "rustls 0.19.1", + "sec1", + "serde", + "sha1", + "sha2 0.10.8", + "signature 1.6.4", + "subtle", + "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", + "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", ] [[package]] name = "which" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ "either", - "libc", + "home", "once_cell", + "rustix 0.38.19", ] [[package]] @@ -10395,9 +11385,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -10410,24 +11400,21 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.34.0" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45296b64204227616fdbf2614cefa4c236b98ee64dfaaaa435207ed99fe7829f" +checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" dependencies = [ - "windows_aarch64_msvc 0.34.0", - "windows_i686_gnu 0.34.0", - "windows_i686_msvc 0.34.0", - "windows_x86_64_gnu 0.34.0", - "windows_x86_64_msvc 0.34.0", + "windows-core", + "windows-targets 0.48.5", ] [[package]] -name = "windows" -version = "0.48.0" +name = "windows-core" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -10473,7 +11460,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -10493,17 +11480,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -10514,15 +11501,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.34.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -10538,15 +11519,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" - -[[package]] -name = "windows_i686_gnu" -version = "0.34.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -10562,15 +11537,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" - -[[package]] -name = "windows_i686_msvc" -version = "0.34.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -10586,15 +11555,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -10610,9 +11573,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -10622,15 +11585,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.34.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -10646,18 +11603,9 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" - -[[package]] -name = "winreg" -version = "0.10.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" -dependencies = [ - "winapi", -] +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winreg" @@ -10689,10 +11637,59 @@ dependencies = [ "zeroize", ] +[[package]] +name = "x25519-dalek" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" +dependencies = [ + "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", +] + +[[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", + "base64 0.13.1", + "data-encoding", + "der-parser 8.2.0", + "lazy_static", + "nom", + "oid-registry 0.6.1", + "rusticata-macros", + "thiserror", + "time", +] + [[package]] name = "xcm" -version = "0.9.36" -source = "git+https://github.com/paritytech/polkadot?tag=v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc" +version = "0.9.37" +source = "git+https://github.com/paritytech/polkadot?tag=v0.9.37#645723987cf9662244be8faf4e9b63e8b9a1b3a3" dependencies = [ "derivative", "impl-trait-for-tuples", @@ -10705,8 +11702,8 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "0.9.36" -source = "git+https://github.com/paritytech/polkadot?tag=v0.9.36#dc25abc712e42b9b51d87ad1168e453a42b5f0bc" +version = "0.9.37" +source = "git+https://github.com/paritytech/polkadot?tag=v0.9.37#645723987cf9662244be8faf4e9b63e8b9a1b3a3" dependencies = [ "Inflector", "proc-macro2", @@ -10728,6 +11725,15 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "yasna" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" +dependencies = [ + "time", +] + [[package]] name = "zeroize" version = "1.6.0" @@ -10745,7 +11751,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] @@ -10769,11 +11775,10 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" +version = "2.0.9+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" dependencies = [ "cc", - "libc", "pkg-config", ] diff --git a/Cargo.toml b/Cargo.toml index 178e0fe8..16610f2a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,6 +46,9 @@ authors = ["Stability Solutions"] edition = "2021" repository = "https://github.com/stabilityprotocol/stability/" + + + [workspace.dependencies] bn = { package = "substrate-bn", version = "0.6", default-features = false } environmental = { version = "1.1.3", default-features = false } @@ -77,113 +80,113 @@ once_cell = "1.17.1" hex-literal = "0.3.4" syn = "1.0.98" # Polkadot -xcm = { git = "https://github.com/paritytech/polkadot", tag = "v0.9.36", default-features = false } +xcm = { git = "https://github.com/paritytech/polkadot", tag = "v0.9.37", default-features = false } # Substrate Client -sc-block-builder = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-client-db = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-consensus-manual-seal = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-finality-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-network-common = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-proposer-metrics = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36"} -sc-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sc-block-builder = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sc-client-db = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sc-consensus-manual-seal = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sc-finality-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sc-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sc-network-common = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sc-proposer-metrics = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37"} +sc-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } # Substrate Primitive -sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sp-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -sp-core = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -sp-database = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sp-finality-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -sp-io = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -sp-keyring = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sp-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -sp-runtime = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -sp-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -sp-state-machine = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -sp-std = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -sp-storage = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -sp-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -sp-trie = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -sp-version = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -sp-keystore = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -beefy-primitives = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", package = "sp-beefy", branch = "polkadot-v0.9.36" } -sp-application-crypto = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sp-consensus-babe = { version = "0.10.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sp-externalities = { version = "0.13.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sp-runtime-interface = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } +sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sp-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +sp-core = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +sp-database = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sp-finality-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +sp-io = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +sp-keyring = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sp-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +sp-runtime = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +sp-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +sp-state-machine = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +sp-std = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +sp-storage = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +sp-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +sp-trie = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +sp-version = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +sp-keystore = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +beefy-primitives = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", package = "sp-beefy", branch = "polkadot-v0.9.37" } +sp-application-crypto = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sp-consensus-babe = { version = "0.10.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sp-externalities = { version = "0.13.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sp-runtime-interface = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } # Substrate FRAME -frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -frame-executive = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -frame-system-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -frame-system-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -pallet-aura = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -pallet-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -pallet-sudo = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -pallet-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -pallet-transaction-payment = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -pallet-transaction-payment-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -pallet-utility = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -pallet-collective = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -pallet-babe = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -beefy-merkle-tree = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -pallet-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } +frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +frame-executive = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +frame-system-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +frame-system-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +pallet-aura = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +pallet-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +pallet-sudo = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +pallet-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +pallet-transaction-payment = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +pallet-transaction-payment-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +pallet-utility = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +pallet-collective = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +pallet-babe = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +beefy-merkle-tree = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +pallet-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } # Substrate Utility -frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sp-staking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } +frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sp-staking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } # Frontier Client -fc-cli = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36" } -fc-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36" } -fc-db = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36" } -fc-mapping-sync = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36" } -fc-rpc = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36" } -fc-rpc-core = { version = "1.1.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36" } +fc-cli = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37" } +fc-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37" } +fc-db = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37" } +fc-mapping-sync = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37" } +fc-rpc = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37" } +fc-rpc-core = { version = "1.1.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37" } # Frontier Primitive -fp-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false } -fp-ethereum = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false } -fp-evm = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false } -fp-rpc = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false } -fp-self-contained = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false } -fp-storage = { version = "2.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false } +fp-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } +fp-ethereum = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } +fp-evm = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } +fp-rpc = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } +fp-self-contained = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } +fp-storage = { version = "2.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } # Frontier FRAME -pallet-base-fee = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false } -pallet-ethereum = { version = "4.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false } -pallet-evm = { version = "6.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false } -pallet-evm-chain-id = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false } -pallet-evm-precompile-modexp = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false } -pallet-evm-precompile-sha3fips = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false } -pallet-evm-precompile-simple = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false } -pallet-evm-test-vector-support = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false } -pallet-hotfix-sufficients = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false } +pallet-base-fee = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } +pallet-ethereum = { version = "4.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } +pallet-evm = { version = "6.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } +pallet-evm-chain-id = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } +pallet-evm-precompile-modexp = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } +pallet-evm-precompile-sha3fips = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } +pallet-evm-precompile-simple = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } +pallet-evm-test-vector-support = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } +pallet-hotfix-sufficients = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } # Stability Client stbl-cli-authorship = { version = "1.0.0", path = './client/authorship' } # Stability -pallet-evm-precompile-blake2 = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false } -pallet-evm-precompile-bn128 = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.36", default-features = false } +pallet-evm-precompile-blake2 = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } +pallet-evm-precompile-bn128 = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } precompile-utils = { path = "./precompiles/utils", default-features = false } precompile-fee-token-selector = { path = "./precompiles/token-fee-controller/fee-token-selector", default-features = false } precompile-validator-fee-selector = { path = "./precompiles/token-fee-controller/validator-fee-selector", default-features = false } diff --git a/primitives/runner/src/lib.rs b/primitives/runner/src/lib.rs index 49235755..66fe4e54 100644 --- a/primitives/runner/src/lib.rs +++ b/primitives/runner/src/lib.rs @@ -13,7 +13,7 @@ use frame_support::weights::Weight; use pallet_evm::Pallet; use pallet_evm::{ AccountCodes, AccountStorages, AddressMapping, BalanceOf, BlockHashMapping, Config, Error, - Event, FeeCalculator, PrecompileSet, Runner as RunnerT, RunnerError, + Event, FeeCalculator, PrecompileSet, Runner as RunnerT, RunnerError, OnCreate, }; use pallet_user_fee_selector::UserFeeTokenController; use precompile_utils::prelude::keccak256; @@ -475,6 +475,7 @@ where is_transactional, |executor| { let address = executor.create_address(evm::CreateScheme::Legacy { caller: source }); + T::OnCreate::on_create(source, address); let (reason, _) = executor.transact_create(source, value, init, gas_limit, access_list); (reason, address) @@ -531,6 +532,7 @@ where code_hash, salt, }); + T::OnCreate::on_create(source, address); let (reason, _) = executor.transact_create2(source, value, init, salt, gas_limit, access_list); (reason, address) diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index b7dc5a96..2bed9402 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -38,6 +38,7 @@ std = [ 'pallet-transaction-payment/std', 'frame-system-rpc-runtime-api/std', 'pallet-transaction-payment-rpc-runtime-api/std', + "fp-evm/std", 'fp-rpc/std', 'fp-self-contained/std', 'pallet-base-fee/std', @@ -123,6 +124,7 @@ pallet-session = { workspace = true } sp-application-crypto = { workspace = true } sp-staking = { workspace = true } # Frontier +fp-evm = { workspace = true } fp-rpc = { workspace = true } fp-self-contained = { workspace = true } # Frontier FRAME diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 7aad01b6..84cf9aab 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -72,7 +72,7 @@ pub use frame_support::{ parameter_types, traits::{ConstU32, ConstU8, FindAuthor, KeyOwnerProofSystem, OnTimestampSet, Randomness}, weights::{ - constants::{BlockExecutionWeight, ExtrinsicBaseWeight, WEIGHT_REF_TIME_PER_SECOND}, + constants::{BlockExecutionWeight, ExtrinsicBaseWeight}, ConstantMultiplier, IdentityFee, Weight, }, ConsensusEngineId, StorageValue, @@ -486,6 +486,7 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type Runner = StabilityRunner>; type OnChargeTransaction = (); + type OnCreate = (); type FindAuthor = FindAuthorLinkedOrTruncated; } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 115b61a6..e75c2e20 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] channel = "nightly-2023-01-01" -components = [ "rustfmt", "clippy", "rust-analyzer", "rust-src" ] +components = [ "rustfmt" ] targets = [ "wasm32-unknown-unknown" ] -profile = "minimal" +profile = "minimal" \ No newline at end of file diff --git a/test-utils/stability-client/src/lib.rs b/test-utils/stability-client/src/lib.rs index 8467e9bb..a3d35d9e 100644 --- a/test-utils/stability-client/src/lib.rs +++ b/test-utils/stability-client/src/lib.rs @@ -203,7 +203,7 @@ impl ) where ExecutorDispatch: - sc_client_api::CallExecutor + sc_executor::RuntimeVersionOf + 'static, + sc_client_api::CallExecutor + sc_executor::RuntimeVersionOf + Clone + 'static, Backend: sc_client_api::backend::Backend, >::OffchainStorage: 'static, { @@ -223,19 +223,29 @@ impl storage }; + let client_config = ClientConfig { + offchain_indexing_api: self.enable_offchain_indexing_api, + no_genesis: self.no_genesis, + ..Default::default() + }; + + let genesis_block_builder = sc_service::GenesisBlockBuilder::new( + &storage, + !client_config.no_genesis, + self.backend.clone(), + executor.clone(), + ) + .expect("Creates genesis block builder"); + let client = client::Client::new( self.backend.clone(), executor, - &storage, + genesis_block_builder, self.fork_blocks, self.bad_blocks, None, None, - ClientConfig { - offchain_indexing_api: self.enable_offchain_indexing_api, - no_genesis: self.no_genesis, - ..Default::default() - }, + client_config, ) .expect("Creates new client"); diff --git a/test-utils/stability-runtime-client/src/lib.rs b/test-utils/stability-runtime-client/src/lib.rs index de7b5948..d6a4392c 100644 --- a/test-utils/stability-runtime-client/src/lib.rs +++ b/test-utils/stability-runtime-client/src/lib.rs @@ -19,8 +19,6 @@ #![warn(missing_docs)] -pub mod trait_tests; - mod block_builder_ext; pub use sc_consensus::LongestChain; diff --git a/test-utils/stability-runtime-client/src/trait_tests.rs b/test-utils/stability-runtime-client/src/trait_tests.rs deleted file mode 100644 index 59897c86..00000000 --- a/test-utils/stability-runtime-client/src/trait_tests.rs +++ /dev/null @@ -1,513 +0,0 @@ -// This file is part of Stability. - -// Copyright (C) 2018-2022 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! tests that should hold for all implementations of certain traits. -//! to test implementations without duplication. - -#![allow(missing_docs)] - -use std::sync::Arc; - -use crate::{ - AccountKeyring, BlockBuilderExt, ClientBlockImportExt, TestClientBuilder, TestClientBuilderExt, -}; -use futures::executor::block_on; -use sc_block_builder::BlockBuilderProvider; -use sc_client_api::{ - backend, - blockchain::{Backend as BlockChainBackendT, HeaderBackend}, -}; -use sp_consensus::BlockOrigin; -use sp_runtime::{generic::BlockId, traits::Block as BlockT}; -use stability_test_runtime::{self, Transfer}; - -/// helper to test the `leaves` implementation for various backends -pub fn test_leaves_for_backend(backend: Arc) -where - B: backend::Backend, -{ - // block tree: - // G -> A1 -> A2 -> A3 -> A4 -> A5 - // A1 -> B2 -> B3 -> B4 - // B2 -> C3 - // A1 -> D2 - - let mut client = TestClientBuilder::with_backend(backend.clone()).build(); - let blockchain = backend.blockchain(); - - let genesis_hash = client.chain_info().genesis_hash; - - assert_eq!(blockchain.leaves().unwrap(), vec![genesis_hash]); - - // G -> A1 - let a1 = client - .new_block(Default::default()) - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a1.clone())).unwrap(); - assert_eq!(blockchain.leaves().unwrap(), vec![a1.hash()]); - - // A1 -> A2 - let a2 = client - .new_block_at(&BlockId::Hash(a1.hash()), Default::default(), false) - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a2.clone())).unwrap(); - - assert_eq!(blockchain.leaves().unwrap(), vec![a2.hash()]); - - // A2 -> A3 - let a3 = client - .new_block_at(&BlockId::Hash(a2.hash()), Default::default(), false) - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a3.clone())).unwrap(); - - assert_eq!(blockchain.leaves().unwrap(), vec![a3.hash()]); - - // A3 -> A4 - let a4 = client - .new_block_at(&BlockId::Hash(a3.hash()), Default::default(), false) - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a4.clone())).unwrap(); - assert_eq!(blockchain.leaves().unwrap(), vec![a4.hash()]); - - // A4 -> A5 - let a5 = client - .new_block_at(&BlockId::Hash(a4.hash()), Default::default(), false) - .unwrap() - .build() - .unwrap() - .block; - - block_on(client.import(BlockOrigin::Own, a5.clone())).unwrap(); - assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash()]); - - // A1 -> B2 - let mut builder = client - .new_block_at(&BlockId::Hash(a1.hash()), Default::default(), false) - .unwrap(); - - // this push is required as otherwise B2 has the same hash as A2 and won't get imported - builder - .push_transfer(Transfer { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Ferdie.into(), - amount: 41, - nonce: 0, - }) - .unwrap(); - let b2 = builder.build().unwrap().block; - block_on(client.import(BlockOrigin::Own, b2.clone())).unwrap(); - assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash(), b2.hash()]); - - // B2 -> B3 - let b3 = client - .new_block_at(&BlockId::Hash(b2.hash()), Default::default(), false) - .unwrap() - .build() - .unwrap() - .block; - - block_on(client.import(BlockOrigin::Own, b3.clone())).unwrap(); - assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash(), b3.hash()]); - - // B3 -> B4 - let b4 = client - .new_block_at(&BlockId::Hash(b3.hash()), Default::default(), false) - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, b4.clone())).unwrap(); - assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash(), b4.hash()]); - - // // B2 -> C3 - let mut builder = client - .new_block_at(&BlockId::Hash(b2.hash()), Default::default(), false) - .unwrap(); - // this push is required as otherwise C3 has the same hash as B3 and won't get imported - builder - .push_transfer(Transfer { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Ferdie.into(), - amount: 1, - nonce: 1, - }) - .unwrap(); - let c3 = builder.build().unwrap().block; - block_on(client.import(BlockOrigin::Own, c3.clone())).unwrap(); - assert_eq!( - blockchain.leaves().unwrap(), - vec![a5.hash(), b4.hash(), c3.hash()] - ); - - // A1 -> D2 - let mut builder = client - .new_block_at(&BlockId::Hash(a1.hash()), Default::default(), false) - .unwrap(); - // this push is required as otherwise D2 has the same hash as B2 and won't get imported - builder - .push_transfer(Transfer { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Ferdie.into(), - amount: 1, - nonce: 0, - }) - .unwrap(); - let d2 = builder.build().unwrap().block; - block_on(client.import(BlockOrigin::Own, d2.clone())).unwrap(); - assert_eq!( - blockchain.leaves().unwrap(), - vec![a5.hash(), b4.hash(), c3.hash(), d2.hash()] - ); -} - -/// helper to test the `children` implementation for various backends -pub fn test_children_for_backend(backend: Arc) -where - B: backend::LocalBackend, -{ - // block tree: - // G -> A1 -> A2 -> A3 -> A4 -> A5 - // A1 -> B2 -> B3 -> B4 - // B2 -> C3 - // A1 -> D2 - - let mut client = TestClientBuilder::with_backend(backend.clone()).build(); - let blockchain = backend.blockchain(); - - // G -> A1 - let a1 = client - .new_block(Default::default()) - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a1.clone())).unwrap(); - - // A1 -> A2 - let a2 = client - .new_block_at(&BlockId::Hash(a1.hash()), Default::default(), false) - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a2.clone())).unwrap(); - - // A2 -> A3 - let a3 = client - .new_block_at(&BlockId::Hash(a2.hash()), Default::default(), false) - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a3.clone())).unwrap(); - - // A3 -> A4 - let a4 = client - .new_block_at(&BlockId::Hash(a3.hash()), Default::default(), false) - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a4.clone())).unwrap(); - - // A4 -> A5 - let a5 = client - .new_block_at(&BlockId::Hash(a4.hash()), Default::default(), false) - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a5.clone())).unwrap(); - - // A1 -> B2 - let mut builder = client - .new_block_at(&BlockId::Hash(a1.hash()), Default::default(), false) - .unwrap(); - // this push is required as otherwise B2 has the same hash as A2 and won't get imported - builder - .push_transfer(Transfer { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Ferdie.into(), - amount: 41, - nonce: 0, - }) - .unwrap(); - let b2 = builder.build().unwrap().block; - block_on(client.import(BlockOrigin::Own, b2.clone())).unwrap(); - - // B2 -> B3 - let b3 = client - .new_block_at(&BlockId::Hash(b2.hash()), Default::default(), false) - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, b3.clone())).unwrap(); - - // B3 -> B4 - let b4 = client - .new_block_at(&BlockId::Hash(b3.hash()), Default::default(), false) - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, b4)).unwrap(); - - // // B2 -> C3 - let mut builder = client - .new_block_at(&BlockId::Hash(b2.hash()), Default::default(), false) - .unwrap(); - // this push is required as otherwise C3 has the same hash as B3 and won't get imported - builder - .push_transfer(Transfer { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Ferdie.into(), - amount: 1, - nonce: 1, - }) - .unwrap(); - let c3 = builder.build().unwrap().block; - block_on(client.import(BlockOrigin::Own, c3.clone())).unwrap(); - - // A1 -> D2 - let mut builder = client - .new_block_at(&BlockId::Hash(a1.hash()), Default::default(), false) - .unwrap(); - // this push is required as otherwise D2 has the same hash as B2 and won't get imported - builder - .push_transfer(Transfer { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Ferdie.into(), - amount: 1, - nonce: 0, - }) - .unwrap(); - let d2 = builder.build().unwrap().block; - block_on(client.import(BlockOrigin::Own, d2.clone())).unwrap(); - - let genesis_hash = client.chain_info().genesis_hash; - - let children1 = blockchain.children(a4.hash()).unwrap(); - assert_eq!(vec![a5.hash()], children1); - - let children2 = blockchain.children(a1.hash()).unwrap(); - assert_eq!(vec![a2.hash(), b2.hash(), d2.hash()], children2); - - let children3 = blockchain.children(genesis_hash).unwrap(); - assert_eq!(vec![a1.hash()], children3); - - let children4 = blockchain.children(b2.hash()).unwrap(); - assert_eq!(vec![b3.hash(), c3.hash()], children4); -} - -pub fn test_blockchain_query_by_number_gets_canonical(backend: Arc) -where - B: backend::LocalBackend, -{ - // block tree: - // G -> A1 -> A2 -> A3 -> A4 -> A5 - // A1 -> B2 -> B3 -> B4 - // B2 -> C3 - // A1 -> D2 - let mut client = TestClientBuilder::with_backend(backend.clone()).build(); - let blockchain = backend.blockchain(); - - // G -> A1 - let a1 = client - .new_block(Default::default()) - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a1.clone())).unwrap(); - - // A1 -> A2 - let a2 = client - .new_block_at(&BlockId::Hash(a1.hash()), Default::default(), false) - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a2.clone())).unwrap(); - - // A2 -> A3 - let a3 = client - .new_block_at(&BlockId::Hash(a2.hash()), Default::default(), false) - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a3.clone())).unwrap(); - - // A3 -> A4 - let a4 = client - .new_block_at(&BlockId::Hash(a3.hash()), Default::default(), false) - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a4.clone())).unwrap(); - - // A4 -> A5 - let a5 = client - .new_block_at(&BlockId::Hash(a4.hash()), Default::default(), false) - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a5.clone())).unwrap(); - - // A1 -> B2 - let mut builder = client - .new_block_at(&BlockId::Hash(a1.hash()), Default::default(), false) - .unwrap(); - // this push is required as otherwise B2 has the same hash as A2 and won't get imported - builder - .push_transfer(Transfer { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Ferdie.into(), - amount: 41, - nonce: 0, - }) - .unwrap(); - let b2 = builder.build().unwrap().block; - block_on(client.import(BlockOrigin::Own, b2.clone())).unwrap(); - - // B2 -> B3 - let b3 = client - .new_block_at(&BlockId::Hash(b2.hash()), Default::default(), false) - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, b3.clone())).unwrap(); - - // B3 -> B4 - let b4 = client - .new_block_at(&BlockId::Hash(b3.hash()), Default::default(), false) - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, b4)).unwrap(); - - // // B2 -> C3 - let mut builder = client - .new_block_at(&BlockId::Hash(b2.hash()), Default::default(), false) - .unwrap(); - // this push is required as otherwise C3 has the same hash as B3 and won't get imported - builder - .push_transfer(Transfer { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Ferdie.into(), - amount: 1, - nonce: 1, - }) - .unwrap(); - let c3 = builder.build().unwrap().block; - block_on(client.import(BlockOrigin::Own, c3)).unwrap(); - - // A1 -> D2 - let mut builder = client - .new_block_at(&BlockId::Hash(a1.hash()), Default::default(), false) - .unwrap(); - // this push is required as otherwise D2 has the same hash as B2 and won't get imported - builder - .push_transfer(Transfer { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Ferdie.into(), - amount: 1, - nonce: 0, - }) - .unwrap(); - let d2 = builder.build().unwrap().block; - block_on(client.import(BlockOrigin::Own, d2)).unwrap(); - - let genesis_hash = client.chain_info().genesis_hash; - - assert_eq!( - blockchain - .header(BlockId::Number(0)) - .unwrap() - .unwrap() - .hash(), - genesis_hash - ); - assert_eq!(blockchain.hash(0).unwrap().unwrap(), genesis_hash); - - assert_eq!( - blockchain - .header(BlockId::Number(1)) - .unwrap() - .unwrap() - .hash(), - a1.hash() - ); - assert_eq!(blockchain.hash(1).unwrap().unwrap(), a1.hash()); - - assert_eq!( - blockchain - .header(BlockId::Number(2)) - .unwrap() - .unwrap() - .hash(), - a2.hash() - ); - assert_eq!(blockchain.hash(2).unwrap().unwrap(), a2.hash()); - - assert_eq!( - blockchain - .header(BlockId::Number(3)) - .unwrap() - .unwrap() - .hash(), - a3.hash() - ); - assert_eq!(blockchain.hash(3).unwrap().unwrap(), a3.hash()); - - assert_eq!( - blockchain - .header(BlockId::Number(4)) - .unwrap() - .unwrap() - .hash(), - a4.hash() - ); - assert_eq!(blockchain.hash(4).unwrap().unwrap(), a4.hash()); - - assert_eq!( - blockchain - .header(BlockId::Number(5)) - .unwrap() - .unwrap() - .hash(), - a5.hash() - ); - assert_eq!(blockchain.hash(5).unwrap().unwrap(), a5.hash()); -} diff --git a/test-utils/stability-runtime/Cargo.toml b/test-utils/stability-runtime/Cargo.toml index 613b0730..185ee62a 100644 --- a/test-utils/stability-runtime/Cargo.toml +++ b/test-utils/stability-runtime/Cargo.toml @@ -62,7 +62,7 @@ stability-test-runtime-client = { workspace = true } futures = { workspace = true } [build-dependencies] -substrate-wasm-builder = { workspace = true } +substrate-wasm-builder = { workspace = true, optional = true } [features] default = [ @@ -105,7 +105,7 @@ std = [ "sp-transaction-pool/std", "trie-db/std", "stbl-core-primitives/std", - + "substrate-wasm-builder", ] # Special feature to disable logging disable-logging = [ "sp-api/disable-logging" ] diff --git a/test-utils/stability-runtime/build.rs b/test-utils/stability-runtime/build.rs index e5d2920e..115d6160 100644 --- a/test-utils/stability-runtime/build.rs +++ b/test-utils/stability-runtime/build.rs @@ -15,24 +15,28 @@ // See the License for the specific language governing permissions and // limitations under the License. -use substrate_wasm_builder::WasmBuilder; - fn main() { - WasmBuilder::new() - .with_current_project() - .export_heap_base() - // Note that we set the stack-size to 1MB explicitly even though it is set - // to this value by default. This is because some of our tests (`restoration_of_globals`) - // depend on the stack-size. - .append_to_rust_flags("-Clink-arg=-zstack-size=1048576") - .import_memory() - .build(); + #[cfg(feature = "std")] + { + substrate_wasm_builder::WasmBuilder::new() + .with_current_project() + .export_heap_base() + // Note that we set the stack-size to 1MB explicitly even though it is set + // to this value by default. This is because some of our tests + // (`restoration_of_globals`) depend on the stack-size. + .append_to_rust_flags("-Clink-arg=-zstack-size=1048576") + .import_memory() + .build(); + } - WasmBuilder::new() - .with_current_project() - .export_heap_base() - .import_memory() - .set_file_name("wasm_binary_logging_disabled.rs") - .enable_feature("disable-logging") - .build(); + #[cfg(feature = "std")] + { + substrate_wasm_builder::WasmBuilder::new() + .with_current_project() + .export_heap_base() + .import_memory() + .set_file_name("wasm_binary_logging_disabled.rs") + .enable_feature("disable-logging") + .build(); + } } From d4da6dbaf53a416e0285314906270566e3e93249 Mon Sep 17 00:00:00 2001 From: GabrielMartinezRodriguez Date: Thu, 19 Oct 2023 13:53:17 +0200 Subject: [PATCH 02/37] chore: polkadot v0.9.38 --- Cargo.lock | 441 +++++++++++++++---------- Cargo.toml | 197 +++++------ node/Cargo.toml | 42 +-- node/src/command.rs | 3 +- node/src/eth.rs | 1 + node/src/main.rs | 6 +- node/src/rpc/eth.rs | 64 +--- node/src/rpc/mod.rs | 19 +- node/src/service.rs | 2 +- pallets/custom-balances/Cargo.toml | 1 + precompiles/utils/Cargo.toml | 1 - precompiles/utils/src/data/xcm.rs | 164 +++++++-- precompiles/utils/src/tests.rs | 37 +-- runtime/Cargo.toml | 3 +- runtime/build.rs | 5 +- runtime/src/lib.rs | 17 +- test-utils/stability-client/src/lib.rs | 9 +- 17 files changed, 592 insertions(+), 420 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d9fdcebc..7f9da21f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -187,6 +187,18 @@ dependencies = [ "version_check", ] +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if", + "getrandom 0.2.10", + "once_cell", + "version_check", +] + [[package]] name = "aho-corasick" version = "1.1.2" @@ -513,7 +525,7 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "sp-api", "sp-beefy", @@ -1550,6 +1562,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive-syn-parse" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "derive_builder" version = "0.11.2" @@ -2074,7 +2097,7 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fc-cli" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "clap", "ethereum-types", @@ -2092,13 +2115,12 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "async-trait", "fc-db", "fp-consensus", "fp-rpc", - "sc-client-api", "sc-consensus", "sp-api", "sp-block-builder", @@ -2111,7 +2133,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "fp-storage", "kvdb-rocksdb", @@ -2130,9 +2152,10 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "fc-db", + "fc-storage", "fp-consensus", "fp-rpc", "futures", @@ -2147,13 +2170,14 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "ethereum", "ethereum-types", "evm", "fc-db", "fc-rpc-core", + "fc-storage", "fp-ethereum", "fp-rpc", "fp-storage", @@ -2181,7 +2205,6 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-storage", "substrate-prometheus-endpoint", "tokio", ] @@ -2189,7 +2212,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "ethereum", "ethereum-types", @@ -2199,6 +2222,24 @@ dependencies = [ "serde_json", ] +[[package]] +name = "fc-storage" +version = "1.0.0-dev" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +dependencies = [ + "ethereum", + "ethereum-types", + "fp-rpc", + "fp-storage", + "parity-scale-codec", + "sc-client-api", + "sp-api", + "sp-blockchain", + "sp-io", + "sp-runtime", + "sp-storage", +] + [[package]] name = "fdlimit" version = "0.2.1" @@ -2324,7 +2365,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "parity-scale-codec", ] @@ -2341,7 +2382,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "ethereum", "parity-scale-codec", @@ -2353,7 +2394,7 @@ dependencies = [ [[package]] name = "fp-ethereum" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "ethereum", "ethereum-types", @@ -2367,7 +2408,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "evm", "frame-support", @@ -2381,7 +2422,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "ethereum", "ethereum-types", @@ -2397,7 +2438,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "frame-support", "parity-scale-codec", @@ -2409,7 +2450,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "parity-scale-codec", "serde", @@ -2424,9 +2465,10 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "frame-support", + "frame-support-procedural", "frame-system", "linregress", "log", @@ -2442,12 +2484,13 @@ dependencies = [ "sp-runtime-interface", "sp-std", "sp-storage", + "static_assertions", ] [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#f38bd6671d460293c93062cc1e4fe9e9e490cb29" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "Inflector", "array-bytes", @@ -2494,7 +2537,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "frame-support", "frame-system", @@ -2522,7 +2565,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "bitflags 1.3.2", "frame-metadata", @@ -2554,10 +2597,11 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "Inflector", "cfg-expr", + "derive-syn-parse", "frame-support-procedural-tools", "itertools", "proc-macro2", @@ -2568,7 +2612,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2580,7 +2624,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "proc-macro2", "quote", @@ -2590,7 +2634,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "frame-support", "log", @@ -2608,7 +2652,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "frame-benchmarking", "frame-support", @@ -2623,7 +2667,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "parity-scale-codec", "sp-api", @@ -2948,9 +2992,15 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash", + "ahash 0.7.6", ] +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" + [[package]] name = "hashbrown" version = "0.14.1" @@ -4375,6 +4425,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + [[package]] name = "memoffset" version = "0.9.0" @@ -4715,6 +4774,19 @@ dependencies = [ "memoffset 0.6.5", ] +[[package]] +name = "nix" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset 0.7.1", + "pin-utils", +] + [[package]] name = "nodrop" version = "0.1.14" @@ -4993,7 +5065,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "frame-support", "frame-system", @@ -5009,14 +5081,13 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-authorship", "sp-runtime", "sp-std", ] @@ -5024,7 +5095,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "frame-benchmarking", "frame-support", @@ -5048,7 +5119,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "frame-benchmarking", "frame-support", @@ -5063,7 +5134,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "fp-evm", "frame-support", @@ -5077,7 +5148,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "frame-benchmarking", "frame-support", @@ -5164,7 +5235,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "ethereum", "ethereum-types", @@ -5190,7 +5261,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "environmental", "evm", @@ -5214,7 +5285,7 @@ dependencies = [ [[package]] name = "pallet-evm-chain-id" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "frame-support", "frame-system", @@ -5225,7 +5296,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-blake2" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "fp-evm", ] @@ -5233,7 +5304,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-bn128" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "fp-evm", "sp-core", @@ -5243,7 +5314,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "fp-evm", "num", @@ -5252,7 +5323,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-sha3fips" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "fp-evm", "tiny-keccak", @@ -5261,7 +5332,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "fp-evm", "ripemd", @@ -5287,7 +5358,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "frame-benchmarking", "frame-support", @@ -5310,7 +5381,7 @@ dependencies = [ [[package]] name = "pallet-hotfix-sufficients" version = "1.0.0" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.37#bda55d8f4e5b7384574abb16fdc65095927ce685" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" dependencies = [ "frame-benchmarking", "frame-support", @@ -5340,7 +5411,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "frame-support", "frame-system", @@ -5391,7 +5462,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "frame-support", "frame-system", @@ -5421,7 +5492,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "frame-benchmarking", "frame-support", @@ -5439,7 +5510,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "frame-support", "frame-system", @@ -5455,7 +5526,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5471,7 +5542,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -6888,7 +6959,7 @@ dependencies = [ "log", "netlink-packet-route", "netlink-proto", - "nix", + "nix 0.24.3", "thiserror", "tokio", ] @@ -7104,7 +7175,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "log", "sp-core", @@ -7115,7 +7186,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -7131,7 +7202,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "memmap2", "sc-chain-spec-derive", @@ -7146,7 +7217,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -7157,7 +7228,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#f38bd6671d460293c93062cc1e4fe9e9e490cb29" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "array-bytes", "chrono", @@ -7197,7 +7268,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "fnv", "futures", @@ -7223,7 +7294,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "hash-db", "kvdb", @@ -7236,6 +7307,7 @@ dependencies = [ "parking_lot 0.12.1", "sc-client-api", "sc-state-db", + "schnellru", "sp-arithmetic", "sp-blockchain", "sp-core", @@ -7248,7 +7320,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "async-trait", "futures", @@ -7273,7 +7345,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "async-trait", "futures", @@ -7302,7 +7374,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "async-trait", "fork-tree", @@ -7340,7 +7412,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "fork-tree", "parity-scale-codec", @@ -7353,7 +7425,7 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "assert_matches", "async-trait", @@ -7387,7 +7459,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "async-trait", "futures", @@ -7410,7 +7482,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "lru", "parity-scale-codec", @@ -7434,7 +7506,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -7447,7 +7519,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "log", "sc-allocator", @@ -7460,7 +7532,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "cfg-if", "libc", @@ -7477,9 +7549,9 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ - "ahash", + "ahash 0.8.3", "array-bytes", "async-trait", "dyn-clone", @@ -7517,7 +7589,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "ansi_term", "futures", @@ -7532,7 +7604,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "array-bytes", "async-trait", @@ -7547,7 +7619,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "array-bytes", "async-trait", @@ -7589,7 +7661,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "cid", "futures", @@ -7608,7 +7680,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "async-trait", "bitflags 1.3.2", @@ -7634,9 +7706,9 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ - "ahash", + "ahash 0.8.3", "futures", "futures-timer", "libp2p", @@ -7652,7 +7724,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "array-bytes", "futures", @@ -7673,7 +7745,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "array-bytes", "async-trait", @@ -7705,7 +7777,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "array-bytes", "futures", @@ -7724,7 +7796,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "array-bytes", "bytes", @@ -7754,7 +7826,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "futures", "libp2p", @@ -7767,7 +7839,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -7776,7 +7848,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "futures", "jsonrpsee", @@ -7800,12 +7872,13 @@ dependencies = [ "sp-runtime", "sp-session", "sp-version", + "tokio", ] [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -7824,7 +7897,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "http", "jsonrpsee", @@ -7839,7 +7912,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "array-bytes", "futures", @@ -7865,7 +7938,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "async-trait", "directories", @@ -7896,6 +7969,7 @@ dependencies = [ "sc-rpc", "sc-rpc-server", "sc-rpc-spec-v2", + "sc-storage-monitor", "sc-sysinfo", "sc-telemetry", "sc-tracing", @@ -7930,7 +8004,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "log", "parity-scale-codec", @@ -7938,10 +8012,26 @@ dependencies = [ "sp-core", ] +[[package]] +name = "sc-storage-monitor" +version = "0.1.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +dependencies = [ + "clap", + "futures", + "log", + "nix 0.26.4", + "sc-client-db", + "sc-utils", + "sp-core", + "thiserror", + "tokio", +] + [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "futures", "libc", @@ -7960,7 +8050,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "chrono", "futures", @@ -7979,7 +8069,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "ansi_term", "atty", @@ -8010,7 +8100,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8021,13 +8111,14 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "async-trait", "futures", "futures-timer", "linked-hash-map", "log", + "num-traits", "parity-scale-codec", "parking_lot 0.12.1", "sc-client-api", @@ -8047,7 +8138,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "async-trait", "futures", @@ -8061,7 +8152,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "backtrace", "futures", @@ -8107,6 +8198,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "schnellru" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" +dependencies = [ + "ahash 0.8.3", + "cfg-if", + "hashbrown 0.13.2", +] + [[package]] name = "schnorrkel" version = "0.9.1" @@ -8556,7 +8658,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "hash-db", "log", @@ -8574,7 +8676,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "blake2", "proc-macro-crate", @@ -8586,7 +8688,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "parity-scale-codec", "scale-info", @@ -8599,7 +8701,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "integer-sqrt", "num-traits", @@ -8610,22 +8712,10 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "sp-authorship" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" -dependencies = [ - "async-trait", - "parity-scale-codec", - "sp-inherents", - "sp-runtime", - "sp-std", -] - [[package]] name = "sp-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "parity-scale-codec", "scale-info", @@ -8642,7 +8732,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "parity-scale-codec", "sp-api", @@ -8654,7 +8744,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "futures", "log", @@ -8672,7 +8762,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "async-trait", "futures", @@ -8690,7 +8780,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "async-trait", "parity-scale-codec", @@ -8708,7 +8798,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "async-trait", "merlin", @@ -8731,7 +8821,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "parity-scale-codec", "scale-info", @@ -8743,7 +8833,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "parity-scale-codec", "scale-info", @@ -8756,7 +8846,7 @@ dependencies = [ [[package]] name = "sp-core" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "array-bytes", "base58", @@ -8798,7 +8888,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "blake2", "byteorder", @@ -8812,7 +8902,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "proc-macro2", "quote", @@ -8823,7 +8913,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -8832,7 +8922,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "proc-macro2", "quote", @@ -8842,7 +8932,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "environmental", "parity-scale-codec", @@ -8853,7 +8943,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "finality-grandpa", "log", @@ -8871,7 +8961,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -8885,7 +8975,7 @@ dependencies = [ [[package]] name = "sp-io" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "bytes", "ed25519 1.5.3", @@ -8910,7 +9000,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "lazy_static", "sp-core", @@ -8921,7 +9011,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "async-trait", "futures", @@ -8938,7 +9028,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "thiserror", "zstd", @@ -8947,7 +9037,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -8965,7 +9055,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "sp-api", "sp-core", @@ -8975,7 +9065,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "backtrace", "lazy_static", @@ -8985,7 +9075,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "rustc-hash", "serde", @@ -8995,7 +9085,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "either", "hash256-std-hasher", @@ -9017,7 +9107,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -9035,7 +9125,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "Inflector", "proc-macro-crate", @@ -9047,7 +9137,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "parity-scale-codec", "scale-info", @@ -9061,7 +9151,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "parity-scale-codec", "scale-info", @@ -9073,7 +9163,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "hash-db", "log", @@ -9093,12 +9183,12 @@ dependencies = [ [[package]] name = "sp-std" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" [[package]] name = "sp-storage" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "impl-serde 0.4.0", "parity-scale-codec", @@ -9111,7 +9201,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "async-trait", "futures-timer", @@ -9126,7 +9216,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "parity-scale-codec", "sp-std", @@ -9138,7 +9228,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "sp-api", "sp-runtime", @@ -9147,7 +9237,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "async-trait", "log", @@ -9163,18 +9253,18 @@ dependencies = [ [[package]] name = "sp-trie" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ - "ahash", + "ahash 0.8.3", "hash-db", "hashbrown 0.12.3", "lazy_static", - "lru", "memory-db", "nohash-hasher", "parity-scale-codec", "parking_lot 0.12.1", "scale-info", + "schnellru", "sp-core", "sp-std", "thiserror", @@ -9186,7 +9276,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "impl-serde 0.4.0", "parity-scale-codec", @@ -9203,7 +9293,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -9214,7 +9304,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "impl-trait-for-tuples", "log", @@ -9227,7 +9317,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "parity-scale-codec", "scale-info", @@ -9299,9 +9389,9 @@ dependencies = [ "fc-mapping-sync", "fc-rpc", "fc-rpc-core", + "fc-storage", "fp-evm", "fp-rpc", - "fp-storage", "frame-benchmarking", "frame-benchmarking-cli", "frame-system", @@ -9823,7 +9913,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "platforms 2.0.0", ] @@ -9831,7 +9921,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -9850,7 +9940,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "hyper", "log", @@ -9862,7 +9952,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "array-bytes", "async-trait", @@ -9888,7 +9978,7 @@ dependencies = [ [[package]] name = "substrate-test-runtime" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "beefy-merkle-tree", "cfg-if", @@ -9931,7 +10021,7 @@ dependencies = [ [[package]] name = "substrate-test-runtime-client" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "futures", "parity-scale-codec", @@ -9950,7 +10040,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" dependencies = [ "ansi_term", "build-helper", @@ -10836,9 +10926,9 @@ dependencies = [ [[package]] name = "wasm-opt" -version = "0.110.2" +version = "0.111.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b68e8037b4daf711393f4be2056246d12d975651b14d581520ad5d1f19219cec" +checksum = "84a303793cbc01fb96551badfc7367db6007396bba6bac97936b3c8b6f7fdb41" dependencies = [ "anyhow", "libc", @@ -10852,9 +10942,9 @@ dependencies = [ [[package]] name = "wasm-opt-cxx-sys" -version = "0.110.2" +version = "0.111.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91adbad477e97bba3fbd21dd7bfb594e7ad5ceb9169ab1c93ab9cb0ada636b6f" +checksum = "d9c9deb56f8a9f2ec177b3bd642a8205621835944ed5da55f2388ef216aca5a4" dependencies = [ "anyhow", "cxx", @@ -10864,9 +10954,9 @@ dependencies = [ [[package]] name = "wasm-opt-sys" -version = "0.110.2" +version = "0.111.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec4fa5a322a4e6ac22fd141f498d56afbdbf9df5debeac32380d2dcaa3e06941" +checksum = "4432e28b542738a9776cedf92e8a99d8991c7b4667ee2c7ccddfb479dd2856a7" dependencies = [ "anyhow", "cc", @@ -11342,7 +11432,7 @@ dependencies = [ "lazy_static", "libc", "log", - "nix", + "nix 0.24.3", "rand 0.8.5", "thiserror", "tokio", @@ -11688,22 +11778,23 @@ dependencies = [ [[package]] name = "xcm" -version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?tag=v0.9.37#645723987cf9662244be8faf4e9b63e8b9a1b3a3" +version = "0.9.38" +source = "git+https://github.com/paritytech/polkadot?tag=v0.9.38#72309a2b2e68413305a56dce1097041309bd29c6" dependencies = [ "derivative", "impl-trait-for-tuples", "log", "parity-scale-codec", "scale-info", - "sp-runtime", + "sp-core", + "sp-weights", "xcm-procedural", ] [[package]] name = "xcm-procedural" -version = "0.9.37" -source = "git+https://github.com/paritytech/polkadot?tag=v0.9.37#645723987cf9662244be8faf4e9b63e8b9a1b3a3" +version = "0.9.38" +source = "git+https://github.com/paritytech/polkadot?tag=v0.9.38#72309a2b2e68413305a56dce1097041309bd29c6" dependencies = [ "Inflector", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index 16610f2a..b2229444 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,7 +62,7 @@ hex = { version = "0.4.3", default-features = false } parity-db = "0.4.2" rlp = { version = "0.5", default-features = false } scale-codec = { package = "parity-scale-codec", version = "3.2.1", default-features = false, features = ["derive"] } -codec = { package = "parity-scale-codec", version = "3.2.1", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } serde = { version = "1.0.101", default-features = false } serde_json = "1.0" @@ -80,113 +80,114 @@ once_cell = "1.17.1" hex-literal = "0.3.4" syn = "1.0.98" # Polkadot -xcm = { git = "https://github.com/paritytech/polkadot", tag = "v0.9.37", default-features = false } +xcm = { git = "https://github.com/paritytech/polkadot", tag = "v0.9.38", default-features = false } # Substrate Client -sc-block-builder = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sc-client-db = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sc-consensus-manual-seal = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sc-finality-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sc-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sc-network-common = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sc-proposer-metrics = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37"} -sc-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } +sc-block-builder = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sc-client-db = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sc-consensus-manual-seal = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sc-finality-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sc-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sc-network-common = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sc-proposer-metrics = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38"} +sc-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } # Substrate Primitive -sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sp-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -sp-core = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -sp-database = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sp-finality-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -sp-io = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -sp-keyring = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sp-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -sp-runtime = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -sp-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -sp-state-machine = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -sp-std = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -sp-storage = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -sp-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -sp-trie = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -sp-version = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -sp-keystore = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -beefy-primitives = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", package = "sp-beefy", branch = "polkadot-v0.9.37" } -sp-application-crypto = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sp-consensus-babe = { version = "0.10.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sp-externalities = { version = "0.13.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sp-runtime-interface = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sp-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +sp-core = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +sp-database = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sp-finality-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +sp-io = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +sp-keyring = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sp-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +sp-runtime = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +sp-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +sp-state-machine = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +sp-std = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +sp-storage = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +sp-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +sp-trie = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +sp-version = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +sp-keystore = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +beefy-primitives = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", package = "sp-beefy", branch = "polkadot-v0.9.38" } +sp-application-crypto = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sp-consensus-babe = { version = "0.10.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sp-externalities = { version = "0.13.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sp-runtime-interface = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } # Substrate FRAME -frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -frame-executive = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -frame-system-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -frame-system-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -pallet-aura = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -pallet-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -pallet-sudo = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -pallet-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -pallet-transaction-payment = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -pallet-transaction-payment-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -pallet-utility = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -pallet-collective = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -pallet-babe = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -beefy-merkle-tree = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } -pallet-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +frame-executive = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +frame-system-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +frame-system-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +pallet-aura = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +pallet-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +pallet-sudo = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +pallet-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +pallet-transaction-payment = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +pallet-transaction-payment-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +pallet-utility = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +pallet-collective = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +pallet-babe = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +beefy-merkle-tree = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +pallet-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } # Substrate Utility -frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" } -sp-staking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false } +frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sp-staking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } # Frontier Client -fc-cli = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37" } -fc-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37" } -fc-db = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37" } -fc-mapping-sync = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37" } -fc-rpc = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37" } -fc-rpc-core = { version = "1.1.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37" } +fc-cli = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38" } +fc-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38" } +fc-db = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38" } +fc-mapping-sync = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38" } +fc-rpc = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38" } +fc-rpc-core = { version = "1.1.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38" } +fc-storage = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38" } # Frontier Primitive -fp-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } -fp-ethereum = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } -fp-evm = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } -fp-rpc = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } -fp-self-contained = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } -fp-storage = { version = "2.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } +fp-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } +fp-ethereum = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } +fp-evm = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } +fp-rpc = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } +fp-self-contained = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } +fp-storage = { version = "2.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } # Frontier FRAME -pallet-base-fee = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } -pallet-ethereum = { version = "4.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } -pallet-evm = { version = "6.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } -pallet-evm-chain-id = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } -pallet-evm-precompile-modexp = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } -pallet-evm-precompile-sha3fips = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } -pallet-evm-precompile-simple = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } -pallet-evm-test-vector-support = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } -pallet-hotfix-sufficients = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } +pallet-base-fee = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } +pallet-ethereum = { version = "4.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } +pallet-evm = { version = "6.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } +pallet-evm-chain-id = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } +pallet-evm-precompile-modexp = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } +pallet-evm-precompile-sha3fips = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } +pallet-evm-precompile-simple = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } +pallet-evm-test-vector-support = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } +pallet-hotfix-sufficients = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } # Stability Client stbl-cli-authorship = { version = "1.0.0", path = './client/authorship' } # Stability -pallet-evm-precompile-blake2 = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } -pallet-evm-precompile-bn128 = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.37", default-features = false } +pallet-evm-precompile-blake2 = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } +pallet-evm-precompile-bn128 = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } precompile-utils = { path = "./precompiles/utils", default-features = false } precompile-fee-token-selector = { path = "./precompiles/token-fee-controller/fee-token-selector", default-features = false } precompile-validator-fee-selector = { path = "./precompiles/token-fee-controller/validator-fee-selector", default-features = false } diff --git a/node/Cargo.toml b/node/Cargo.toml index c26317cd..88bb5a01 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -37,22 +37,22 @@ sc-service = { workspace = true } sc-telemetry = { workspace = true } sc-transaction-pool = { workspace = true } sc-transaction-pool-api = { workspace = true } -sp-api = { workspace = true, features = ["std"] } +sp-api = { workspace = true, features = ["default"] } sp-block-builder = { workspace = true } sp-blockchain = { workspace = true } -sp-consensus-aura = { workspace = true, features = ["std"] } -sp-core = { workspace = true, features = ["std"] } -sp-finality-grandpa = { workspace = true, features = ["std"] } -sp-inherents = { workspace = true, features = ["std"] } +sp-consensus-aura = { workspace = true, features = ["default"] } +sp-core = { workspace = true, features = ["default"] } +sp-finality-grandpa = { workspace = true, features = ["default"] } +sp-inherents = { workspace = true, features = ["default"] } sp-keyring = { workspace = true } -sp-offchain = { workspace = true, features = ["std"] } -sp-runtime = { workspace = true, features = ["std"] } -sp-session = { workspace = true, features = ["std"] } -sp-state-machine = { workspace = true, features = ["std"] } -sp-timestamp = { workspace = true, features = ["std"] } -sp-transaction-pool = { workspace = true, features = ["std"] } -sp-trie = { workspace = true, features = ["std"] } -sp-keystore = { workspace = true, features = ["std"] } +sp-offchain = { workspace = true, features = ["default"] } +sp-runtime = { workspace = true, features = ["default"] } +sp-session = { workspace = true, features = ["default"] } +sp-state-machine = { workspace = true, features = ["default"] } +sp-timestamp = { workspace = true, features = ["default"] } +sp-transaction-pool = { workspace = true, features = ["default"] } +sp-trie = { workspace = true, features = ["default"] } +sp-keystore = { workspace = true, features = ["default"] } # These dependencies are used for RPC frame-system-rpc-runtime-api = { workspace = true } pallet-transaction-payment-rpc = { workspace = true } @@ -71,18 +71,18 @@ fc-db = { workspace = true } fc-mapping-sync = { workspace = true } fc-rpc = { workspace = true } fc-rpc-core = { workspace = true } -fp-evm = { workspace = true, features = ["std"] } -fp-rpc = { workspace = true, features = ["std"] } -fp-storage = { workspace = true, features = ["std"] } -stability-runtime = { path = "./../runtime", features = ["std"] } +fp-evm = { workspace = true, features = ["default"] } +fp-rpc = { workspace = true, features = ["default"] } +fc-storage = { workspace = true } +stability-runtime = { path = "./../runtime", features = ["default"] } # Stability stbl-cli-authorship = { workspace = true } -stbl-primitives-fee-compatible-api = { workspace = true, features = ["std"] } -stbl-primitives-zero-gas-transactions-api = { workspace = true, features = ["std"] } +stbl-primitives-fee-compatible-api = { workspace = true, features = ["default"] } +stbl-primitives-zero-gas-transactions-api = { workspace = true, features = ["default"] } sp-application-crypto = { workspace = true } -account = { workspace = true, features = ["std"] } -stbl-core-primitives = { workspace = true, features = ["std"] } +account = { workspace = true, features = ["default"] } +stbl-core-primitives = { workspace = true, features = ["default"] } stability-rpc = { workspace = true } stbl-tools = { workspace = true } diff --git a/node/src/command.rs b/node/src/command.rs index e48bf3f5..d419a86e 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -15,7 +15,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use clap::Parser; // Substrate use sc_cli::{ChainSpec, RuntimeVersion, SubstrateCli}; use sc_service::DatabaseSource; @@ -74,7 +73,7 @@ impl SubstrateCli for Cli { /// Parse and run command line arguments pub fn run() -> sc_cli::Result<()> { - let cli = Cli::parse(); + let cli = Cli::from_args(); match &cli.subcommand { Some(Subcommand::Key(cmd)) => cmd.run(&cli), diff --git a/node/src/eth.rs b/node/src/eth.rs index a24c223f..30a366a1 100644 --- a/node/src/eth.rs +++ b/node/src/eth.rs @@ -125,6 +125,7 @@ pub fn spawn_frontier_tasks( Duration::new(6, 0), client.clone(), backend, + overrides.clone(), frontier_backend, 3, 0, diff --git a/node/src/main.rs b/node/src/main.rs index db614a14..c0405299 100644 --- a/node/src/main.rs +++ b/node/src/main.rs @@ -1,7 +1,11 @@ //! Substrate Node Template CLI library. #![warn(missing_docs)] -#![allow(clippy::type_complexity, clippy::too_many_arguments)] +#![allow( + clippy::type_complexity, + clippy::too_many_arguments, + clippy::large_enum_variant +)] #[cfg(feature = "runtime-benchmarks")] mod benchmarking; diff --git a/node/src/rpc/eth.rs b/node/src/rpc/eth.rs index b71431c4..5e615855 100644 --- a/node/src/rpc/eth.rs +++ b/node/src/rpc/eth.rs @@ -1,9 +1,9 @@ -use std::{collections::BTreeMap, sync::Arc}; +use std::sync::Arc; use jsonrpsee::RpcModule; // Substrate use sc_client_api::{ - backend::{AuxStore, Backend, StateBackend, StorageProvider}, + backend::{Backend, StorageProvider}, client::BlockchainEvents, }; use sc_network::NetworkService; @@ -11,17 +11,15 @@ use sc_rpc::SubscriptionTaskExecutor; use sc_transaction_pool::{ChainApi, Pool}; use sc_transaction_pool_api::TransactionPool; use sp_api::ProvideRuntimeApi; +use sp_block_builder::BlockBuilder as BlockBuilderApi; use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; -use sp_core::H256; -use sp_runtime::traits::{BlakeTwo256, Block as BlockT, Header as HeaderT}; +use sp_runtime::traits::Block as BlockT; // Frontier use fc_db::Backend as FrontierBackend; -pub use fc_rpc::{ - EthBlockDataCacheTask, OverrideHandle, RuntimeApiStorageOverride, SchemaV1Override, - SchemaV2Override, SchemaV3Override, StorageOverride, -}; +pub use fc_rpc::{EthBlockDataCacheTask, OverrideHandle, StorageOverride}; pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool}; -use fp_storage::EthereumStorageSchema; +pub use fc_storage::overrides_handle; +use fp_rpc::{ConvertTransaction, ConvertTransactionRuntimeApi, EthereumRuntimeRPCApi}; /// Extra dependencies for Ethereum compatibility. pub struct EthDeps { @@ -80,38 +78,6 @@ impl Clone for EthDeps } } -pub fn overrides_handle(client: Arc) -> Arc> -where - C: ProvideRuntimeApi + StorageProvider + AuxStore, - C: HeaderBackend + HeaderMetadata + 'static, - C::Api: fp_rpc::EthereumRuntimeRPCApi, - BE: Backend + 'static, - BE::State: StateBackend, - B: BlockT, -{ - let mut overrides_map = BTreeMap::new(); - overrides_map.insert( - EthereumStorageSchema::V1, - Box::new(SchemaV1Override::new(client.clone())) - as Box + Send + Sync>, - ); - overrides_map.insert( - EthereumStorageSchema::V2, - Box::new(SchemaV2Override::new(client.clone())) - as Box + Send + Sync>, - ); - overrides_map.insert( - EthereumStorageSchema::V3, - Box::new(SchemaV3Override::new(client.clone())) - as Box + Send + Sync>, - ); - - Arc::new(OverrideHandle { - schemas: overrides_map, - fallback: Box::new(RuntimeApiStorageOverride::::new(client)), - }) -} - /// Instantiate Ethereum-compatible RPC extensions. pub fn create_eth( mut io: RpcModule<()>, @@ -119,19 +85,15 @@ pub fn create_eth( subscription_task_executor: SubscriptionTaskExecutor, ) -> Result, Box> where - C: ProvideRuntimeApi + StorageProvider + AuxStore, - C: BlockchainEvents, - C: HeaderBackend + HeaderMetadata + 'static, - C::Api: sp_block_builder::BlockBuilder, - C::Api: fp_rpc::EthereumRuntimeRPCApi, - C::Api: fp_rpc::ConvertTransactionRuntimeApi, + B: BlockT, + C: ProvideRuntimeApi, + C::Api: BlockBuilderApi + EthereumRuntimeRPCApi + ConvertTransactionRuntimeApi, + C: BlockchainEvents + 'static, + C: HeaderBackend + HeaderMetadata + StorageProvider, BE: Backend + 'static, - BE::State: StateBackend, P: TransactionPool + 'static, A: ChainApi + 'static, - CT: fp_rpc::ConvertTransaction<::Extrinsic> + Send + Sync + 'static, - B: BlockT, - B::Header: HeaderT, + CT: ConvertTransaction<::Extrinsic> + Send + Sync + 'static, { use fc_rpc::{ Eth, EthApiServer, EthDevSigner, EthFilter, EthFilterApiServer, EthPubSub, diff --git a/node/src/rpc/mod.rs b/node/src/rpc/mod.rs index dc7e7c9f..d270792f 100644 --- a/node/src/rpc/mod.rs +++ b/node/src/rpc/mod.rs @@ -6,7 +6,7 @@ use futures::channel::mpsc; use jsonrpsee::RpcModule; // Substrate use sc_client_api::{ - backend::{AuxStore, Backend, StateBackend, StorageProvider}, + backend::{Backend, StorageProvider}, client::BlockchainEvents, }; use sc_consensus_manual_seal::rpc::EngineCommand; @@ -15,9 +15,8 @@ use sc_rpc_api::DenyUnsafe; use sc_service::TransactionPool; use sc_transaction_pool::ChainApi; use sp_api::ProvideRuntimeApi; -use sp_block_builder::BlockBuilder; use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; -use sp_runtime::traits::{BlakeTwo256, Block as BlockT}; +use sp_runtime::traits::Block as BlockT; use stbl_primitives_zero_gas_transactions_api::ZeroGasTransactionApi; // Runtime use stability_runtime::{opaque::Block, AccountId, Balance, Hash, Index}; @@ -45,19 +44,19 @@ pub fn create_full( subscription_task_executor: SubscriptionTaskExecutor, ) -> Result, Box> where - BE: Backend + 'static, - BE::State: StateBackend, - C: ProvideRuntimeApi + StorageProvider + AuxStore, - C: BlockchainEvents, - C: HeaderBackend + HeaderMetadata, - C: Send + Sync + 'static, + C: ProvideRuntimeApi, C::Api: substrate_frame_rpc_system::AccountNonceApi, - C::Api: BlockBuilder, + C::Api: sp_block_builder::BlockBuilder, C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, C::Api: fp_rpc::ConvertTransactionRuntimeApi, C::Api: fp_rpc::EthereumRuntimeRPCApi, C::Api: stability_rpc::StabilityRpcRuntimeApi, C::Api: ZeroGasTransactionApi, + C: BlockchainEvents + 'static, + C: HeaderBackend + + HeaderMetadata + + StorageProvider, + BE: Backend + 'static, P: TransactionPool + 'static, A: ChainApi + 'static, CT: fp_rpc::ConvertTransaction<::Extrinsic> + Send + Sync + 'static, diff --git a/node/src/service.rs b/node/src/service.rs index e6719d5b..c78298d9 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -120,7 +120,7 @@ where let select_chain = sc_consensus::LongestChain::new(backend.clone()); let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import( client.clone(), - &(client.clone() as Arc<_>), + &client, select_chain.clone(), telemetry.as_ref().map(|x| x.handle()), )?; diff --git a/pallets/custom-balances/Cargo.toml b/pallets/custom-balances/Cargo.toml index bc905ead..0141dfab 100644 --- a/pallets/custom-balances/Cargo.toml +++ b/pallets/custom-balances/Cargo.toml @@ -35,5 +35,6 @@ std = [ "frame-system/std", "sp-runtime/std", "sp-std/std", + "sp-io/std", "pallet-evm/std", ] \ No newline at end of file diff --git a/precompiles/utils/Cargo.toml b/precompiles/utils/Cargo.toml index 129a6c55..7972e0c5 100644 --- a/precompiles/utils/Cargo.toml +++ b/precompiles/utils/Cargo.toml @@ -50,7 +50,6 @@ std = [ "frame-system/std", "pallet-evm/std", "sp-core/std", - "sp-io/std", "sp-std/std", ] testing = [ "derive_more", "hex-literal", "scale-info", "serde", "similar-asserts", "std" ] diff --git a/precompiles/utils/src/data/xcm.rs b/precompiles/utils/src/data/xcm.rs index 206c7440..1edc04a5 100644 --- a/precompiles/utils/src/data/xcm.rs +++ b/precompiles/utils/src/data/xcm.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + //! Encoding of XCM types for solidity use { @@ -32,36 +33,82 @@ pub const JUNCTION_SIZE_LIMIT: u32 = 2u32.pow(16); // We don't implement EVMData here as these bytes will be appended only // to certain Junction variants // Each NetworkId variant is represented as bytes -// The first byte represents the enum variant to be used +// The first byte represents the enum variant to be used. +// - Indexes 0,2,3 represent XCM V2 variants +// - Index 1 changes name in V3 (`ByGenesis`), but is compatible with V2 `Named` +// - Indexes 4~10 represent new XCM V3 variants // The rest of the bytes (if any), represent the additional data that such enum variant requires -// In this case, only Named requires additional non-bounded data. // In such a case, since NetworkIds will be appended at the end, we will read the buffer until the // end to recover the name -pub(crate) fn network_id_to_bytes(network_id: NetworkId) -> Vec { + +pub(crate) fn network_id_to_bytes(network_id: Option) -> Vec { let mut encoded: Vec = Vec::new(); match network_id.clone() { - NetworkId::Any => { + None => { encoded.push(0u8); encoded } - NetworkId::Named(name) => { + Some(NetworkId::ByGenesis(id)) => { encoded.push(1u8); - encoded.append(&mut name.into_inner()); + encoded.append(&mut id.into()); encoded } - NetworkId::Polkadot => { + Some(NetworkId::Polkadot) => { + encoded.push(2u8); encoded.push(2u8); encoded } - NetworkId::Kusama => { + Some(NetworkId::Kusama) => { + encoded.push(3u8); encoded.push(3u8); encoded } + Some(NetworkId::ByFork { + block_number, + block_hash, + }) => { + encoded.push(4u8); + encoded.push(1u8); + encoded.append(&mut block_number.to_be_bytes().into()); + encoded.append(&mut block_hash.into()); + encoded + } + Some(NetworkId::Westend) => { + encoded.push(5u8); + encoded.push(4u8); + encoded + } + Some(NetworkId::Rococo) => { + encoded.push(6u8); + encoded.push(5u8); + encoded + } + Some(NetworkId::Wococo) => { + encoded.push(7u8); + encoded.push(6u8); + encoded + } + Some(NetworkId::Ethereum { chain_id }) => { + encoded.push(8u8); + encoded.push(7u8); + encoded.append(&mut chain_id.to_be_bytes().into()); + encoded + } + Some(NetworkId::BitcoinCore) => { + encoded.push(9u8); + encoded.push(8u8); + encoded + } + Some(NetworkId::BitcoinCash) => { + encoded.push(10u8); + encoded.push(9u8); + encoded + } } } // Function to convert bytes to networkId -pub(crate) fn network_id_from_bytes(encoded_bytes: Vec) -> MayRevert { +pub(crate) fn network_id_from_bytes(encoded_bytes: Vec) -> MayRevert> { ensure!( encoded_bytes.len() > 0, RevertReason::custom("Junctions cannot be empty") @@ -73,17 +120,42 @@ pub(crate) fn network_id_from_bytes(encoded_bytes: Vec) -> MayRevert Ok(NetworkId::Any), - 1 => Ok(NetworkId::Named( + 0 => Ok(None), + 1 => Ok(Some(NetworkId::ByGenesis( encoded_network_id .read_till_end() - .in_field("name")? + .in_field("genesis")? .to_vec() .try_into() - .map_err(|_| RevertReason::value_is_too_large("network name").in_field("name"))?, - )), - 2 => Ok(NetworkId::Polkadot), - 3 => Ok(NetworkId::Kusama), + .map_err(|_| { + RevertReason::value_is_too_large("network by genesis").in_field("genesis") + })?, + ))), + 2 => Ok(Some(NetworkId::Polkadot)), + 3 => Ok(Some(NetworkId::Kusama)), + 4 => { + let mut block_number: [u8; 8] = Default::default(); + block_number.copy_from_slice(&encoded_network_id.read_raw_bytes(8)?); + + let mut block_hash: [u8; 32] = Default::default(); + block_hash.copy_from_slice(&encoded_network_id.read_raw_bytes(32)?); + Ok(Some(NetworkId::ByFork { + block_number: u64::from_be_bytes(block_number), + block_hash, + })) + } + 5 => Ok(Some(NetworkId::Westend)), + 6 => Ok(Some(NetworkId::Rococo)), + 7 => Ok(Some(NetworkId::Wococo)), + 8 => { + let mut chain_id: [u8; 8] = Default::default(); + chain_id.copy_from_slice(&encoded_network_id.read_raw_bytes(8)?); + Ok(Some(NetworkId::Ethereum { + chain_id: u64::from_be_bytes(chain_id), + })) + } + 9 => Ok(Some(NetworkId::BitcoinCore)), + 10 => Ok(Some(NetworkId::BitcoinCash)), _ => Err(RevertReason::custom("Non-valid Network Id").into()), } } @@ -157,14 +229,32 @@ impl EvmData for Junction { general_index.copy_from_slice(&encoded_junction.read_raw_bytes(16)?); Ok(Junction::GeneralIndex(u128::from_be_bytes(general_index))) } - 6 => Ok(Junction::GeneralKey( - encoded_junction - .read_till_end()? - .to_vec() - .try_into() - .map_err(|_| RevertReason::custom("junction general key is too long"))?, - )), + 6 => { + let mut length: [u8; 1] = Default::default(); + length.copy_from_slice( + encoded_junction + .read_raw_bytes(1) + .map_err(|_| RevertReason::read_out_of_bounds("General Key length"))?, + ); + + let mut data: [u8; 32] = Default::default(); + data.copy_from_slice(&encoded_junction.read_till_end()?); + + Ok(Junction::GeneralKey { + length: u8::from_be_bytes(length), + data, + }) + } 7 => Ok(Junction::OnlyChild), + 8 => Err(RevertReason::custom("Junction::Plurality not supported yet").into()), + 9 => { + let network = encoded_junction.read_till_end()?.to_vec(); + if let Some(network_id) = network_id_from_bytes(network)? { + Ok(Junction::GlobalConsensus(network_id)) + } else { + Err(RevertReason::custom("Unknown NetworkId").into()) + } + } _ => Err(RevertReason::custom("Unknown Junction variant").into()), } } @@ -205,15 +295,21 @@ impl EvmData for Junction { encoded.append(&mut id.to_be_bytes().to_vec()); encoded.as_slice().into() } - Junction::GeneralKey(key) => { + Junction::GeneralKey { length, data } => { encoded.push(6u8); - encoded.append(&mut key.into_inner()); + encoded.push(length); + encoded.append(&mut data.into()); encoded.as_slice().into() } Junction::OnlyChild => { encoded.push(7u8); encoded.as_slice().into() } + Junction::GlobalConsensus(network_id) => { + encoded.push(9u8); + encoded.append(&mut network_id_to_bytes(Some(network_id))); + encoded.as_slice().into() + } // TODO: The only missing item here is Junciton::Plurality. This is a complex encoded // type that we need to evaluate how to support _ => unreachable!("Junction::Plurality not supported yet"), @@ -257,9 +353,13 @@ impl EvmData for Junctions { } } +// Cannot used derive macro since it is a foreign struct. impl EvmData for MultiLocation { fn read(reader: &mut EvmDataReader) -> MayRevert { - crate::read_struct!(reader, {parents: u8, interior: Junctions}); + use crate::revert::BacktraceExt; + let (parents, interior) = reader + .read() + .map_in_tuple_to_field(&["parents", "interior"])?; Ok(MultiLocation { parents, interior }) } @@ -274,4 +374,4 @@ impl EvmData for MultiLocation { fn solidity_type() -> String { <(u8, Junctions)>::solidity_type() } -} +} \ No newline at end of file diff --git a/precompiles/utils/src/tests.rs b/precompiles/utils/src/tests.rs index f9f77736..5956d1da 100644 --- a/precompiles/utils/src/tests.rs +++ b/precompiles/utils/src/tests.rs @@ -840,7 +840,7 @@ fn junction_decoder_works() { let writer_output = EvmDataWriter::new() .write(Junction::AccountId32 { - network: NetworkId::Any, + network: None, id: [1u8; 32], }) .build(); @@ -853,14 +853,14 @@ fn junction_decoder_works() { assert_eq!( parsed, Junction::AccountId32 { - network: NetworkId::Any, + network:None, id: [1u8; 32], } ); let writer_output = EvmDataWriter::new() .write(Junction::AccountIndex64 { - network: NetworkId::Any, + network: None, index: u64::from_be_bytes([1u8; 8]), }) .build(); @@ -873,14 +873,14 @@ fn junction_decoder_works() { assert_eq!( parsed, Junction::AccountIndex64 { - network: NetworkId::Any, + network: None, index: u64::from_be_bytes([1u8; 8]), } ); let writer_output = EvmDataWriter::new() .write(Junction::AccountKey20 { - network: NetworkId::Any, + network: None, key: H160::repeat_byte(0xAA).as_bytes().try_into().unwrap(), }) .build(); @@ -893,7 +893,7 @@ fn junction_decoder_works() { assert_eq!( parsed, Junction::AccountKey20 { - network: NetworkId::Any, + network:None, key: H160::repeat_byte(0xAA).as_bytes().try_into().unwrap(), } ); @@ -901,28 +901,25 @@ fn junction_decoder_works() { #[test] fn network_id_decoder_works() { - assert_eq!( - network_id_from_bytes(network_id_to_bytes(NetworkId::Any)), - Ok(NetworkId::Any) - ); + assert_eq!(network_id_from_bytes(network_id_to_bytes(None)), Ok(None)); + + + let mut name = [0u8; 32]; + name[0..6].copy_from_slice(b"myname"); assert_eq!( - network_id_from_bytes(network_id_to_bytes(NetworkId::Named( - b"myname".to_vec().try_into().expect("name not too long") - ))), - Ok(NetworkId::Named( - b"myname".to_vec().try_into().expect("name not too long") - )) + network_id_from_bytes(network_id_to_bytes(Some(NetworkId::ByGenesis(name)))), + Ok(Some(NetworkId::ByGenesis(name))) ); assert_eq!( - network_id_from_bytes(network_id_to_bytes(NetworkId::Kusama)), - Ok(NetworkId::Kusama) + network_id_from_bytes(network_id_to_bytes(Some(NetworkId::Kusama))), + Ok(Some(NetworkId::Kusama)) ); assert_eq!( - network_id_from_bytes(network_id_to_bytes(NetworkId::Polkadot)), - Ok(NetworkId::Polkadot) + network_id_from_bytes(network_id_to_bytes(Some(NetworkId::Polkadot))), + Ok(Some(NetworkId::Polkadot)) ); } diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 2bed9402..7219ec62 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -28,6 +28,7 @@ std = [ 'sp-std/std', 'sp-transaction-pool/std', 'sp-version/std', + 'substrate-wasm-builder', 'frame-executive/std', 'frame-support/std', 'frame-system/std', @@ -70,7 +71,7 @@ with-paritydb-weights = [] with-rocksdb-weights = [] [build-dependencies] -substrate-wasm-builder = { workspace = true } +substrate-wasm-builder = { workspace = true, optional = true } [package] authors = ['Stability Solutions'] diff --git a/runtime/build.rs b/runtime/build.rs index 9b53d245..90291648 100644 --- a/runtime/build.rs +++ b/runtime/build.rs @@ -1,7 +1,6 @@ -use substrate_wasm_builder::WasmBuilder; - fn main() { - WasmBuilder::new() + #[cfg(feature = "std")] + substrate_wasm_builder::WasmBuilder::new() .with_current_project() .export_heap_base() .import_memory() diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 84cf9aab..1837d88c 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -60,8 +60,9 @@ use pallet_grandpa::{ fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList, }; // Frontier +use fp_evm::weight_per_gas; use fp_rpc::TransactionStatus; -use pallet_ethereum::{Call::transact, Transaction as EthereumTransaction}; +use pallet_ethereum::{Call::transact, PostLogContent, Transaction as EthereumTransaction}; use pallet_evm::{Account as EVMAccount, FeeCalculator, Runner}; use pallet_sponsored_transactions::Call::send_sponsored_transaction; use pallet_validator_set::SessionBlockManager; @@ -276,6 +277,7 @@ impl pallet_grandpa::Config for Runtime { type WeightInfo = (); type MaxAuthorities = ConstU32<32>; + type MaxSetIdSessionEntries = (); } parameter_types! { @@ -490,9 +492,14 @@ impl pallet_evm::Config for Runtime { type FindAuthor = FindAuthorLinkedOrTruncated; } +parameter_types! { + pub const PostBlockAndTxnHashes: PostLogContent = PostLogContent::BlockAndTxnHashes; +} + impl pallet_ethereum::Config for Runtime { type RuntimeEvent = RuntimeEvent; type StateRoot = pallet_ethereum::IntermediateStateRoot; + type PostLogContent = PostBlockAndTxnHashes; } impl pallet_dnt_fee_controller::Config for Runtime { @@ -1201,6 +1208,14 @@ impl_runtime_apis! { ) -> pallet_transaction_payment::FeeDetails { TransactionPayment::query_fee_details(uxt, len) } + + fn query_weight_to_fee(weight: Weight) -> Balance { + TransactionPayment::weight_to_fee(weight) + } + + fn query_length_to_fee(length: u32) -> Balance { + TransactionPayment::length_to_fee(length) + } } impl sp_session::SessionKeys for Runtime { diff --git a/test-utils/stability-client/src/lib.rs b/test-utils/stability-client/src/lib.rs index a3d35d9e..c2e975c0 100644 --- a/test-utils/stability-client/src/lib.rs +++ b/test-utils/stability-client/src/lib.rs @@ -41,7 +41,7 @@ use futures::{future::Future, stream::StreamExt}; use sc_client_api::BlockchainEvents; use sc_service::client::{ClientConfig, LocalCallExecutor}; use serde::Deserialize; -use sp_core::storage::ChildInfo; +use sp_core::{storage::ChildInfo, testing::TaskExecutor}; use sp_runtime::{codec::Encode, traits::Block as BlockT, OpaqueExtrinsic}; use std::{ collections::{HashMap, HashSet}, @@ -62,7 +62,7 @@ impl GenesisInit for () { } /// A builder for creating a test client instance. -pub struct TestClientBuilder { +pub struct TestClientBuilder { execution_strategies: ExecutionStrategies, genesis_init: G, /// The key is an unprefixed storage key, this only contains @@ -236,10 +236,13 @@ impl executor.clone(), ) .expect("Creates genesis block builder"); - + + let spawn_handle = Box::new(TaskExecutor::new()); + let client = client::Client::new( self.backend.clone(), executor, + spawn_handle, genesis_block_builder, self.fork_blocks, self.bad_blocks, From 6ea2d2346444a571e402a2bf69ed7dba44c1413f Mon Sep 17 00:00:00 2001 From: GabrielMartinezRodriguez Date: Fri, 20 Oct 2023 12:11:00 +0200 Subject: [PATCH 03/37] chore: polkadot v0.9.39 --- Cargo.lock | 738 +++++++++++---------- Cargo.toml | 204 +++--- client/authorship/src/authorship.rs | 14 +- node/Cargo.toml | 3 + node/src/chain_spec/alphanet.rs | 1 + node/src/chain_spec/betanet.rs | 1 + node/src/chain_spec/dev.rs | 1 + node/src/main.rs | 1 + node/src/service.rs | 38 +- primitives/runner/src/lib.rs | 8 +- runtime/Cargo.toml | 2 + runtime/src/lib.rs | 2 + stability-rpc/src/lib.rs | 14 +- test-utils/stability-runtime/Cargo.toml | 4 +- test-utils/stability-runtime/src/lib.rs | 48 +- test-utils/stability-runtime/src/system.rs | 4 +- 16 files changed, 587 insertions(+), 496 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7f9da21f..bd9e1e1a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,7 +18,7 @@ version = "0.1.1" dependencies = [ "blake2-rfc", "hex", - "impl-serde 0.3.2", + "impl-serde", "libsecp256k1", "log", "parity-scale-codec", @@ -523,13 +523,12 @@ dependencies = [ ] [[package]] -name = "beefy-merkle-tree" +name = "binary-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ - "sp-api", - "sp-beefy", - "sp-runtime", + "hash-db", + "log", ] [[package]] @@ -695,6 +694,18 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" +[[package]] +name = "bounded-collections" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca548b6163b872067dc5eb82fd130c56881435e30367d2073594a3d9744120dd" +dependencies = [ + "log", + "parity-scale-codec", + "scale-info", + "serde", +] + [[package]] name = "bs58" version = "0.4.0" @@ -749,6 +760,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" +[[package]] +name = "bytemuck" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" + [[package]] name = "byteorder" version = "1.5.0" @@ -792,15 +809,16 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.14.2" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" +checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", "semver 1.0.20", "serde", "serde_json", + "thiserror", ] [[package]] @@ -1114,18 +1132,18 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.88.2" +version = "0.93.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52056f6d0584484b57fa6c1a65c1fcb15f3780d8b6a758426d9e3084169b2ddd" +checksum = "2bc42ba2e232e5b20ff7dc299a812d53337dadce9a7e39a238e6a5cb82d2e57b" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.88.2" +version = "0.93.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fed94c8770dc25d01154c3ffa64ed0b3ba9d583736f305fed7beebe5d9cf74" +checksum = "253531aca9b6f56103c9420369db3263e784df39aa1c90685a1f69cfbba0623e" dependencies = [ "arrayvec 0.7.4", "bumpalo", @@ -1135,6 +1153,7 @@ dependencies = [ "cranelift-entity", "cranelift-isle", "gimli 0.26.2", + "hashbrown 0.12.3", "log", "regalloc2", "smallvec", @@ -1143,33 +1162,33 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.88.2" +version = "0.93.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c451b81faf237d11c7e4f3165eeb6bac61112762c5cfe7b4c0fb7241474358f" +checksum = "72f2154365e2bff1b1b8537a7181591fdff50d8e27fa6e40d5c69c3bad0ca7c8" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.88.2" +version = "0.93.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c940133198426d26128f08be2b40b0bd117b84771fd36798969c4d712d81fc" +checksum = "687e14e3f5775248930e0d5a84195abef8b829958e9794bf8d525104993612b4" [[package]] name = "cranelift-entity" -version = "0.88.2" +version = "0.93.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87a0f1b2fdc18776956370cf8d9b009ded3f855350c480c1c52142510961f352" +checksum = "f42ea692c7b450ad18b8c9889661505d51c09ec4380cf1c2d278dbb2da22cae1" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.88.2" +version = "0.93.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34897538b36b216cc8dd324e73263596d51b8cf610da6498322838b2546baf8a" +checksum = "8483c2db6f45fe9ace984e5adc5d058102227e4c62e5aa2054e16b0275fd3a6e" dependencies = [ "cranelift-codegen", "log", @@ -1179,15 +1198,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.88.2" +version = "0.93.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b2629a569fae540f16a76b70afcc87ad7decb38dc28fa6c648ac73b51e78470" +checksum = "e9793158837678902446c411741d87b43f57dadfb944f2440db4287cda8cbd59" [[package]] name = "cranelift-native" -version = "0.88.2" +version = "0.93.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20937dab4e14d3e225c5adfc9c7106bafd4ac669bdb43027b911ff794c6fb318" +checksum = "72668c7755f2b880665cb422c8ad2d56db58a88b9bebfef0b73edc2277c13c49" dependencies = [ "cranelift-codegen", "libc", @@ -1196,9 +1215,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.88.2" +version = "0.93.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80fc2288957a94fd342a015811479de1837850924166d1f1856d8406e6f3609b" +checksum = "3852ce4b088b44ac4e29459573943009a70d1b192c8d77ef949b4e814f656fc1" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -1908,17 +1927,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" -[[package]] -name = "errno" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" -dependencies = [ - "errno-dragonfly", - "libc", - "winapi", -] - [[package]] name = "errno" version = "0.3.5" @@ -1929,16 +1937,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "ethbloom" version = "0.13.0" @@ -1949,7 +1947,7 @@ dependencies = [ "fixed-hash", "impl-codec", "impl-rlp", - "impl-serde 0.4.0", + "impl-serde", "scale-info", "tiny-keccak", ] @@ -1982,7 +1980,7 @@ dependencies = [ "fixed-hash", "impl-codec", "impl-rlp", - "impl-serde 0.4.0", + "impl-serde", "primitive-types", "scale-info", "uint", @@ -2097,7 +2095,7 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fc-cli" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "clap", "ethereum-types", @@ -2115,7 +2113,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "async-trait", "fc-db", @@ -2133,7 +2131,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "fp-storage", "kvdb-rocksdb", @@ -2152,7 +2150,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "fc-db", "fc-storage", @@ -2170,7 +2168,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "ethereum", "ethereum-types", @@ -2212,7 +2210,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "ethereum", "ethereum-types", @@ -2225,7 +2223,7 @@ dependencies = [ [[package]] name = "fc-storage" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "ethereum", "ethereum-types", @@ -2365,7 +2363,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "parity-scale-codec", ] @@ -2379,10 +2377,28 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fp-account" +version = "1.0.0-dev" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +dependencies = [ + "hex", + "impl-serde", + "libsecp256k1", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "ethereum", "parity-scale-codec", @@ -2394,7 +2410,7 @@ dependencies = [ [[package]] name = "fp-ethereum" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "ethereum", "ethereum-types", @@ -2408,7 +2424,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "evm", "frame-support", @@ -2422,7 +2438,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "ethereum", "ethereum-types", @@ -2438,7 +2454,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "frame-support", "parity-scale-codec", @@ -2450,7 +2466,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "parity-scale-codec", "serde", @@ -2465,7 +2481,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "frame-support", "frame-support-procedural", @@ -2490,7 +2506,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "Inflector", "array-bytes", @@ -2537,7 +2553,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "frame-support", "frame-system", @@ -2565,7 +2581,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "bitflags 1.3.2", "frame-metadata", @@ -2597,7 +2613,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "Inflector", "cfg-expr", @@ -2612,7 +2628,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2624,7 +2640,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "proc-macro2", "quote", @@ -2634,7 +2650,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "frame-support", "log", @@ -2652,7 +2668,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "frame-benchmarking", "frame-support", @@ -2667,7 +2683,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "parity-scale-codec", "sp-api", @@ -3000,6 +3016,9 @@ name = "hashbrown" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.3", +] [[package]] name = "hashbrown" @@ -3304,15 +3323,6 @@ dependencies = [ "rlp", ] -[[package]] -name = "impl-serde" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4551f042f3438e64dbd6226b20527fc84a6e1fe65688b58746a2f53623f25f5c" -dependencies = [ - "serde", -] - [[package]] name = "impl-serde" version = "0.4.0" @@ -3400,12 +3410,6 @@ dependencies = [ "webrtc-util", ] -[[package]] -name = "io-lifetimes" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074" - [[package]] name = "io-lifetimes" version = "1.0.11" @@ -4247,19 +4251,18 @@ dependencies = [ [[package]] name = "linregress" -version = "0.4.4" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c601a85f5ecd1aba625247bca0031585fb1c446461b142878a16f8245ddeb8" +checksum = "4de04dcecc58d366391f9920245b85ffa684558a5ef6e7736e754347c3aea9c2" dependencies = [ "nalgebra", - "statrs", ] [[package]] name = "linux-raw-sys" -version = "0.0.46" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "linux-raw-sys" @@ -4642,9 +4645,9 @@ dependencies = [ [[package]] name = "nalgebra" -version = "0.27.1" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "462fffe4002f4f2e1f6a9dcf12cc1a6fc0e15989014efc02a941d3e0f5dc2120" +checksum = "307ed9b18cc2423f29e83f84fd23a8e73628727990181f18641a8b5dc2ab1caa" dependencies = [ "approx", "matrixmultiply", @@ -4652,17 +4655,15 @@ dependencies = [ "num-complex", "num-rational", "num-traits", - "rand 0.8.5", - "rand_distr", "simba", "typenum", ] [[package]] name = "nalgebra-macros" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fcc0b8149b4632adc89ac3b7b31a12fb6099a0317a4eb2ebff574ef7de7218" +checksum = "91761aed67d03ad966ef783ae962ef9bbaca728d2dd7ceb7939ec110fffad998" dependencies = [ "proc-macro2", "quote", @@ -4899,7 +4900,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", - "libm", ] [[package]] @@ -5065,7 +5065,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "frame-support", "frame-system", @@ -5081,7 +5081,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "frame-support", "frame-system", @@ -5095,7 +5095,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5119,7 +5119,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5134,7 +5134,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "fp-evm", "frame-support", @@ -5145,10 +5145,53 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-beefy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +dependencies = [ + "frame-support", + "frame-system", + "pallet-authorship", + "pallet-session", + "parity-scale-codec", + "scale-info", + "serde", + "sp-beefy", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-beefy-mmr" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +dependencies = [ + "array-bytes", + "binary-merkle-tree", + "frame-support", + "frame-system", + "log", + "pallet-beefy", + "pallet-mmr", + "pallet-session", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-beefy", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5235,7 +5278,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "ethereum", "ethereum-types", @@ -5244,14 +5287,12 @@ dependencies = [ "fp-ethereum", "fp-evm", "fp-rpc", - "fp-self-contained", "fp-storage", "frame-support", "frame-system", "pallet-evm", "pallet-timestamp", "parity-scale-codec", - "rlp", "scale-info", "sp-io", "sp-runtime", @@ -5261,10 +5302,11 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "environmental", "evm", + "fp-account", "fp-evm", "frame-benchmarking", "frame-support", @@ -5285,7 +5327,7 @@ dependencies = [ [[package]] name = "pallet-evm-chain-id" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "frame-support", "frame-system", @@ -5296,7 +5338,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-blake2" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "fp-evm", ] @@ -5304,7 +5346,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-bn128" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "fp-evm", "sp-core", @@ -5314,7 +5356,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "fp-evm", "num", @@ -5323,7 +5365,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-sha3fips" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "fp-evm", "tiny-keccak", @@ -5332,7 +5374,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "fp-evm", "ripemd", @@ -5358,7 +5400,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5381,7 +5423,7 @@ dependencies = [ [[package]] name = "pallet-hotfix-sufficients" version = "1.0.0" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.38#5644279da588baab7caa9f3a4eb69363e1606461" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" dependencies = [ "frame-benchmarking", "frame-support", @@ -5394,6 +5436,23 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-mmr" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-mmr-primitives", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-root-controller" version = "1.0.0" @@ -5411,7 +5470,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "frame-support", "frame-system", @@ -5462,7 +5521,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "frame-support", "frame-system", @@ -5492,7 +5551,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "frame-benchmarking", "frame-support", @@ -5510,7 +5569,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "frame-support", "frame-system", @@ -5526,7 +5585,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5542,7 +5601,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -6323,7 +6382,7 @@ dependencies = [ "fixed-hash", "impl-codec", "impl-rlp", - "impl-serde 0.4.0", + "impl-serde", "scale-info", "uint", ] @@ -6605,16 +6664,6 @@ dependencies = [ "getrandom 0.2.10", ] -[[package]] -name = "rand_distr" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" -dependencies = [ - "num-traits", - "rand 0.8.5", -] - [[package]] name = "rand_hc" version = "0.2.0" @@ -6744,9 +6793,9 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.3.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d43a209257d978ef079f3d446331d0f1794f5e0fc19b306a199983857833a779" +checksum = "300d4fbfb40c1c66a78ba3ddd41c1110247cf52f97b87d0f2fc9209bd49b030c" dependencies = [ "fxhash", "log", @@ -6798,6 +6847,18 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +[[package]] +name = "region" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" +dependencies = [ + "bitflags 1.3.2", + "libc", + "mach", + "winapi", +] + [[package]] name = "reqwest" version = "0.11.22" @@ -7055,16 +7116,16 @@ dependencies = [ [[package]] name = "rustix" -version = "0.35.15" +version = "0.36.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413c4d41e2f1b0814c63567d11618483de0bd64f451b452f2ca43896579486ba" +checksum = "6da3636faa25820d8648e0e31c5d519bbb01f72fdf57131f0f5f7da5fed36eab" dependencies = [ "bitflags 1.3.2", - "errno 0.2.8", - "io-lifetimes 0.7.5", + "errno", + "io-lifetimes", "libc", - "linux-raw-sys 0.0.46", - "windows-sys 0.42.0", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", ] [[package]] @@ -7074,8 +7135,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4eb579851244c2c03e7c24f501c3432bed80b8f720af1d6e5b0e0f01555a035" dependencies = [ "bitflags 1.3.2", - "errno 0.3.5", - "io-lifetimes 1.0.11", + "errno", + "io-lifetimes", "libc", "linux-raw-sys 0.3.8", "windows-sys 0.48.0", @@ -7088,7 +7149,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed" dependencies = [ "bitflags 2.4.1", - "errno 0.3.5", + "errno", "libc", "linux-raw-sys 0.4.10", "windows-sys 0.48.0", @@ -7163,6 +7224,15 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +[[package]] +name = "safe_arch" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f398075ce1e6a179b46f51bd88d0598b92b00d3551f1a2d4ac49e771b56ac354" +dependencies = [ + "bytemuck", +] + [[package]] name = "same-file" version = "1.0.6" @@ -7175,7 +7245,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "log", "sp-core", @@ -7186,7 +7256,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -7202,7 +7272,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "memmap2", "sc-chain-spec-derive", @@ -7217,7 +7287,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -7228,7 +7298,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "array-bytes", "chrono", @@ -7268,7 +7338,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "fnv", "futures", @@ -7294,7 +7364,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "hash-db", "kvdb", @@ -7320,7 +7390,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "async-trait", "futures", @@ -7345,7 +7415,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "async-trait", "futures", @@ -7374,7 +7444,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "async-trait", "fork-tree", @@ -7392,6 +7462,7 @@ dependencies = [ "sc-consensus-slots", "sc-keystore", "sc-telemetry", + "scale-info", "schnorrkel", "sp-api", "sp-application-crypto", @@ -7412,7 +7483,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "fork-tree", "parity-scale-codec", @@ -7425,7 +7496,7 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "assert_matches", "async-trait", @@ -7459,7 +7530,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "async-trait", "futures", @@ -7482,7 +7553,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "lru", "parity-scale-codec", @@ -7506,7 +7577,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -7519,7 +7590,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "log", "sc-allocator", @@ -7532,13 +7603,14 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ + "anyhow", "cfg-if", "libc", "log", "once_cell", - "rustix 0.35.15", + "rustix 0.36.16", "sc-allocator", "sc-executor-common", "sp-runtime-interface", @@ -7549,7 +7621,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "ahash 0.8.3", "array-bytes", @@ -7589,7 +7661,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "ansi_term", "futures", @@ -7604,7 +7676,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "array-bytes", "async-trait", @@ -7619,7 +7691,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "array-bytes", "async-trait", @@ -7634,6 +7706,7 @@ dependencies = [ "libp2p", "log", "lru", + "mockall", "parity-scale-codec", "parking_lot 0.12.1", "pin-project", @@ -7661,7 +7734,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "cid", "futures", @@ -7680,7 +7753,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "async-trait", "bitflags 1.3.2", @@ -7706,7 +7779,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "ahash 0.8.3", "futures", @@ -7724,7 +7797,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "array-bytes", "futures", @@ -7745,7 +7818,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "array-bytes", "async-trait", @@ -7777,7 +7850,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "array-bytes", "futures", @@ -7796,7 +7869,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "array-bytes", "bytes", @@ -7826,7 +7899,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "futures", "libp2p", @@ -7839,7 +7912,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -7848,7 +7921,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "futures", "jsonrpsee", @@ -7878,7 +7951,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -7897,7 +7970,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "http", "jsonrpsee", @@ -7912,7 +7985,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "array-bytes", "futures", @@ -7938,7 +8011,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "async-trait", "directories", @@ -8004,7 +8077,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "log", "parity-scale-codec", @@ -8015,7 +8088,7 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "clap", "futures", @@ -8031,7 +8104,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "futures", "libc", @@ -8050,7 +8123,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "chrono", "futures", @@ -8069,7 +8142,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "ansi_term", "atty", @@ -8100,7 +8173,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8111,7 +8184,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "async-trait", "futures", @@ -8138,7 +8211,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "async-trait", "futures", @@ -8152,7 +8225,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "backtrace", "futures", @@ -8526,14 +8599,15 @@ checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" [[package]] name = "simba" -version = "0.5.1" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e82063457853d00243beda9952e910b82593e4b07ae9f721b9278a99a0d3d5c" +checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae" dependencies = [ "approx", "num-complex", "num-traits", "paste", + "wide", ] [[package]] @@ -8658,7 +8732,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "hash-db", "log", @@ -8676,7 +8750,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "blake2", "proc-macro-crate", @@ -8688,7 +8762,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "parity-scale-codec", "scale-info", @@ -8701,7 +8775,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "integer-sqrt", "num-traits", @@ -8715,8 +8789,9 @@ dependencies = [ [[package]] name = "sp-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ + "lazy_static", "parity-scale-codec", "scale-info", "serde", @@ -8727,12 +8802,13 @@ dependencies = [ "sp-mmr-primitives", "sp-runtime", "sp-std", + "strum", ] [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "parity-scale-codec", "sp-api", @@ -8744,7 +8820,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "futures", "log", @@ -8762,7 +8838,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "async-trait", "futures", @@ -8780,7 +8856,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "async-trait", "parity-scale-codec", @@ -8798,7 +8874,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "async-trait", "merlin", @@ -8821,7 +8897,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "parity-scale-codec", "scale-info", @@ -8833,7 +8909,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "parity-scale-codec", "scale-info", @@ -8846,18 +8922,19 @@ dependencies = [ [[package]] name = "sp-core" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "array-bytes", "base58", "bitflags 1.3.2", "blake2", + "bounded-collections", "dyn-clonable", "ed25519-zebra", "futures", "hash-db", "hash256-std-hasher", - "impl-serde 0.4.0", + "impl-serde", "lazy_static", "libsecp256k1", "log", @@ -8888,7 +8965,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "blake2", "byteorder", @@ -8902,7 +8979,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "proc-macro2", "quote", @@ -8913,7 +8990,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -8922,7 +8999,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "proc-macro2", "quote", @@ -8932,7 +9009,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "environmental", "parity-scale-codec", @@ -8943,7 +9020,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "finality-grandpa", "log", @@ -8961,11 +9038,12 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "async-trait", "impl-trait-for-tuples", "parity-scale-codec", + "scale-info", "sp-core", "sp-runtime", "sp-std", @@ -8975,7 +9053,7 @@ dependencies = [ [[package]] name = "sp-io" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "bytes", "ed25519 1.5.3", @@ -9000,7 +9078,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "lazy_static", "sp-core", @@ -9011,7 +9089,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "async-trait", "futures", @@ -9028,7 +9106,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "thiserror", "zstd", @@ -9037,7 +9115,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -9055,7 +9133,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "sp-api", "sp-core", @@ -9065,7 +9143,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "backtrace", "lazy_static", @@ -9075,7 +9153,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "rustc-hash", "serde", @@ -9085,7 +9163,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "either", "hash256-std-hasher", @@ -9107,7 +9185,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -9125,7 +9203,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "Inflector", "proc-macro-crate", @@ -9137,7 +9215,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "parity-scale-codec", "scale-info", @@ -9151,7 +9229,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "parity-scale-codec", "scale-info", @@ -9163,7 +9241,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "hash-db", "log", @@ -9183,14 +9261,14 @@ dependencies = [ [[package]] name = "sp-std" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" [[package]] name = "sp-storage" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ - "impl-serde 0.4.0", + "impl-serde", "parity-scale-codec", "ref-cast", "serde", @@ -9201,7 +9279,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "async-trait", "futures-timer", @@ -9216,7 +9294,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "parity-scale-codec", "sp-std", @@ -9228,7 +9306,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "sp-api", "sp-runtime", @@ -9237,7 +9315,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "async-trait", "log", @@ -9253,7 +9331,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "ahash 0.8.3", "hash-db", @@ -9276,9 +9354,9 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ - "impl-serde 0.4.0", + "impl-serde", "parity-scale-codec", "parity-wasm", "scale-info", @@ -9293,7 +9371,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -9304,8 +9382,9 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ + "anyhow", "impl-trait-for-tuples", "log", "parity-scale-codec", @@ -9317,7 +9396,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "parity-scale-codec", "scale-info", @@ -9390,6 +9469,7 @@ dependencies = [ "fc-rpc", "fc-rpc-core", "fc-storage", + "fp-account", "fp-evm", "fp-rpc", "frame-benchmarking", @@ -9403,6 +9483,7 @@ dependencies = [ "pallet-transaction-payment-rpc", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", + "sc-chain-spec", "sc-cli", "sc-client-api", "sc-consensus", @@ -9411,6 +9492,7 @@ dependencies = [ "sc-executor", "sc-finality-grandpa", "sc-network", + "sc-network-common", "sc-rpc", "sc-rpc-api", "sc-service", @@ -9495,6 +9577,7 @@ name = "stability-runtime" version = "0.0.0" dependencies = [ "account", + "fp-account", "fp-evm", "fp-rpc", "fp-self-contained", @@ -9600,7 +9683,6 @@ dependencies = [ name = "stability-test-runtime" version = "1.0.0" dependencies = [ - "beefy-merkle-tree", "cfg-if", "frame-support", "frame-system", @@ -9609,6 +9691,7 @@ dependencies = [ "log", "memory-db", "pallet-babe", + "pallet-beefy-mmr", "pallet-ethereum", "pallet-timestamp", "pallet-zero-gas-transactions", @@ -9706,19 +9789,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "statrs" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05bdbb8e4e78216a85785a85d3ec3183144f98d0097b9281802c019bb07a6f05" -dependencies = [ - "approx", - "lazy_static", - "nalgebra", - "num-traits", - "rand 0.8.5", -] - [[package]] name = "stbl-cli-authorship" version = "1.0.0" @@ -9913,7 +9983,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "platforms 2.0.0", ] @@ -9921,7 +9991,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -9940,7 +10010,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "hyper", "log", @@ -9952,7 +10022,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "array-bytes", "async-trait", @@ -9978,9 +10048,8 @@ dependencies = [ [[package]] name = "substrate-test-runtime" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ - "beefy-merkle-tree", "cfg-if", "frame-support", "frame-system", @@ -9988,6 +10057,7 @@ dependencies = [ "log", "memory-db", "pallet-babe", + "pallet-beefy-mmr", "pallet-timestamp", "parity-scale-codec", "sc-service", @@ -10021,7 +10091,7 @@ dependencies = [ [[package]] name = "substrate-test-runtime-client" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "futures", "parity-scale-codec", @@ -10040,7 +10110,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" dependencies = [ "ansi_term", "build-helper", @@ -10518,12 +10588,12 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.24.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "004e1e8f92535694b4cb1444dc5a8073ecf0815e3357f729638b9f8fc4062908" +checksum = "3390c0409daaa6027d6681393316f4ccd3ff82e1590a1e4725014e3ae2bf1920" dependencies = [ "hash-db", - "hashbrown 0.12.3", + "hashbrown 0.13.2", "log", "rustc-hex", "smallvec", @@ -11011,22 +11081,24 @@ dependencies = [ "memory_units", "num-rational", "num-traits", + "region", ] [[package]] name = "wasmparser" -version = "0.89.1" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5d3e08b13876f96dd55608d03cd4883a0545884932d5adf11925876c96daef" +checksum = "64b20236ab624147dfbb62cf12a19aaf66af0e41b8398838b66e997d07d269d4" dependencies = [ "indexmap 1.9.3", + "url", ] [[package]] name = "wasmtime" -version = "1.0.2" +version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad5af6ba38311282f2a21670d96e78266e8c8e2f38cbcd52c254df6ccbc7731" +checksum = "76a222f5fa1e14b2cefc286f1b68494d7a965f4bf57ec04c59bb62673d639af6" dependencies = [ "anyhow", "bincode", @@ -11047,23 +11119,23 @@ dependencies = [ "wasmtime-environ", "wasmtime-jit", "wasmtime-runtime", - "windows-sys 0.36.1", + "windows-sys 0.42.0", ] [[package]] name = "wasmtime-asm-macros" -version = "1.0.2" +version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45de63ddfc8b9223d1adc8f7b2ee5f35d1f6d112833934ad7ea66e4f4339e597" +checksum = "4407a7246e7d2f3d8fb1cf0c72fda8dbafdb6dd34d555ae8bea0e5ae031089cc" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "1.0.2" +version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcd849399d17d2270141cfe47fa0d91ee52d5f8ea9b98cf7ddde0d53e5f79882" +checksum = "5ceb3adf61d654be0be67fffdce42447b0880481348785be5fe40b5dd7663a4c" dependencies = [ "anyhow", "base64 0.13.1", @@ -11071,19 +11143,19 @@ dependencies = [ "directories-next", "file-per-thread-logger", "log", - "rustix 0.35.15", + "rustix 0.36.16", "serde", - "sha2 0.9.9", + "sha2 0.10.8", "toml", - "windows-sys 0.36.1", + "windows-sys 0.42.0", "zstd", ] [[package]] name = "wasmtime-cranelift" -version = "1.0.2" +version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bd91339b742ff20bfed4532a27b73c86b5bcbfedd6bea2dcdf2d64471e1b5c6" +checksum = "3c366bb8647e01fd08cb5589976284b00abfded5529b33d7e7f3f086c68304a4" dependencies = [ "anyhow", "cranelift-codegen", @@ -11102,9 +11174,9 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "1.0.2" +version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebb881c61f4f627b5d45c54e629724974f8a8890d455bcbe634330cc27309644" +checksum = "47b8b50962eae38ee319f7b24900b7cf371f03eebdc17400c1dc8575fc10c9a7" dependencies = [ "anyhow", "cranelift-entity", @@ -11121,9 +11193,9 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "1.0.2" +version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1985c628011fe26adf5e23a5301bdc79b245e0e338f14bb58b39e4e25e4d8681" +checksum = "ffaed4f9a234ba5225d8e64eac7b4a5d13b994aeb37353cde2cbeb3febda9eaa" dependencies = [ "addr2line 0.17.0", "anyhow", @@ -11134,32 +11206,42 @@ dependencies = [ "log", "object 0.29.0", "rustc-demangle", - "rustix 0.35.15", "serde", "target-lexicon", - "thiserror", "wasmtime-environ", "wasmtime-jit-debug", + "wasmtime-jit-icache-coherence", "wasmtime-runtime", - "windows-sys 0.36.1", + "windows-sys 0.42.0", ] [[package]] name = "wasmtime-jit-debug" -version = "1.0.2" +version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f671b588486f5ccec8c5a3dba6b4c07eac2e66ab8c60e6f4e53717c77f709731" +checksum = "eed41cbcbf74ce3ff6f1d07d1b707888166dc408d1a880f651268f4f7c9194b2" dependencies = [ "object 0.29.0", "once_cell", - "rustix 0.35.15", + "rustix 0.36.16", +] + +[[package]] +name = "wasmtime-jit-icache-coherence" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a28ae1e648461bfdbb79db3efdaee1bca5b940872e4175390f465593a2e54c" +dependencies = [ + "cfg-if", + "libc", + "windows-sys 0.42.0", ] [[package]] name = "wasmtime-runtime" -version = "1.0.2" +version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee8f92ad4b61736339c29361da85769ebc200f184361959d1792832e592a1afd" +checksum = "e704b126e4252788ccfc3526d4d4511d4b23c521bf123e447ac726c14545217b" dependencies = [ "anyhow", "cc", @@ -11172,19 +11254,18 @@ dependencies = [ "memoffset 0.6.5", "paste", "rand 0.8.5", - "rustix 0.35.15", - "thiserror", + "rustix 0.36.16", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", - "windows-sys 0.36.1", + "windows-sys 0.42.0", ] [[package]] name = "wasmtime-types" -version = "1.0.2" +version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23d61cb4c46e837b431196dd06abb11731541021916d03476a178b54dc07aeb" +checksum = "83e5572c5727c1ee7e8f28717aaa8400e4d22dcbd714ea5457d85b5005206568" dependencies = [ "cranelift-entity", "serde", @@ -11451,6 +11532,16 @@ dependencies = [ "rustix 0.38.19", ] +[[package]] +name = "wide" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c68938b57b33da363195412cfc5fc37c9ed49aa9cfe2156fde64b8d2c9498242" +dependencies = [ + "bytemuck", + "safe_arch", +] + [[package]] name = "widestring" version = "1.0.2" @@ -11507,19 +11598,6 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "windows-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" -dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", -] - [[package]] name = "windows-sys" version = "0.42.0" @@ -11595,12 +11673,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" -[[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" - [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -11613,12 +11685,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" -[[package]] -name = "windows_i686_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" - [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -11631,12 +11697,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" -[[package]] -name = "windows_i686_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" - [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -11649,12 +11709,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" -[[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" - [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -11679,12 +11733,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" -[[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" - [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -11778,23 +11826,23 @@ dependencies = [ [[package]] name = "xcm" -version = "0.9.38" -source = "git+https://github.com/paritytech/polkadot?tag=v0.9.38#72309a2b2e68413305a56dce1097041309bd29c6" +version = "0.9.39" +source = "git+https://github.com/paritytech/polkadot?tag=v0.9.39#bf2ebf30780ce176d16d67c1d313ca261f18233e" dependencies = [ + "bounded-collections", "derivative", "impl-trait-for-tuples", "log", "parity-scale-codec", "scale-info", - "sp-core", "sp-weights", "xcm-procedural", ] [[package]] name = "xcm-procedural" -version = "0.9.38" -source = "git+https://github.com/paritytech/polkadot?tag=v0.9.38#72309a2b2e68413305a56dce1097041309bd29c6" +version = "0.9.39" +source = "git+https://github.com/paritytech/polkadot?tag=v0.9.39#bf2ebf30780ce176d16d67c1d313ca261f18233e" dependencies = [ "Inflector", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index b2229444..f89f1544 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,7 +57,7 @@ ethereum-types = { version = "0.14.1", default-features = false } evm = { version = "0.37.0", default-features = false } jsonrpsee = "0.16.2" kvdb-rocksdb = "0.17.0" -libsecp256k1 = { version = "0.7", default-features = false } +libsecp256k1 = { version = "0.7.1", default-features = false } hex = { version = "0.4.3", default-features = false } parity-db = "0.4.2" rlp = { version = "0.5", default-features = false } @@ -75,119 +75,121 @@ bytes = "1.0" async-trait = "0.1.57" cfg-if = "1.0" memory-db = { version = "0.31.0", default-features = false } -trie-db = { version = "0.24.0", default-features = false } +trie-db = { version = "0.25.1", default-features = false } once_cell = "1.17.1" hex-literal = "0.3.4" syn = "1.0.98" # Polkadot -xcm = { git = "https://github.com/paritytech/polkadot", tag = "v0.9.38", default-features = false } +xcm = { git = "https://github.com/paritytech/polkadot", tag = "v0.9.39", default-features = false } # Substrate Client -sc-block-builder = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-client-db = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-consensus-manual-seal = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-finality-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-network-common = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-proposer-metrics = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38"} -sc-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } +sc-block-builder = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-chain-spec = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-client-db = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-consensus-manual-seal = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-finality-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-network-common = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-proposer-metrics = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39"} +sc-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } # Substrate Primitive -sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sp-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-core = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-database = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sp-finality-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-io = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-keyring = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sp-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-runtime = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-state-machine = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-std = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-storage = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-trie = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-version = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-keystore = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -beefy-primitives = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", package = "sp-beefy", branch = "polkadot-v0.9.38" } -sp-application-crypto = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sp-consensus-babe = { version = "0.10.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sp-externalities = { version = "0.13.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sp-runtime-interface = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +sp-core = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +sp-database = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-finality-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +sp-io = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +sp-keyring = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +sp-runtime = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +sp-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +sp-state-machine = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +sp-std = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +sp-storage = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +sp-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +sp-trie = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +sp-version = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +sp-keystore = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +beefy-primitives = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", package = "sp-beefy", branch = "polkadot-v0.9.39" } +sp-application-crypto = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-consensus-babe = { version = "0.10.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-externalities = { version = "0.13.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-runtime-interface = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } # Substrate FRAME -frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -frame-executive = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -frame-system-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -frame-system-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-aura = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-sudo = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-transaction-payment = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -pallet-transaction-payment-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-utility = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-collective = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-babe = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -beefy-merkle-tree = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +frame-executive = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +frame-system-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +frame-system-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +pallet-aura = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +pallet-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +pallet-sudo = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +pallet-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +pallet-transaction-payment = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +pallet-transaction-payment-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +pallet-utility = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +pallet-collective = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +pallet-babe = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +pallet-beefy-mmr = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +pallet-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } # Substrate Utility -frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sp-staking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sp-staking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } # Frontier Client -fc-cli = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38" } -fc-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38" } -fc-db = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38" } -fc-mapping-sync = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38" } -fc-rpc = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38" } -fc-rpc-core = { version = "1.1.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38" } -fc-storage = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38" } +fc-cli = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39" } +fc-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39" } +fc-db = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39" } +fc-mapping-sync = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39" } +fc-rpc = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39" } +fc-rpc-core = { version = "1.1.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39" } +fc-storage = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39" } # Frontier Primitive -fp-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } -fp-ethereum = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } -fp-evm = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } -fp-rpc = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } -fp-self-contained = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } -fp-storage = { version = "2.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } +fp-account = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } +fp-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } +fp-ethereum = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } +fp-evm = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } +fp-rpc = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } +fp-self-contained = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } +fp-storage = { version = "2.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } # Frontier FRAME -pallet-base-fee = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } -pallet-ethereum = { version = "4.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } -pallet-evm = { version = "6.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } -pallet-evm-chain-id = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } -pallet-evm-precompile-modexp = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } -pallet-evm-precompile-sha3fips = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } -pallet-evm-precompile-simple = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } -pallet-evm-test-vector-support = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } -pallet-hotfix-sufficients = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } +pallet-base-fee = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } +pallet-ethereum = { version = "4.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } +pallet-evm = { version = "6.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } +pallet-evm-chain-id = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } +pallet-evm-precompile-modexp = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } +pallet-evm-precompile-sha3fips = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } +pallet-evm-precompile-simple = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } +pallet-evm-test-vector-support = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } +pallet-hotfix-sufficients = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } # Stability Client stbl-cli-authorship = { version = "1.0.0", path = './client/authorship' } # Stability -pallet-evm-precompile-blake2 = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } -pallet-evm-precompile-bn128 = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.38", default-features = false } +pallet-evm-precompile-blake2 = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } +pallet-evm-precompile-bn128 = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } precompile-utils = { path = "./precompiles/utils", default-features = false } precompile-fee-token-selector = { path = "./precompiles/token-fee-controller/fee-token-selector", default-features = false } precompile-validator-fee-selector = { path = "./precompiles/token-fee-controller/validator-fee-selector", default-features = false } @@ -221,7 +223,7 @@ runner = { path = "./primitives/runner", default-features = false } stbl-core-primitives = { path = "primitives/core", default-features = false } account = { path = "primitives/account", default-features = false } blake2-rfc = { version = "0.2.18", default-features = false } -impl-serde = { version = "0.3.1", default-features = false } +impl-serde = { version = "0.4.0", default-features = false } parity-scale-codec = { version = "3.0.0", default-features = false, features = [ "derive" ] } sha3 = { version = "0.9", default-features = false } stability-rpc = { path = "./stability-rpc", default-features = false } diff --git a/client/authorship/src/authorship.rs b/client/authorship/src/authorship.rs index 6af44198..358876a0 100644 --- a/client/authorship/src/authorship.rs +++ b/client/authorship/src/authorship.rs @@ -221,8 +221,6 @@ where ) -> Proposer { let parent_hash = parent_header.hash(); - let id = BlockId::hash(parent_hash); - info!( "🙌 Starting consensus session on top of parent {:?}", parent_hash @@ -231,7 +229,7 @@ where let proposer = Proposer::<_, _, _, _, PR> { spawn_handle: self.spawn_handle.clone(), client: self.client.clone(), - parent_id: id, + parent_hash, parent_number: *parent_header.number(), transaction_pool: self.transaction_pool.clone(), keystore: self.keystore.clone(), @@ -281,7 +279,7 @@ where pub struct Proposer { spawn_handle: Box, client: Arc, - parent_id: BlockId, + parent_hash: Block::Hash, parent_number: <::Header as HeaderT>::Number, transaction_pool: Arc, keystore: SyncCryptoStorePtr, @@ -385,7 +383,7 @@ where let propose_with_start = time::Instant::now(); let mut block_builder = self.client - .new_block_at(&self.parent_id, inherent_digests, PR::ENABLED)?; + .new_block_at(self.parent_hash, inherent_digests, PR::ENABLED)?; let create_inherents_start = time::Instant::now(); let inherents = block_builder.create_inherents(inherent_data)?; @@ -546,7 +544,7 @@ where let pending_tx = if let Ok(pending_tx) = self .client .runtime_api() - .convert_zero_gas_transaction(&self.parent_id, ethereum_transaction.clone(), signed_hash.0.to_vec()) { + .convert_zero_gas_transaction(self.parent_hash, ethereum_transaction.clone(), signed_hash.0.to_vec()) { pending_tx } else { @@ -659,7 +657,7 @@ where .client .runtime_api() .is_compatible_fee( - &self.parent_id, + self.parent_hash, pending_tx.data().clone(), validator.clone(), ) @@ -1059,7 +1057,7 @@ mod tests { assert_eq!(proposal.block.extrinsics().len(), 1); let api = client.runtime_api(); - api.execute_block(&BlockId::Hash(genesis_hash), proposal.block) + api.execute_block(genesis_hash, proposal.block) .unwrap(); let state = backend.state_at(genesis_hash).unwrap(); diff --git a/node/Cargo.toml b/node/Cargo.toml index 88bb5a01..30027616 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -23,6 +23,7 @@ serde = { workspace = true } # Substrate prometheus-endpoint = { package = "substrate-prometheus-endpoint", workspace = true } +sc-chain-spec = { workspace = true } sc-cli = { workspace = true } sc-client-api = { workspace = true } sc-consensus = { workspace = true } @@ -31,6 +32,7 @@ sc-consensus-manual-seal = { workspace = true } sc-executor = { workspace = true } sc-finality-grandpa = { workspace = true } sc-network = { workspace = true } +sc-network-common = { workspace = true } sc-rpc = { workspace = true } sc-rpc-api = { workspace = true } sc-service = { workspace = true } @@ -71,6 +73,7 @@ fc-db = { workspace = true } fc-mapping-sync = { workspace = true } fc-rpc = { workspace = true } fc-rpc-core = { workspace = true } +fp-account = { workspace = true } fp-evm = { workspace = true, features = ["default"] } fp-rpc = { workspace = true, features = ["default"] } fc-storage = { workspace = true } diff --git a/node/src/chain_spec/alphanet.rs b/node/src/chain_spec/alphanet.rs index d30daad3..504ed1ea 100644 --- a/node/src/chain_spec/alphanet.rs +++ b/node/src/chain_spec/alphanet.rs @@ -61,6 +61,7 @@ pub fn alphanet_config() -> Result { None, // Protocol ID None, + // Fork id None, // Properties None, diff --git a/node/src/chain_spec/betanet.rs b/node/src/chain_spec/betanet.rs index 784e5d48..c6a9c512 100644 --- a/node/src/chain_spec/betanet.rs +++ b/node/src/chain_spec/betanet.rs @@ -61,6 +61,7 @@ pub fn betanet_config() -> Result { None, // Protocol ID None, + // Fork id None, // Properties None, diff --git a/node/src/chain_spec/dev.rs b/node/src/chain_spec/dev.rs index b8992f01..7ee94302 100644 --- a/node/src/chain_spec/dev.rs +++ b/node/src/chain_spec/dev.rs @@ -30,6 +30,7 @@ pub fn development_config(enable_manual_seal: Option) -> DevChainSpec { None, // Protocol ID None, + // Fork id None, // Properties None, diff --git a/node/src/main.rs b/node/src/main.rs index c0405299..d5b49bbb 100644 --- a/node/src/main.rs +++ b/node/src/main.rs @@ -6,6 +6,7 @@ clippy::too_many_arguments, clippy::large_enum_variant )] +#![cfg_attr(feature = "runtime-benchmarks", deny(unused_crate_dependencies))] #[cfg(feature = "runtime-benchmarks")] mod benchmarking; diff --git a/node/src/service.rs b/node/src/service.rs index c78298d9..a7e0b56a 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -8,6 +8,7 @@ use prometheus_endpoint::Registry; use sc_client_api::{BlockBackend, StateBackendFor}; use sc_consensus::BasicQueue; use sc_executor::{NativeElseWasmExecutor, NativeExecutionDispatch}; +use sc_network_common::sync::warp::WarpSyncParams; use sc_service::{error::Error as ServiceError, Configuration, PartialComponents, TaskManager}; use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker}; use sp_api::{ConstructRuntimeApi, TransactionFor}; @@ -297,24 +298,23 @@ where &config.chain_spec, ); - let warp_sync: Option>> = - if sealing.is_some() { - None - } else { - config - .network - .extra_sets - .push(sc_finality_grandpa::grandpa_peers_set_config( - grandpa_protocol_name.clone(), - )); - Some(Arc::new( - sc_finality_grandpa::warp_proof::NetworkProvider::new( - backend.clone(), - grandpa_link.shared_authority_set().clone(), - Vec::default(), - ), - )) - }; + let warp_sync_params = if sealing.is_some() { + None + } else { + config + .network + .extra_sets + .push(sc_finality_grandpa::grandpa_peers_set_config( + grandpa_protocol_name.clone(), + )); + let warp_sync: Arc> = + Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new( + backend.clone(), + grandpa_link.shared_authority_set().clone(), + Vec::default(), + )); + Some(WarpSyncParams::WithProvider(warp_sync)) + }; let (network, system_rpc_tx, tx_handler_controller, network_starter) = sc_service::build_network(sc_service::BuildNetworkParams { @@ -324,7 +324,7 @@ where spawn_handle: task_manager.spawn_handle(), import_queue, block_announce_validator_builder: None, - warp_sync, + warp_sync_params, })?; if config.offchain_worker.enabled { diff --git a/primitives/runner/src/lib.rs b/primitives/runner/src/lib.rs index 66fe4e54..1a8da551 100644 --- a/primitives/runner/src/lib.rs +++ b/primitives/runner/src/lib.rs @@ -130,6 +130,10 @@ where >, ) -> (ExitReason, R), { + // Only check the restrictions of EIP-3607 if the source of the EVM operation is from an external transaction. + // If the source of this EVM operation is from an internal call, like from `eth_call` or `eth_estimateGas` RPC, + // we will skip the checks for the EIP-3607. + // // EIP-3607: https://eips.ethereum.org/EIPS/eip-3607 // Do not allow transactions for which `tx.sender` has any code deployed. // @@ -137,7 +141,9 @@ where // of a precompile. While mainnet Ethereum currently only has stateless precompiles, // projects using Frontier can have stateful precompiles that can manage funds or // which calls other contracts that expects this precompile address to be trustworthy. - if !>::get(source).is_empty() || precompiles.is_precompile(source) { + if is_transactional + && (!>::get(source).is_empty() || precompiles.is_precompile(source)) + { return Err(RunnerError { error: Error::::TransactionMustComeFromEOA, weight, diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 7219ec62..b587a7af 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -39,6 +39,7 @@ std = [ 'pallet-transaction-payment/std', 'frame-system-rpc-runtime-api/std', 'pallet-transaction-payment-rpc-runtime-api/std', + "fp-account/std", "fp-evm/std", 'fp-rpc/std', 'fp-self-contained/std', @@ -125,6 +126,7 @@ pallet-session = { workspace = true } sp-application-crypto = { workspace = true } sp-staking = { workspace = true } # Frontier +fp-account = { workspace = true } fp-evm = { workspace = true } fp-rpc = { workspace = true } fp-self-contained = { workspace = true } diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 1837d88c..1a373082 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -4,6 +4,7 @@ // `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256. #![recursion_limit = "256"] #![allow(clippy::new_without_default, clippy::or_fun_call)] +#![cfg_attr(feature = "runtime-benchmarks", deny(unused_crate_dependencies))] // Make the WASM binary available. #[cfg(feature = "std")] @@ -574,6 +575,7 @@ impl pallet_collective::Config for Runtime { type MaxMembers = CouncilMaxMembers; type DefaultVote = pallet_collective::PrimeDefaultVote; type WeightInfo = pallet_collective::weights::SubstrateWeight; + type SetMembersOrigin = EnsureRootOrHalfTechCommittee; } impl pallet_root_controller::Config for Runtime { diff --git a/stability-rpc/src/lib.rs b/stability-rpc/src/lib.rs index decbc69a..ba64c341 100644 --- a/stability-rpc/src/lib.rs +++ b/stability-rpc/src/lib.rs @@ -74,9 +74,9 @@ where at: Option<::Hash>, ) -> RpcResult>> { let api = self.client.runtime_api(); - let at = BlockId::hash(at.unwrap_or_else(|| self.client.info().best_hash)); + let at = at.unwrap_or_else(|| self.client.info().best_hash); let value = api - .get_supported_tokens(&at) + .get_supported_tokens(at) .map_err(runtime_error_into_rpc_err); Ok(StabilityOutput { code: 200, @@ -89,9 +89,9 @@ where at: Option<::Hash>, ) -> RpcResult>> { let api = self.client.runtime_api(); - let at = BlockId::hash(at.unwrap_or_else(|| self.client.info().best_hash)); + let at = at.unwrap_or_else(|| self.client.info().best_hash); let value = api - .get_validator_list(&at) + .get_validator_list(at) .map_err(runtime_error_into_rpc_err); Ok(StabilityOutput { code: 200, @@ -105,7 +105,7 @@ where meta_trx_sponsor: H160, meta_trx_sponsor_signature: Bytes, ) -> RpcResult { - let block_hash = BlockId::hash(self.client.info().best_hash); + let block_hash = self.client.info().best_hash; let slice = &transaction.0[..]; if slice.is_empty() { @@ -122,7 +122,7 @@ where .client .runtime_api() .convert_sponsored_transaction( - &block_hash, + block_hash, transaction.clone(), meta_trx_sponsor, meta_trx_sponsor_signature.to_vec(), @@ -132,7 +132,7 @@ where let transaction_hash = transaction.hash(); self.pool - .submit_one(&block_hash, TransactionSource::Local, extrinsic) + .submit_one(&BlockId::Hash(block_hash), TransactionSource::Local, extrinsic) .map_ok(move |_| transaction_hash) .map_err(|e| { error::Error::Custom(format!("Unable to submit transaction: {:?}", e).into()) diff --git a/test-utils/stability-runtime/Cargo.toml b/test-utils/stability-runtime/Cargo.toml index 185ee62a..b5cecda9 100644 --- a/test-utils/stability-runtime/Cargo.toml +++ b/test-utils/stability-runtime/Cargo.toml @@ -13,7 +13,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] beefy-primitives = { workspace = true, package = "sp-beefy" } -beefy-merkle-tree = { workspace = true } +pallet-beefy-mmr = { workspace = true } sp-application-crypto = { workspace = true } sp-consensus-aura = { workspace = true } sp-consensus-babe = { workspace = true } @@ -70,7 +70,7 @@ default = [ ] std = [ "beefy-primitives/std", - "beefy-merkle-tree/std", + "pallet-beefy-mmr/std", "sp-application-crypto/std", "sp-consensus-aura/std", "sp-consensus-babe/std", diff --git a/test-utils/stability-runtime/src/lib.rs b/test-utils/stability-runtime/src/lib.rs index 9de037ce..a25a4da5 100644 --- a/test-utils/stability-runtime/src/lib.rs +++ b/test-utils/stability-runtime/src/lib.rs @@ -317,7 +317,7 @@ pub fn run_tests(mut input: &[u8]) -> Vec { } /// A type that can not be decoded. -#[derive(PartialEq)] +#[derive(PartialEq, TypeInfo)] pub struct DecodeFails { _phantom: PhantomData, } @@ -1003,12 +1003,31 @@ cfg_if! { } impl beefy_primitives::BeefyApi for Runtime { + fn beefy_genesis() -> Option { + None + } + fn validator_set() -> Option> { None } + + fn submit_report_equivocation_unsigned_extrinsic( + _equivocation_proof: beefy_primitives::EquivocationProof< + NumberFor, + beefy_primitives::crypto::AuthorityId, + beefy_primitives::crypto::Signature + >, + _key_owner_proof: beefy_primitives::OpaqueKeyOwnershipProof, + ) -> Option<()> { None } + + fn generate_key_ownership_proof( + _set_id: beefy_primitives::ValidatorSetId, + _authority_id: beefy_primitives::crypto::AuthorityId, + ) -> Option { None } + } - impl beefy_merkle_tree::BeefyMmrApi for Runtime { + impl pallet_beefy_mmr::BeefyMmrApi for Runtime { fn authority_set_proof() -> beefy_primitives::mmr::BeefyAuthoritySet { Default::default() } @@ -1400,7 +1419,7 @@ mod tests { use sc_block_builder::BlockBuilderProvider; use sp_api::ProvideRuntimeApi; use sp_consensus::BlockOrigin; - use sp_core::storage::well_known_keys::HEAP_PAGES; + use sp_core::{storage::well_known_keys::HEAP_PAGES, ExecutionContext}; use sp_runtime::generic::BlockId; use sp_state_machine::ExecutionStrategy; use stability_test_runtime_client::{ @@ -1416,23 +1435,28 @@ mod tests { .set_execution_strategy(ExecutionStrategy::AlwaysWasm) .set_heap_pages(8) .build(); - let block_id = BlockId::Hash(client.chain_info().best_hash); + let best_hash = client.chain_info().best_hash; // Try to allocate 1024k of memory on heap. This is going to fail since it is twice larger // than the heap. - let ret = client.runtime_api().vec_with_capacity(&block_id, 1048576); + let ret = client.runtime_api().vec_with_capacity_with_context( + best_hash, + // Use `BlockImport` to ensure we use the on chain heap pages as configured above. + ExecutionContext::Importing, + 1048576, + ); assert!(ret.is_err()); // Create a block that sets the `:heap_pages` to 32 pages of memory which corresponds to // ~2048k of heap memory. - let (new_block_id, block) = { + let (new_at_hash, block) = { let mut builder = client.new_block(Default::default()).unwrap(); builder .push_storage_change(HEAP_PAGES.to_vec(), Some(32u64.encode())) .unwrap(); let block = builder.build().unwrap().block; let hash = block.header.hash(); - (BlockId::Hash(hash), block) + (hash, block) }; futures::executor::block_on(client.import(BlockOrigin::Own, block)).unwrap(); @@ -1440,7 +1464,7 @@ mod tests { // Allocation of 1024k while having ~2048k should succeed. let ret = client .runtime_api() - .vec_with_capacity(&new_block_id, 1048576); + .vec_with_capacity(new_at_hash, 1048576); assert!(ret.is_ok()); } @@ -1450,9 +1474,9 @@ mod tests { .set_execution_strategy(ExecutionStrategy::Both) .build(); let runtime_api = client.runtime_api(); - let block_id = BlockId::Hash(client.chain_info().best_hash); + let best_hash = client.chain_info().best_hash; - runtime_api.test_storage(&block_id).unwrap(); + runtime_api.test_storage(best_hash).unwrap(); } fn witness_backend() -> (sp_trie::MemoryDB, crate::Hash) { @@ -1478,8 +1502,8 @@ mod tests { .set_execution_strategy(ExecutionStrategy::Both) .build(); let runtime_api = client.runtime_api(); - let block_id = BlockId::Hash(client.chain_info().best_hash); + let best_hash = client.chain_info().best_hash; - runtime_api.test_witness(&block_id, proof, root).unwrap(); + runtime_api.test_witness(best_hash, proof, root).unwrap(); } } diff --git a/test-utils/stability-runtime/src/system.rs b/test-utils/stability-runtime/src/system.rs index 972ce8c8..7b0255d5 100644 --- a/test-utils/stability-runtime/src/system.rs +++ b/test-utils/stability-runtime/src/system.rs @@ -380,7 +380,7 @@ mod tests { use sc_executor::{NativeElseWasmExecutor, WasmExecutionMethod}; use sp_core::{ map, - traits::{CodeExecutor, RuntimeCode}, + traits::{CallContext, CodeExecutor, RuntimeCode}, }; use sp_io::{hashing::twox_128, TestExternalities}; use stability_test_runtime_client::{AccountKeyring, Sr25519Keyring}; @@ -473,6 +473,7 @@ mod tests { "Core_execute_block", &b.encode(), false, + CallContext::Offchain, ) .0 .unwrap(); @@ -581,6 +582,7 @@ mod tests { "Core_execute_block", &b.encode(), false, + CallContext::Offchain, ) .0 .unwrap(); From c54a221adcad59f872200dfd959fd23b7e3e90df Mon Sep 17 00:00:00 2001 From: GabrielMartinezRodriguez Date: Mon, 23 Oct 2023 18:21:19 +0200 Subject: [PATCH 04/37] chore: polkadot 0.9.40 --- Cargo.lock | 1114 ++++++++++++----- Cargo.toml | 228 ++-- node/Cargo.toml | 6 +- node/src/chain_spec/mod.rs | 6 +- node/src/client.rs | 4 +- node/src/command.rs | 62 +- node/src/eth.rs | 110 +- node/src/rpc/eth.rs | 38 +- node/src/rpc/mod.rs | 28 +- node/src/service.rs | 140 ++- .../fee-rewards-vault-controller/src/lib.rs | 14 +- .../fee-rewards-vault-controller/src/tests.rs | 56 +- .../fee-token-selector/src/lib.rs | 8 +- .../fee-token-selector/src/tests.rs | 2 +- .../supported-tokens-manager/src/lib.rs | 12 +- .../supported-tokens-manager/src/mock.rs | 1 + .../supported-tokens-manager/src/tests.rs | 47 +- .../validator-fee-selector/src/lib.rs | 14 +- .../validator-fee-selector/src/tests.rs | 45 +- .../upgrade-runtime-controller/src/lib.rs | 10 +- .../upgrade-runtime-controller/src/tests.rs | 24 +- precompiles/utils/Cargo.toml | 45 +- precompiles/utils/macro/Cargo.toml | 8 +- .../utils/macro/docs/precompile_macro.md | 8 +- precompiles/utils/macro/src/derive_codec.rs | 130 ++ .../macro/src/generate_function_selector.rs | 17 +- precompiles/utils/macro/src/lib.rs | 53 +- .../utils/macro/src/precompile/attr.rs | 11 +- .../utils/macro/src/precompile/expand.rs | 71 +- precompiles/utils/macro/src/precompile/mod.rs | 13 +- .../utils/macro/src/precompile/parse.rs | 106 +- .../macro/src/precompile_name_from_address.rs | 15 +- .../compile-fail/derive_codec/empty_struct.rs | 28 + .../derive_codec/empty_struct.stderr | 17 + .../tests/compile-fail/derive_codec/enum.rs | 26 + .../compile-fail/derive_codec/enum.stderr | 5 + .../precompile/codec/arg-dont-impl-codec.rs} | 13 +- .../codec/arg-dont-impl-codec.stderr} | 48 +- .../precompile/codec}/no-output.rs | 13 +- .../precompile/codec/no-output.stderr | 5 + .../codec/output-dont-impl-codec.rs} | 13 +- .../codec/output-dont-impl-codec.stderr} | 18 +- .../precompile/codec}/output-not-result.rs | 13 +- .../codec}/output-not-result.stderr | 4 +- .../codec}/output-wrong-error-result.rs | 13 +- .../codec}/output-wrong-error-result.stderr | 8 +- .../discriminant/dont-return-option.rs | 13 +- .../discriminant/dont-return-option.stderr | 4 +- .../precompile}/discriminant/missing-fn.rs | 13 +- .../discriminant/missing-fn.stderr | 4 +- .../precompile}/discriminant/missing-param.rs | 13 +- .../discriminant/missing-param.stderr | 5 + .../discriminant/return-incomplete-option.rs | 13 +- .../return-incomplete-option.stderr | 5 + .../discriminant/too-many-arguments.rs | 13 +- .../discriminant/too-many-arguments.stderr | 5 + .../discriminant/type-mismatch-1.rs | 13 +- .../discriminant/type-mismatch-1.stderr | 5 + .../discriminant/type-mismatch-2.rs | 13 +- .../discriminant/type-mismatch-2.stderr | 5 + .../fn-modifiers/discriminant-multiple.rs | 13 +- .../fn-modifiers/discriminant-multiple.stderr | 4 +- .../fn-modifiers/multiple-modifiers.rs | 13 +- .../fn-modifiers/multiple-modifiers.stderr | 4 +- .../fn-modifiers/pre-check-multiple.rs | 13 +- .../fn-modifiers/pre-check-multiple.stderr | 4 +- .../precompile}/handle/missing.rs | 13 +- .../precompile/handle/missing.stderr | 5 + .../precompile}/handle/set-missing.rs | 13 +- .../precompile}/handle/set-missing.stderr | 6 +- .../precompile}/handle/set-wrong-type.rs | 13 +- .../precompile}/handle/set-wrong-type.stderr | 4 +- .../precompile}/handle/wrong-type.rs | 13 +- .../precompile}/handle/wrong-type.stderr | 4 +- .../precompile}/pre-check/no-parameter.rs | 13 +- .../precompile/pre-check/no-parameter.stderr | 5 + .../pre-check/too-many-parameters.rs | 13 +- .../pre-check/too-many-parameters.stderr | 5 + .../precompile}/pre-check/wrong-parameter.rs | 13 +- .../pre-check/wrong-parameter.stderr | 5 + .../precompile/test-gen}/generic-arg.rs | 13 +- .../precompile/test-gen/generic-arg.stderr | 11 + .../compile-fail/precompile_name/not_tuple.rs | 22 + .../precompile_name/not_tuple.stderr | 5 + .../expand/precompile.expanded.rs | 158 +-- .../{precompile => }/expand/precompile.rs | 10 +- .../tests/expand/precompile_name.expanded.rs | 37 + .../macro/tests/expand/precompile_name.rs | 28 + .../expand/precompileset.expanded.rs | 750 ++++------- .../{precompile => }/expand/precompileset.rs | 10 +- .../tests/expand/returns_tuple.expanded.rs | 128 ++ .../utils/macro/tests/expand/returns_tuple.rs | 33 + .../utils/macro/tests/pass/derive_codec.rs | 79 ++ .../tests/pass/precompile_fn_modifiers.rs | 89 ++ precompiles/utils/macro/tests/precompile.rs | 26 - .../discriminant/missing-param.stderr | 5 - .../return-incomplete-option.stderr | 5 - .../discriminant/too-many-arguments.stderr | 5 - .../discriminant/type-mismatch-1.stderr | 5 - .../discriminant/type-mismatch-2.stderr | 5 - .../compile-fail/evm-data/no-output.stderr | 5 - .../compile-fail/handle/missing.stderr | 5 - .../pre-check/no-parameter.stderr | 5 - .../pre-check/too-many-parameters.stderr | 5 - .../pre-check/wrong-parameter.stderr | 5 - .../compile-fail/test/generic-arg.stderr | 8 - .../tests/precompile/pass/fn-modifiers.rs | 81 -- precompiles/utils/macro/tests/tests.rs | 44 +- precompiles/utils/src/{ => evm}/costs.rs | 11 +- precompiles/utils/src/evm/handle.rs | 199 +++ precompiles/utils/src/{ => evm}/logs.rs | 13 +- precompiles/utils/src/evm/mod.rs | 19 + precompiles/utils/src/handle.rs | 98 -- precompiles/utils/src/lib.rs | 109 +- precompiles/utils/src/precompile_set.rs | 916 +++++++++++--- .../src/{data => solidity/codec}/bytes.rs | 33 +- .../utils/src/{data => solidity/codec}/mod.rs | 280 ++--- .../src/{data => solidity/codec}/native.rs | 120 +- .../utils/src/{data => solidity/codec}/xcm.rs | 73 +- precompiles/utils/src/solidity/mod.rs | 26 + .../utils/src/{ => solidity}/modifier.rs | 13 +- .../utils/src/{ => solidity}/revert.rs | 42 +- precompiles/utils/src/substrate.rs | 17 +- precompiles/utils/src/testing/account.rs | 19 +- precompiles/utils/src/testing/execution.rs | 19 +- precompiles/utils/src/testing/handle.rs | 45 +- precompiles/utils/src/testing/mod.rs | 21 +- precompiles/utils/src/testing/modifier.rs | 17 +- precompiles/utils/src/testing/solidity.rs | 39 +- precompiles/utils/src/tests.rs | 334 +++-- precompiles/utils/tests-external/Cargo.toml | 30 + precompiles/utils/tests-external/lib.rs | 361 ++++++ precompiles/validator-controller/src/lib.rs | 19 +- precompiles/validator-controller/src/tests.rs | 36 +- primitives/runner/src/lib.rs | 53 +- runtime/src/lib.rs | 46 +- runtime/src/precompiles.rs | 20 +- test-utils/stability-client/src/client_ext.rs | 17 +- .../stability-runtime-client/Cargo.toml | 1 + .../stability-runtime-client/src/lib.rs | 20 +- test-utils/stability-runtime/Cargo.toml | 8 +- .../stability-runtime/src/genesismap.rs | 6 +- test-utils/stability-runtime/src/lib.rs | 53 +- 143 files changed, 4849 insertions(+), 2836 deletions(-) create mode 100644 precompiles/utils/macro/src/derive_codec.rs create mode 100644 precompiles/utils/macro/tests/compile-fail/derive_codec/empty_struct.rs create mode 100644 precompiles/utils/macro/tests/compile-fail/derive_codec/empty_struct.stderr create mode 100644 precompiles/utils/macro/tests/compile-fail/derive_codec/enum.rs create mode 100644 precompiles/utils/macro/tests/compile-fail/derive_codec/enum.stderr rename precompiles/utils/macro/tests/{precompile/compile-fail/evm-data/arg-dont-impl-evmdata.rs => compile-fail/precompile/codec/arg-dont-impl-codec.rs} (72%) rename precompiles/utils/macro/tests/{precompile/compile-fail/evm-data/arg-dont-impl-evmdata.stderr => compile-fail/precompile/codec/arg-dont-impl-codec.stderr} (59%) rename precompiles/utils/macro/tests/{precompile/compile-fail/evm-data => compile-fail/precompile/codec}/no-output.rs (69%) create mode 100644 precompiles/utils/macro/tests/compile-fail/precompile/codec/no-output.stderr rename precompiles/utils/macro/tests/{precompile/compile-fail/evm-data/output-dont-impl-evmdata.rs => compile-fail/precompile/codec/output-dont-impl-codec.rs} (71%) rename precompiles/utils/macro/tests/{precompile/compile-fail/evm-data/output-dont-impl-evmdata.stderr => compile-fail/precompile/codec/output-dont-impl-codec.stderr} (51%) rename precompiles/utils/macro/tests/{precompile/compile-fail/evm-data => compile-fail/precompile/codec}/output-not-result.rs (70%) rename precompiles/utils/macro/tests/{precompile/compile-fail/evm-data => compile-fail/precompile/codec}/output-not-result.stderr (66%) rename precompiles/utils/macro/tests/{precompile/compile-fail/evm-data => compile-fail/precompile/codec}/output-wrong-error-result.rs (71%) rename precompiles/utils/macro/tests/{precompile/compile-fail/evm-data => compile-fail/precompile/codec}/output-wrong-error-result.stderr (61%) rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/discriminant/dont-return-option.rs (73%) rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/discriminant/dont-return-option.stderr (50%) rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/discriminant/missing-fn.rs (71%) rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/discriminant/missing-fn.stderr (73%) rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/discriminant/missing-param.rs (73%) create mode 100644 precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-param.stderr rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/discriminant/return-incomplete-option.rs (73%) create mode 100644 precompiles/utils/macro/tests/compile-fail/precompile/discriminant/return-incomplete-option.stderr rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/discriminant/too-many-arguments.rs (74%) create mode 100644 precompiles/utils/macro/tests/compile-fail/precompile/discriminant/too-many-arguments.stderr rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/discriminant/type-mismatch-1.rs (73%) create mode 100644 precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-1.stderr rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/discriminant/type-mismatch-2.rs (73%) create mode 100644 precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-2.stderr rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/fn-modifiers/discriminant-multiple.rs (70%) rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/fn-modifiers/discriminant-multiple.stderr (52%) rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/fn-modifiers/multiple-modifiers.rs (71%) rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/fn-modifiers/multiple-modifiers.stderr (50%) rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/fn-modifiers/pre-check-multiple.rs (70%) rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/fn-modifiers/pre-check-multiple.stderr (52%) rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/handle/missing.rs (68%) create mode 100644 precompiles/utils/macro/tests/compile-fail/precompile/handle/missing.stderr rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/handle/set-missing.rs (69%) rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/handle/set-missing.stderr (53%) rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/handle/set-wrong-type.rs (70%) rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/handle/set-wrong-type.stderr (51%) rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/handle/wrong-type.rs (68%) rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/handle/wrong-type.stderr (51%) rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/pre-check/no-parameter.rs (71%) create mode 100644 precompiles/utils/macro/tests/compile-fail/precompile/pre-check/no-parameter.stderr rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/pre-check/too-many-parameters.rs (72%) create mode 100644 precompiles/utils/macro/tests/compile-fail/precompile/pre-check/too-many-parameters.stderr rename precompiles/utils/macro/tests/{precompile/compile-fail => compile-fail/precompile}/pre-check/wrong-parameter.rs (71%) create mode 100644 precompiles/utils/macro/tests/compile-fail/precompile/pre-check/wrong-parameter.stderr rename precompiles/utils/macro/tests/{precompile/compile-fail/test => compile-fail/precompile/test-gen}/generic-arg.rs (64%) create mode 100644 precompiles/utils/macro/tests/compile-fail/precompile/test-gen/generic-arg.stderr create mode 100644 precompiles/utils/macro/tests/compile-fail/precompile_name/not_tuple.rs create mode 100644 precompiles/utils/macro/tests/compile-fail/precompile_name/not_tuple.stderr rename precompiles/utils/macro/tests/{precompile => }/expand/precompile.expanded.rs (68%) rename precompiles/utils/macro/tests/{precompile => }/expand/precompile.rs (89%) create mode 100644 precompiles/utils/macro/tests/expand/precompile_name.expanded.rs create mode 100644 precompiles/utils/macro/tests/expand/precompile_name.rs rename precompiles/utils/macro/tests/{precompile => }/expand/precompileset.expanded.rs (59%) rename precompiles/utils/macro/tests/{precompile => }/expand/precompileset.rs (95%) create mode 100644 precompiles/utils/macro/tests/expand/returns_tuple.expanded.rs create mode 100644 precompiles/utils/macro/tests/expand/returns_tuple.rs create mode 100644 precompiles/utils/macro/tests/pass/derive_codec.rs create mode 100644 precompiles/utils/macro/tests/pass/precompile_fn_modifiers.rs delete mode 100644 precompiles/utils/macro/tests/precompile.rs delete mode 100644 precompiles/utils/macro/tests/precompile/compile-fail/discriminant/missing-param.stderr delete mode 100644 precompiles/utils/macro/tests/precompile/compile-fail/discriminant/return-incomplete-option.stderr delete mode 100644 precompiles/utils/macro/tests/precompile/compile-fail/discriminant/too-many-arguments.stderr delete mode 100644 precompiles/utils/macro/tests/precompile/compile-fail/discriminant/type-mismatch-1.stderr delete mode 100644 precompiles/utils/macro/tests/precompile/compile-fail/discriminant/type-mismatch-2.stderr delete mode 100644 precompiles/utils/macro/tests/precompile/compile-fail/evm-data/no-output.stderr delete mode 100644 precompiles/utils/macro/tests/precompile/compile-fail/handle/missing.stderr delete mode 100644 precompiles/utils/macro/tests/precompile/compile-fail/pre-check/no-parameter.stderr delete mode 100644 precompiles/utils/macro/tests/precompile/compile-fail/pre-check/too-many-parameters.stderr delete mode 100644 precompiles/utils/macro/tests/precompile/compile-fail/pre-check/wrong-parameter.stderr delete mode 100644 precompiles/utils/macro/tests/precompile/compile-fail/test/generic-arg.stderr delete mode 100644 precompiles/utils/macro/tests/precompile/pass/fn-modifiers.rs rename precompiles/utils/src/{ => evm}/costs.rs (91%) create mode 100644 precompiles/utils/src/evm/handle.rs rename precompiles/utils/src/{ => evm}/logs.rs (87%) create mode 100644 precompiles/utils/src/evm/mod.rs delete mode 100644 precompiles/utils/src/handle.rs rename precompiles/utils/src/{data => solidity/codec}/bytes.rs (86%) rename precompiles/utils/src/{data => solidity/codec}/mod.rs (53%) rename precompiles/utils/src/{data => solidity/codec}/native.rs (72%) rename precompiles/utils/src/{data => solidity/codec}/xcm.rs (86%) create mode 100644 precompiles/utils/src/solidity/mod.rs rename precompiles/utils/src/{ => solidity}/modifier.rs (81%) rename precompiles/utils/src/{ => solidity}/revert.rs (89%) create mode 100644 precompiles/utils/tests-external/Cargo.toml create mode 100644 precompiles/utils/tests-external/lib.rs diff --git a/Cargo.lock b/Cargo.lock index bd9e1e1a..88205979 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -208,6 +208,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -365,6 +371,17 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + [[package]] name = "async-io" version = "1.13.0" @@ -418,6 +435,15 @@ dependencies = [ "pin-project-lite 0.2.13", ] +[[package]] +name = "atoi" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" +dependencies = [ + "num-traits", +] + [[package]] name = "atomic-waker" version = "1.1.2" @@ -525,9 +551,9 @@ dependencies = [ [[package]] name = "binary-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ - "hash-db", + "hash-db 0.16.0", "log", ] @@ -571,6 +597,9 @@ name = "bitflags" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +dependencies = [ + "serde", +] [[package]] name = "bitvec" @@ -1222,7 +1251,7 @@ dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", - "itertools", + "itertools 0.10.5", "log", "smallvec", "wasmparser", @@ -1277,6 +1306,16 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.16" @@ -1519,7 +1558,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" dependencies = [ "const-oid", - "pem-rfc7468", + "pem-rfc7468 0.6.0", "zeroize", ] @@ -1530,6 +1569,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ "const-oid", + "pem-rfc7468 0.7.0", "zeroize", ] @@ -1673,6 +1713,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", + "const-oid", "crypto-common", "subtle", ] @@ -1729,6 +1770,12 @@ dependencies = [ "syn 2.0.38", ] +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + [[package]] name = "downcast" version = "0.11.0" @@ -1852,6 +1899,9 @@ name = "either" version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +dependencies = [ + "serde", +] [[package]] name = "elliptic-curve" @@ -1867,7 +1917,7 @@ dependencies = [ "generic-array 0.14.7", "group", "hkdf", - "pem-rfc7468", + "pem-rfc7468 0.6.0", "pkcs8 0.9.0", "rand_core 0.6.4", "sec1", @@ -1937,6 +1987,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "etcetera" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" +dependencies = [ + "cfg-if", + "home", + "windows-sys 0.48.0", +] + [[package]] name = "ethbloom" version = "0.13.0" @@ -1960,7 +2021,7 @@ checksum = "6a89fb87a9e103f71b903b80b670200b54cc67a07578f070681f1fffb7396fb7" dependencies = [ "bytes", "ethereum-types", - "hash-db", + "hash-db 0.15.2", "hash256-std-hasher", "parity-scale-codec", "rlp", @@ -1994,9 +2055,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "evm" -version = "0.37.0" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4448c65b71e8e2b9718232d84d09045eeaaccb2320494e6bd6dbf7e58fec8ff" +checksum = "a49a4e11987c51220aa89dbe1a5cc877f5079fa6864c0a5b4533331db44e9365" dependencies = [ "auto_impl", "environmental", @@ -2015,9 +2076,9 @@ dependencies = [ [[package]] name = "evm-core" -version = "0.37.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c51bec0eb68a891c2575c758eaaa1d61373fc51f7caaf216b1fb5c3fea3b5d" +checksum = "4f1f13264b044cb66f0602180f0bc781c29accb41ff560669a3ec15858d5b606" dependencies = [ "parity-scale-codec", "primitive-types", @@ -2027,9 +2088,9 @@ dependencies = [ [[package]] name = "evm-gasometer" -version = "0.37.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8b93c59c54fc26522d842f0e0d3f8e8be331c776df18ff3e540b53c2f64d509" +checksum = "8d43eadc395bd1a52990787ca1495c26b0248165444912be075c28909a853b8c" dependencies = [ "environmental", "evm-core", @@ -2039,9 +2100,9 @@ dependencies = [ [[package]] name = "evm-runtime" -version = "0.37.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79b9459ce64f1a28688397c4013764ce53cd57bb84efc16b5187fa9b05b13ad" +checksum = "2aa5b32f59ec582a5651978004e5c784920291263b7dcb6de418047438e37f4f" dependencies = [ "auto_impl", "environmental", @@ -2059,6 +2120,19 @@ dependencies = [ "futures", ] +[[package]] +name = "expander" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f360349150728553f92e4c997a16af8915f418d3a0f21b440d34c5632f16ed84" +dependencies = [ + "blake2", + "fs-err", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "fake-simd" version = "0.1.2" @@ -2095,7 +2169,7 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fc-cli" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "clap", "ethereum-types", @@ -2113,16 +2187,14 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "async-trait", - "fc-db", "fp-consensus", "fp-rpc", "sc-consensus", "sp-api", "sp-block-builder", - "sp-blockchain", "sp-consensus", "sp-runtime", "thiserror", @@ -2131,26 +2203,37 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ + "async-trait", + "ethereum", + "fc-storage", + "fp-consensus", + "fp-rpc", "fp-storage", + "futures", "kvdb-rocksdb", "log", "parity-db", "parity-scale-codec", "parking_lot 0.12.1", + "sc-client-api", "sc-client-db", "smallvec", + "sp-api", "sp-blockchain", "sp-core", "sp-database", "sp-runtime", + "sp-storage", + "sqlx", + "tokio", ] [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "fc-db", "fc-storage", @@ -2159,24 +2242,31 @@ dependencies = [ "futures", "futures-timer", "log", + "parking_lot 0.12.1", "sc-client-api", + "sc-utils", "sp-api", "sp-blockchain", + "sp-consensus", + "sp-core", "sp-runtime", + "tokio", ] [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "ethereum", "ethereum-types", "evm", "fc-db", + "fc-mapping-sync", "fc-rpc-core", "fc-storage", "fp-ethereum", + "fp-evm", "fp-rpc", "fp-storage", "futures", @@ -2185,6 +2275,7 @@ dependencies = [ "libsecp256k1", "log", "lru", + "pallet-evm", "parity-scale-codec", "prometheus", "rand 0.8.5", @@ -2192,10 +2283,12 @@ dependencies = [ "sc-client-api", "sc-network", "sc-network-common", + "sc-network-sync", "sc-rpc", "sc-service", "sc-transaction-pool", "sc-transaction-pool-api", + "sc-utils", "sp-api", "sp-block-builder", "sp-blockchain", @@ -2203,6 +2296,8 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", + "sp-state-machine", + "sp-storage", "substrate-prometheus-endpoint", "tokio", ] @@ -2210,7 +2305,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "ethereum", "ethereum-types", @@ -2223,7 +2318,7 @@ dependencies = [ [[package]] name = "fc-storage" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "ethereum", "ethereum-types", @@ -2301,6 +2396,12 @@ dependencies = [ "scale-info", ] +[[package]] +name = "finl_unicode" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" + [[package]] name = "fixed-hash" version = "0.8.0" @@ -2339,6 +2440,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "flume" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +dependencies = [ + "futures-core", + "futures-sink", + "spin 0.9.8", +] + [[package]] name = "fnv" version = "1.0.7" @@ -2363,7 +2475,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", ] @@ -2380,7 +2492,7 @@ dependencies = [ [[package]] name = "fp-account" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "hex", "impl-serde", @@ -2398,7 +2510,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "ethereum", "parity-scale-codec", @@ -2410,7 +2522,7 @@ dependencies = [ [[package]] name = "fp-ethereum" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "ethereum", "ethereum-types", @@ -2424,7 +2536,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "evm", "frame-support", @@ -2438,7 +2550,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "ethereum", "ethereum-types", @@ -2448,13 +2560,14 @@ dependencies = [ "sp-api", "sp-core", "sp-runtime", + "sp-state-machine", "sp-std", ] [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "frame-support", "parity-scale-codec", @@ -2466,7 +2579,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "parity-scale-codec", "serde", @@ -2481,7 +2594,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support", "frame-support-procedural", @@ -2506,7 +2619,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "Inflector", "array-bytes", @@ -2518,7 +2631,7 @@ dependencies = [ "frame-system", "gethostname", "handlebars", - "itertools", + "itertools 0.10.5", "lazy_static", "linked-hash-map", "log", @@ -2553,7 +2666,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support", "frame-system", @@ -2581,9 +2694,10 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "bitflags 1.3.2", + "environmental", "frame-metadata", "frame-support-procedural", "impl-trait-for-tuples", @@ -2613,13 +2727,13 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "Inflector", "cfg-expr", "derive-syn-parse", "frame-support-procedural-tools", - "itertools", + "itertools 0.10.5", "proc-macro2", "quote", "syn 1.0.109", @@ -2628,7 +2742,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2640,7 +2754,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "proc-macro2", "quote", @@ -2650,7 +2764,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support", "log", @@ -2668,7 +2782,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-benchmarking", "frame-support", @@ -2683,12 +2797,18 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "sp-api", ] +[[package]] +name = "fs-err" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" + [[package]] name = "fs2" version = "0.4.3" @@ -2699,6 +2819,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "fs4" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eeb4ed9e12f43b7fa0baae3f9cdda28352770132ef2e09a23760c29cae8bd47" +dependencies = [ + "rustix 0.38.19", + "windows-sys 0.48.0", +] + [[package]] name = "funty" version = "2.0.0" @@ -2748,6 +2878,17 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", + "parking_lot 0.12.1", +] + [[package]] name = "futures-io" version = "0.3.28" @@ -2993,6 +3134,12 @@ version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" +[[package]] +name = "hash-db" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" + [[package]] name = "hash256-std-hasher" version = "0.15.2" @@ -3025,12 +3172,28 @@ name = "hashbrown" version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" +dependencies = [ + "ahash 0.8.3", + "allocator-api2", +] + +[[package]] +name = "hashlink" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +dependencies = [ + "hashbrown 0.14.1", +] [[package]] name = "heck" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +dependencies = [ + "unicode-segmentation", +] [[package]] name = "hermit-abi" @@ -3465,6 +3628,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -4214,6 +4386,17 @@ dependencies = [ "libsecp256k1-core", ] +[[package]] +name = "libsqlite3-sys" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afc22eff61b133b115c6e8c74e818c628d6d5e7a502afea6f64dee076dd94326" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + [[package]] name = "libz-sys" version = "1.1.12" @@ -4428,15 +4611,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "memoffset" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.9.0" @@ -4448,12 +4622,11 @@ dependencies = [ [[package]] name = "memory-db" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e0c7cba9ce19ac7ffd2053ac9f49843bbd3f4318feedfd74e85c19d5fb0ba66" +checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" dependencies = [ - "hash-db", - "hashbrown 0.12.3", + "hash-db 0.16.0", ] [[package]] @@ -4775,19 +4948,6 @@ dependencies = [ "memoffset 0.6.5", ] -[[package]] -name = "nix" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", - "memoffset 0.7.1", - "pin-utils", -] - [[package]] name = "nodrop" version = "0.1.14" @@ -4841,6 +5001,23 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand 0.8.5", + "smallvec", + "zeroize", +] + [[package]] name = "num-complex" version = "0.4.4" @@ -4900,6 +5077,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -5065,7 +5243,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support", "frame-system", @@ -5081,7 +5259,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support", "frame-system", @@ -5095,7 +5273,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5119,7 +5297,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5134,7 +5312,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "fp-evm", "frame-support", @@ -5148,7 +5326,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support", "frame-system", @@ -5157,7 +5335,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-beefy", + "sp-consensus-beefy", "sp-runtime", "sp-session", "sp-staking", @@ -5167,7 +5345,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", "binary-merkle-tree", @@ -5181,7 +5359,7 @@ dependencies = [ "scale-info", "serde", "sp-api", - "sp-beefy", + "sp-consensus-beefy", "sp-core", "sp-io", "sp-runtime", @@ -5191,7 +5369,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5278,7 +5456,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "ethereum", "ethereum-types", @@ -5291,7 +5469,6 @@ dependencies = [ "frame-support", "frame-system", "pallet-evm", - "pallet-timestamp", "parity-scale-codec", "scale-info", "sp-io", @@ -5302,7 +5479,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "environmental", "evm", @@ -5312,9 +5489,9 @@ dependencies = [ "frame-support", "frame-system", "hex", + "hex-literal", "impl-trait-for-tuples", "log", - "pallet-timestamp", "parity-scale-codec", "rlp", "scale-info", @@ -5327,7 +5504,7 @@ dependencies = [ [[package]] name = "pallet-evm-chain-id" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "frame-support", "frame-system", @@ -5338,7 +5515,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-blake2" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "fp-evm", ] @@ -5346,7 +5523,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-bn128" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "fp-evm", "sp-core", @@ -5356,7 +5533,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "fp-evm", "num", @@ -5365,7 +5542,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-sha3fips" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "fp-evm", "tiny-keccak", @@ -5374,7 +5551,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "fp-evm", "ripemd", @@ -5400,7 +5577,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5411,8 +5588,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-application-crypto", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-io", "sp-runtime", "sp-session", @@ -5423,7 +5600,7 @@ dependencies = [ [[package]] name = "pallet-hotfix-sufficients" version = "1.0.0" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.39#3297c466619934d462e0b845c1ab1e81906dcb18" +source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" dependencies = [ "frame-benchmarking", "frame-support", @@ -5439,7 +5616,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5470,7 +5647,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support", "frame-system", @@ -5521,7 +5698,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support", "frame-system", @@ -5551,7 +5728,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5569,7 +5746,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support", "frame-system", @@ -5585,7 +5762,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5601,7 +5778,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5906,6 +6083,15 @@ dependencies = [ "base64ct", ] +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" version = "2.3.0" @@ -6005,6 +6191,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs1" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" +dependencies = [ + "der 0.7.8", + "pkcs8 0.10.2", + "spki 0.7.2", +] + [[package]] name = "pkcs8" version = "0.9.0" @@ -6231,6 +6428,7 @@ version = "0.1.0" dependencies = [ "affix", "derive_more", + "environmental", "evm", "fp-evm", "frame-support", @@ -6246,7 +6444,7 @@ dependencies = [ "precompile-utils-macro", "scale-info", "serde", - "sha3 0.10.8", + "sha3 0.9.1", "similar-asserts", "sp-core", "sp-io", @@ -6341,7 +6539,7 @@ checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" dependencies = [ "difflib", "float-cmp", - "itertools", + "itertools 0.10.5", "normalize-line-endings", "predicates-core", "regex", @@ -6485,7 +6683,7 @@ checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" dependencies = [ "bytes", "heck", - "itertools", + "itertools 0.10.5", "lazy_static", "log", "multimap", @@ -6519,7 +6717,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" dependencies = [ "anyhow", - "itertools", + "itertools 0.10.5", "proc-macro2", "quote", "syn 1.0.109", @@ -6999,6 +7197,28 @@ dependencies = [ "winapi", ] +[[package]] +name = "rsa" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ab43bb47d23c1a631b4b680199a45255dce26fa9ab2fa902581f624ff13e6a8" +dependencies = [ + "byteorder", + "const-oid", + "digest 0.10.7", + "num-bigint-dig", + "num-integer", + "num-iter", + "num-traits", + "pkcs1", + "pkcs8 0.10.2", + "rand_core 0.6.4", + "signature 2.1.0", + "spki 0.7.2", + "subtle", + "zeroize", +] + [[package]] name = "rtcp" version = "0.7.2" @@ -7020,7 +7240,7 @@ dependencies = [ "log", "netlink-packet-route", "netlink-proto", - "nix 0.24.3", + "nix", "thiserror", "tokio", ] @@ -7245,7 +7465,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "log", "sp-core", @@ -7256,7 +7476,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -7266,28 +7486,31 @@ dependencies = [ "sp-core", "sp-inherents", "sp-runtime", - "sp-state-machine", ] [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "memmap2", "sc-chain-spec-derive", - "sc-network-common", + "sc-client-api", + "sc-executor", + "sc-network", "sc-telemetry", "serde", "serde_json", + "sp-blockchain", "sp-core", "sp-runtime", + "sp-state-machine", ] [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -7298,7 +7521,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", "chrono", @@ -7338,7 +7561,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "fnv", "futures", @@ -7364,9 +7587,9 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ - "hash-db", + "hash-db 0.16.0", "kvdb", "kvdb-memorydb", "kvdb-rocksdb", @@ -7390,7 +7613,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "futures", @@ -7415,7 +7638,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "futures", @@ -7444,7 +7667,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "fork-tree", @@ -7483,7 +7706,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "fork-tree", "parity-scale-codec", @@ -7494,26 +7717,66 @@ dependencies = [ ] [[package]] -name = "sc-consensus-manual-seal" +name = "sc-consensus-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ - "assert_matches", + "ahash 0.8.3", + "array-bytes", "async-trait", + "dyn-clone", + "finality-grandpa", + "fork-tree", "futures", - "jsonrpsee", + "futures-timer", "log", "parity-scale-codec", + "parking_lot 0.12.1", + "rand 0.8.5", + "sc-block-builder", + "sc-chain-spec", "sc-client-api", "sc-consensus", - "sc-consensus-aura", - "sc-consensus-babe", - "sc-consensus-epochs", - "sc-transaction-pool", - "sc-transaction-pool-api", - "serde", - "sp-api", - "sp-blockchain", + "sc-network", + "sc-network-common", + "sc-network-gossip", + "sc-telemetry", + "sc-utils", + "serde_json", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-grandpa", + "sp-core", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-consensus-manual-seal" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +dependencies = [ + "assert_matches", + "async-trait", + "futures", + "jsonrpsee", + "log", + "parity-scale-codec", + "sc-client-api", + "sc-consensus", + "sc-consensus-aura", + "sc-consensus-babe", + "sc-consensus-epochs", + "sc-transaction-pool", + "sc-transaction-pool-api", + "serde", + "sp-api", + "sp-blockchain", "sp-consensus", "sp-consensus-aura", "sp-consensus-babe", @@ -7530,7 +7793,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "futures", @@ -7553,7 +7816,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "lru", "parity-scale-codec", @@ -7577,7 +7840,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -7590,7 +7853,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "log", "sc-allocator", @@ -7603,7 +7866,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "anyhow", "cfg-if", @@ -7618,56 +7881,17 @@ dependencies = [ "wasmtime", ] -[[package]] -name = "sc-finality-grandpa" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" -dependencies = [ - "ahash 0.8.3", - "array-bytes", - "async-trait", - "dyn-clone", - "finality-grandpa", - "fork-tree", - "futures", - "futures-timer", - "log", - "parity-scale-codec", - "parking_lot 0.12.1", - "rand 0.8.5", - "sc-block-builder", - "sc-chain-spec", - "sc-client-api", - "sc-consensus", - "sc-network", - "sc-network-common", - "sc-network-gossip", - "sc-telemetry", - "sc-utils", - "serde_json", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-finality-grandpa", - "sp-keystore", - "sp-runtime", - "substrate-prometheus-endpoint", - "thiserror", -] - [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "ansi_term", "futures", "futures-timer", "log", "sc-client-api", + "sc-network", "sc-network-common", "sp-blockchain", "sp-runtime", @@ -7676,7 +7900,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", "async-trait", @@ -7691,12 +7915,12 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", + "async-channel", "async-trait", "asynchronous-codec", - "backtrace", "bytes", "either", "fnv", @@ -7704,6 +7928,7 @@ dependencies = [ "futures-timer", "ip_network", "libp2p", + "linked_hash_set", "log", "lru", "mockall", @@ -7734,7 +7959,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "cid", "futures", @@ -7743,6 +7968,7 @@ dependencies = [ "prost", "prost-build", "sc-client-api", + "sc-network", "sc-network-common", "sp-blockchain", "sp-runtime", @@ -7753,33 +7979,35 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ + "array-bytes", "async-trait", "bitflags 1.3.2", "bytes", "futures", "futures-timer", "libp2p", - "linked_hash_set", "parity-scale-codec", "prost-build", "sc-consensus", "sc-peerset", + "sc-utils", "serde", "smallvec", "sp-blockchain", "sp-consensus", - "sp-finality-grandpa", + "sp-consensus-grandpa", "sp-runtime", "substrate-prometheus-endpoint", "thiserror", + "zeroize", ] [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "ahash 0.8.3", "futures", @@ -7787,6 +8015,7 @@ dependencies = [ "libp2p", "log", "lru", + "sc-network", "sc-network-common", "sc-peerset", "sp-runtime", @@ -7797,7 +8026,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", "futures", @@ -7807,6 +8036,7 @@ dependencies = [ "prost", "prost-build", "sc-client-api", + "sc-network", "sc-network-common", "sc-peerset", "sp-blockchain", @@ -7818,12 +8048,13 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", "async-trait", "fork-tree", "futures", + "futures-timer", "libp2p", "log", "lru", @@ -7833,6 +8064,7 @@ dependencies = [ "prost-build", "sc-client-api", "sc-consensus", + "sc-network", "sc-network-common", "sc-peerset", "sc-utils", @@ -7840,8 +8072,8 @@ dependencies = [ "sp-arithmetic", "sp-blockchain", "sp-consensus", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-runtime", "substrate-prometheus-endpoint", "thiserror", @@ -7850,7 +8082,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", "futures", @@ -7858,6 +8090,7 @@ dependencies = [ "log", "parity-scale-codec", "pin-project", + "sc-network", "sc-network-common", "sc-peerset", "sc-utils", @@ -7869,7 +8102,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", "bytes", @@ -7885,6 +8118,7 @@ dependencies = [ "parking_lot 0.12.1", "rand 0.8.5", "sc-client-api", + "sc-network", "sc-network-common", "sc-peerset", "sc-utils", @@ -7899,7 +8133,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "futures", "libp2p", @@ -7912,7 +8146,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -7921,7 +8155,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "futures", "jsonrpsee", @@ -7951,7 +8185,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -7970,7 +8204,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "http", "jsonrpsee", @@ -7985,7 +8219,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", "futures", @@ -8011,7 +8245,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "directories", @@ -8077,7 +8311,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "log", "parity-scale-codec", @@ -8088,12 +8322,12 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "clap", + "fs4", "futures", "log", - "nix 0.26.4", "sc-client-db", "sc-utils", "sp-core", @@ -8104,7 +8338,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "futures", "libc", @@ -8123,7 +8357,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "chrono", "futures", @@ -8142,7 +8376,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "ansi_term", "atty", @@ -8173,7 +8407,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8184,7 +8418,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "futures", @@ -8211,7 +8445,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "futures", @@ -8225,15 +8459,16 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ - "backtrace", + "async-channel", "futures", "futures-timer", "lazy_static", "log", "parking_lot 0.12.1", "prometheus", + "sp-arithmetic", ] [[package]] @@ -8596,6 +8831,10 @@ name = "signature" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] [[package]] name = "simba" @@ -8732,9 +8971,9 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ - "hash-db", + "hash-db 0.16.0", "log", "parity-scale-codec", "sp-api-proc-macro", @@ -8750,9 +8989,11 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ + "Inflector", "blake2", + "expander", "proc-macro-crate", "proc-macro2", "quote", @@ -8762,7 +9003,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "scale-info", @@ -8775,7 +9016,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "integer-sqrt", "num-traits", @@ -8786,29 +9027,10 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "sp-beefy" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" -dependencies = [ - "lazy_static", - "parity-scale-codec", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-io", - "sp-mmr-primitives", - "sp-runtime", - "sp-std", - "strum", -] - [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "sp-api", @@ -8820,7 +9042,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "futures", "log", @@ -8838,25 +9060,22 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "futures", "log", - "parity-scale-codec", "sp-core", "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-std", - "sp-version", "thiserror", ] [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "parity-scale-codec", @@ -8874,7 +9093,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "merlin", @@ -8894,10 +9113,47 @@ dependencies = [ "sp-timestamp", ] +[[package]] +name = "sp-consensus-beefy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +dependencies = [ + "lazy_static", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-io", + "sp-mmr-primitives", + "sp-runtime", + "sp-std", + "strum", +] + +[[package]] +name = "sp-consensus-grandpa" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +dependencies = [ + "finality-grandpa", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "sp-runtime", + "sp-std", +] + [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "scale-info", @@ -8909,7 +9165,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "scale-info", @@ -8922,7 +9178,7 @@ dependencies = [ [[package]] name = "sp-core" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", "base58", @@ -8932,7 +9188,7 @@ dependencies = [ "dyn-clonable", "ed25519-zebra", "futures", - "hash-db", + "hash-db 0.16.0", "hash256-std-hasher", "impl-serde", "lazy_static", @@ -8965,9 +9221,9 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ - "blake2", + "blake2b_simd", "byteorder", "digest 0.10.7", "sha2 0.10.8", @@ -8979,7 +9235,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "proc-macro2", "quote", @@ -8990,7 +9246,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -8999,7 +9255,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "proc-macro2", "quote", @@ -9009,7 +9265,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "environmental", "parity-scale-codec", @@ -9017,28 +9273,10 @@ dependencies = [ "sp-storage", ] -[[package]] -name = "sp-finality-grandpa" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" -dependencies = [ - "finality-grandpa", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "sp-runtime", - "sp-std", -] - [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -9053,7 +9291,7 @@ dependencies = [ [[package]] name = "sp-io" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "bytes", "ed25519 1.5.3", @@ -9078,7 +9316,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "lazy_static", "sp-core", @@ -9089,7 +9327,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "futures", @@ -9106,7 +9344,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "thiserror", "zstd", @@ -9115,7 +9353,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -9133,7 +9371,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "sp-api", "sp-core", @@ -9143,7 +9381,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "backtrace", "lazy_static", @@ -9153,7 +9391,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "rustc-hash", "serde", @@ -9163,7 +9401,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "either", "hash256-std-hasher", @@ -9185,7 +9423,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -9203,7 +9441,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "Inflector", "proc-macro-crate", @@ -9215,7 +9453,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "scale-info", @@ -9229,7 +9467,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "scale-info", @@ -9241,9 +9479,9 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ - "hash-db", + "hash-db 0.16.0", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -9261,12 +9499,12 @@ dependencies = [ [[package]] name = "sp-std" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" [[package]] name = "sp-storage" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9279,7 +9517,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "futures-timer", @@ -9294,7 +9532,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "sp-std", @@ -9306,7 +9544,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "sp-api", "sp-runtime", @@ -9315,7 +9553,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "log", @@ -9331,10 +9569,10 @@ dependencies = [ [[package]] name = "sp-trie" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "ahash 0.8.3", - "hash-db", + "hash-db 0.16.0", "hashbrown 0.12.3", "lazy_static", "memory-db", @@ -9354,7 +9592,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9371,7 +9609,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -9382,7 +9620,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -9396,7 +9634,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "scale-info", @@ -9419,6 +9657,9 @@ name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] [[package]] name = "spki" @@ -9440,6 +9681,212 @@ dependencies = [ "der 0.7.8", ] +[[package]] +name = "sqlformat" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b7b278788e7be4d0d29c0f39497a0eef3fba6bbc8e70d8bf7fde46edeaa9e85" +dependencies = [ + "itertools 0.11.0", + "nom", + "unicode_categories", +] + +[[package]] +name = "sqlx" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e50c216e3624ec8e7ecd14c6a6a6370aad6ee5d8cfc3ab30b5162eeeef2ed33" +dependencies = [ + "sqlx-core", + "sqlx-macros", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", +] + +[[package]] +name = "sqlx-core" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d6753e460c998bbd4cd8c6f0ed9a64346fcca0723d6e75e52fdc351c5d2169d" +dependencies = [ + "ahash 0.8.3", + "atoi", + "byteorder", + "bytes", + "crc", + "crossbeam-queue", + "dotenvy", + "either", + "event-listener", + "futures-channel", + "futures-core", + "futures-intrusive", + "futures-io", + "futures-util", + "hashlink", + "hex", + "indexmap 2.0.2", + "log", + "memchr", + "native-tls", + "once_cell", + "paste", + "percent-encoding", + "serde", + "serde_json", + "sha2 0.10.8", + "smallvec", + "sqlformat", + "thiserror", + "tokio", + "tokio-stream", + "tracing", + "url", +] + +[[package]] +name = "sqlx-macros" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a793bb3ba331ec8359c1853bd39eed32cdd7baaf22c35ccf5c92a7e8d1189ec" +dependencies = [ + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn 1.0.109", +] + +[[package]] +name = "sqlx-macros-core" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a4ee1e104e00dedb6aa5ffdd1343107b0a4702e862a84320ee7cc74782d96fc" +dependencies = [ + "dotenvy", + "either", + "heck", + "hex", + "once_cell", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2 0.10.8", + "sqlx-core", + "sqlx-mysql", + "sqlx-sqlite", + "syn 1.0.109", + "tempfile", + "tokio", + "url", +] + +[[package]] +name = "sqlx-mysql" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "864b869fdf56263f4c95c45483191ea0af340f9f3e3e7b4d57a61c7c87a970db" +dependencies = [ + "atoi", + "base64 0.21.4", + "bitflags 2.4.1", + "byteorder", + "bytes", + "crc", + "digest 0.10.7", + "dotenvy", + "either", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "generic-array 0.14.7", + "hex", + "hkdf", + "hmac 0.12.1", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "percent-encoding", + "rand 0.8.5", + "rsa", + "serde", + "sha1", + "sha2 0.10.8", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "tracing", + "whoami", +] + +[[package]] +name = "sqlx-postgres" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb7ae0e6a97fb3ba33b23ac2671a5ce6e3cabe003f451abd5a56e7951d975624" +dependencies = [ + "atoi", + "base64 0.21.4", + "bitflags 2.4.1", + "byteorder", + "crc", + "dotenvy", + "etcetera", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "hex", + "hkdf", + "hmac 0.12.1", + "home", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "rand 0.8.5", + "serde", + "serde_json", + "sha1", + "sha2 0.10.8", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "tracing", + "whoami", +] + +[[package]] +name = "sqlx-sqlite" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59dc83cf45d89c555a577694534fcd1b55c545a816c816ce51f20bbe56a4f3f" +dependencies = [ + "atoi", + "flume", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "sqlx-core", + "tracing", + "url", +] + [[package]] name = "ss58-registry" version = "1.43.0" @@ -9477,6 +9924,7 @@ dependencies = [ "frame-system", "frame-system-rpc-runtime-api", "futures", + "hex-literal", "jsonrpsee", "log", "pallet-transaction-payment", @@ -9488,11 +9936,12 @@ dependencies = [ "sc-client-api", "sc-consensus", "sc-consensus-aura", + "sc-consensus-grandpa", "sc-consensus-manual-seal", "sc-executor", - "sc-finality-grandpa", "sc-network", "sc-network-common", + "sc-network-sync", "sc-rpc", "sc-rpc-api", "sc-service", @@ -9505,8 +9954,8 @@ dependencies = [ "sp-block-builder", "sp-blockchain", "sp-consensus-aura", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-inherents", "sp-keyring", "sp-keystore", @@ -9703,14 +10152,14 @@ dependencies = [ "serde", "sp-api", "sp-application-crypto", - "sp-beefy", "sp-block-builder", "sp-consensus", "sp-consensus-aura", "sp-consensus-babe", + "sp-consensus-beefy", + "sp-consensus-grandpa", "sp-core", "sp-externalities", - "sp-finality-grandpa", "sp-inherents", "sp-io", "sp-keyring", @@ -9738,6 +10187,7 @@ dependencies = [ "futures", "parity-scale-codec", "sc-block-builder", + "sc-chain-spec", "sc-client-api", "sc-consensus", "sp-api", @@ -9907,6 +10357,17 @@ dependencies = [ "stbl-tools", ] +[[package]] +name = "stringprep" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" +dependencies = [ + "finl_unicode", + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "strsim" version = "0.10.0" @@ -9983,7 +10444,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "platforms 2.0.0", ] @@ -9991,7 +10452,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -10010,7 +10471,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "hyper", "log", @@ -10022,7 +10483,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", "async-trait", @@ -10048,7 +10509,7 @@ dependencies = [ [[package]] name = "substrate-test-runtime" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "cfg-if", "frame-support", @@ -10065,13 +10526,13 @@ dependencies = [ "serde", "sp-api", "sp-application-crypto", - "sp-beefy", "sp-block-builder", "sp-consensus-aura", "sp-consensus-babe", + "sp-consensus-beefy", + "sp-consensus-grandpa", "sp-core", "sp-externalities", - "sp-finality-grandpa", "sp-inherents", "sp-io", "sp-keyring", @@ -10091,11 +10552,12 @@ dependencies = [ [[package]] name = "substrate-test-runtime-client" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "futures", "parity-scale-codec", "sc-block-builder", + "sc-chain-spec", "sc-client-api", "sc-consensus", "sp-api", @@ -10110,7 +10572,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#8c4b84520cee2d7de53cc33cb67605ce4efefba8" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "ansi_term", "build-helper", @@ -10588,11 +11050,11 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.25.1" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3390c0409daaa6027d6681393316f4ccd3ff82e1590a1e4725014e3ae2bf1920" +checksum = "767abe6ffed88a1889671a102c2861ae742726f52e0a5a425b92c9fbfa7e9c85" dependencies = [ - "hash-db", + "hash-db 0.16.0", "hashbrown 0.13.2", "log", "rustc-hex", @@ -10601,11 +11063,11 @@ dependencies = [ [[package]] name = "trie-root" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a36c5ca3911ed3c9a5416ee6c679042064b93fc637ded67e25f92e68d783891" +checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" dependencies = [ - "hash-db", + "hash-db 0.16.0", ] [[package]] @@ -10614,7 +11076,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" dependencies = [ - "hash-db", + "hash-db 0.15.2", "rlp", ] @@ -10785,6 +11247,12 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "unicode_categories" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" + [[package]] name = "universal-hash" version = "0.4.1" @@ -11513,7 +11981,7 @@ dependencies = [ "lazy_static", "libc", "log", - "nix 0.24.3", + "nix", "rand 0.8.5", "thiserror", "tokio", @@ -11532,6 +12000,12 @@ dependencies = [ "rustix 0.38.19", ] +[[package]] +name = "whoami" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" + [[package]] name = "wide" version = "0.7.13" @@ -11826,8 +12300,8 @@ dependencies = [ [[package]] name = "xcm" -version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?tag=v0.9.39#bf2ebf30780ce176d16d67c1d313ca261f18233e" +version = "0.9.40" +source = "git+https://github.com/paritytech/polkadot?tag=v0.9.40#a2b62fb872ba22622aaf8e13f9dcd9a4adcc454f" dependencies = [ "bounded-collections", "derivative", @@ -11841,8 +12315,8 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "0.9.39" -source = "git+https://github.com/paritytech/polkadot?tag=v0.9.39#bf2ebf30780ce176d16d67c1d313ca261f18233e" +version = "0.9.40" +source = "git+https://github.com/paritytech/polkadot?tag=v0.9.40#a2b62fb872ba22622aaf8e13f9dcd9a4adcc454f" dependencies = [ "Inflector", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index f89f1544..03826107 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,16 +50,22 @@ repository = "https://github.com/stabilityprotocol/stability/" [workspace.dependencies] +affix = "0.1.2" +derive_more = "0.99" +impl-trait-for-tuples = "0.2.1" +num_enum = { version = "0.5.3", default-features = false } +paste = "1.0.6" +similar-asserts = "1.1.0" bn = { package = "substrate-bn", version = "0.6", default-features = false } -environmental = { version = "1.1.3", default-features = false } +environmental = { version = "1.1.4", default-features = false } ethereum = { version = "0.14.0", default-features = false } ethereum-types = { version = "0.14.1", default-features = false } -evm = { version = "0.37.0", default-features = false } +evm = { version = "0.39.0", default-features = false } jsonrpsee = "0.16.2" kvdb-rocksdb = "0.17.0" libsecp256k1 = { version = "0.7.1", default-features = false } hex = { version = "0.4.3", default-features = false } -parity-db = "0.4.2" +parity-db = "0.4.6" rlp = { version = "0.5", default-features = false } scale-codec = { package = "parity-scale-codec", version = "3.2.1", default-features = false, features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } @@ -74,122 +80,125 @@ array-bytes = "4.1" bytes = "1.0" async-trait = "0.1.57" cfg-if = "1.0" -memory-db = { version = "0.31.0", default-features = false } -trie-db = { version = "0.25.1", default-features = false } +memory-db = { version = "0.32.0", default-features = false } +trie-db = { version = "0.27.0", default-features = false } once_cell = "1.17.1" hex-literal = "0.3.4" syn = "1.0.98" +sqlx = "0.7.0-alpha.3" # Polkadot -xcm = { git = "https://github.com/paritytech/polkadot", tag = "v0.9.39", default-features = false } +xcm = { git = "https://github.com/paritytech/polkadot", tag = "v0.9.40", default-features = false } # Substrate Client -sc-block-builder = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-chain-spec = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-client-db = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-consensus-manual-seal = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-finality-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-network-common = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-proposer-metrics = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39"} -sc-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-block-builder = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-chain-spec = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-client-db = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-consensus-manual-seal = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-consensus-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-network-common = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-network-sync = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-proposer-metrics = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"} +sc-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } # Substrate Primitive -sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-core = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-database = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-finality-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-io = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-keyring = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-runtime = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-state-machine = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-std = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-storage = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-trie = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-version = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-keystore = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -beefy-primitives = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", package = "sp-beefy", branch = "polkadot-v0.9.39" } -sp-application-crypto = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-consensus-babe = { version = "0.10.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-externalities = { version = "0.13.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-runtime-interface = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sp-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-consensus-beefy = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-core = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-database = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sp-consensus-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-io = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-keyring = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sp-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-runtime = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-state-machine = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-std = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-storage = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-trie = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-version = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-keystore = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +beefy-primitives = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", package = "sp-beefy", branch = "polkadot-v0.9.40" } +sp-application-crypto = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sp-consensus-babe = { version = "0.10.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sp-externalities = { version = "0.13.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sp-runtime-interface = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } # Substrate FRAME -frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -frame-executive = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -frame-system-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -frame-system-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-aura = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-sudo = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-transaction-payment = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -pallet-transaction-payment-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-utility = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-collective = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-babe = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-beefy-mmr = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +frame-executive = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +frame-system-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +frame-system-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-aura = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-sudo = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-transaction-payment = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +pallet-transaction-payment-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-utility = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-collective = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-babe = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-beefy-mmr = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } # Substrate Utility -frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-staking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sp-staking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } # Frontier Client -fc-cli = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39" } -fc-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39" } -fc-db = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39" } -fc-mapping-sync = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39" } -fc-rpc = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39" } -fc-rpc-core = { version = "1.1.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39" } -fc-storage = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39" } +fc-cli = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40" } +fc-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40" } +fc-db = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40" } +fc-mapping-sync = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40" } +fc-rpc = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40" } +fc-rpc-core = { version = "1.1.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40" } +fc-storage = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40" } # Frontier Primitive -fp-account = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } -fp-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } -fp-ethereum = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } -fp-evm = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } -fp-rpc = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } -fp-self-contained = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } -fp-storage = { version = "2.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } +fp-account = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } +fp-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } +fp-ethereum = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } +fp-evm = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } +fp-rpc = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } +fp-self-contained = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } +fp-storage = { version = "2.0.0", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } # Frontier FRAME -pallet-base-fee = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } -pallet-ethereum = { version = "4.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } -pallet-evm = { version = "6.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } -pallet-evm-chain-id = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } -pallet-evm-precompile-modexp = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } -pallet-evm-precompile-sha3fips = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } -pallet-evm-precompile-simple = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } -pallet-evm-test-vector-support = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } -pallet-hotfix-sufficients = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } +pallet-base-fee = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } +pallet-ethereum = { version = "4.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } +pallet-evm = { version = "6.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } +pallet-evm-chain-id = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } +pallet-evm-precompile-modexp = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } +pallet-evm-precompile-sha3fips = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } +pallet-evm-precompile-simple = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } +pallet-evm-test-vector-support = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } +pallet-hotfix-sufficients = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } # Stability Client stbl-cli-authorship = { version = "1.0.0", path = './client/authorship' } # Stability -pallet-evm-precompile-blake2 = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } -pallet-evm-precompile-bn128 = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.39", default-features = false } +pallet-evm-precompile-blake2 = { git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } +pallet-evm-precompile-bn128 = { git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } precompile-utils = { path = "./precompiles/utils", default-features = false } precompile-fee-token-selector = { path = "./precompiles/token-fee-controller/fee-token-selector", default-features = false } precompile-validator-fee-selector = { path = "./precompiles/token-fee-controller/validator-fee-selector", default-features = false } @@ -229,4 +238,11 @@ sha3 = { version = "0.9", default-features = false } stability-rpc = { path = "./stability-rpc", default-features = false } stability-rpc-api = { path = "./primitives/stability-rpc-api", default-features = false } stbl-transaction-validator = { path = "./primitives/transaction-validator", default-features = false } -reqwest = { version = "0.11", features = ["json"] } \ No newline at end of file +reqwest = { version = "0.11", features = ["json"] } + +# Arkworks +ark-bls12-377 = { version = "0.4.0", default-features = false, features = ["curve"] } +ark-bw6-761 = { version = "0.4.0", default-features = false } +ark-ec = { version = "0.4.0", default-features = false } +ark-ff = { version = "0.4.0", default-features = false } +ark-std = { version = "0.4.0", default-features = false } \ No newline at end of file diff --git a/node/Cargo.toml b/node/Cargo.toml index 30027616..7d8a70fb 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -16,6 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"] async-trait = "0.1" clap = { version = "4.1", features = ["derive", "deprecated"] } futures = "0.3.25" +hex-literal = { workspace = true } jsonrpsee = { workspace = true, features = ["server", "macros"] } log = "0.4.17" scale-codec = { package = "parity-scale-codec", workspace = true } @@ -30,9 +31,10 @@ sc-consensus = { workspace = true } sc-consensus-aura = { workspace = true } sc-consensus-manual-seal = { workspace = true } sc-executor = { workspace = true } -sc-finality-grandpa = { workspace = true } +sc-consensus-grandpa = { workspace = true } sc-network = { workspace = true } sc-network-common = { workspace = true } +sc-network-sync = { workspace = true } sc-rpc = { workspace = true } sc-rpc-api = { workspace = true } sc-service = { workspace = true } @@ -44,7 +46,7 @@ sp-block-builder = { workspace = true } sp-blockchain = { workspace = true } sp-consensus-aura = { workspace = true, features = ["default"] } sp-core = { workspace = true, features = ["default"] } -sp-finality-grandpa = { workspace = true, features = ["default"] } +sp-consensus-grandpa = { workspace = true, features = ["default"] } sp-inherents = { workspace = true, features = ["default"] } sp-keyring = { workspace = true } sp-offchain = { workspace = true, features = ["default"] } diff --git a/node/src/chain_spec/mod.rs b/node/src/chain_spec/mod.rs index 20876330..f0c10121 100644 --- a/node/src/chain_spec/mod.rs +++ b/node/src/chain_spec/mod.rs @@ -1,6 +1,6 @@ use serde::{Deserialize, Serialize}; use sp_core::{bytes::from_hex, ecdsa, H160, H256}; -use sp_finality_grandpa::AuthorityId as GrandpaId; +use sp_consensus_grandpa::AuthorityId as GrandpaId; use stability_runtime::{AccountId, GenesisConfig, Precompiles, ValidatorFeeSelectorConfig}; use std::{collections::BTreeMap, str::FromStr, vec}; // Substrate @@ -147,9 +147,9 @@ pub fn base_genesis( let revert_bytecode = vec![0x60, 0x00, 0x60, 0x00, 0xFD]; Precompiles::used_addresses() .into_iter() - .for_each(|addr: H160| { + .for_each(|addr| { map.insert( - addr, + H160(addr.0), fp_evm::GenesisAccount { nonce: Default::default(), balance: Default::default(), diff --git a/node/src/client.rs b/node/src/client.rs index fdcb77c5..661f2561 100644 --- a/node/src/client.rs +++ b/node/src/client.rs @@ -64,7 +64,7 @@ pub trait RuntimeApiCollection: BaseRuntimeApiCollection + EthCompatRuntimeApiCollection + sp_consensus_aura::AuraApi - + sp_finality_grandpa::GrandpaApi + + sp_consensus_grandpa::GrandpaApi + frame_system_rpc_runtime_api::AccountNonceApi + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + stbl_primitives_fee_compatible_api::CompatibleFeeApi @@ -79,7 +79,7 @@ where Api: BaseRuntimeApiCollection + EthCompatRuntimeApiCollection + sp_consensus_aura::AuraApi - + sp_finality_grandpa::GrandpaApi + + sp_consensus_grandpa::GrandpaApi + frame_system_rpc_runtime_api::AccountNonceApi + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + stbl_primitives_fee_compatible_api::CompatibleFeeApi diff --git a/node/src/command.rs b/node/src/command.rs index d419a86e..e0580f05 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -14,12 +14,12 @@ // 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. - +use futures::TryFutureExt; // Substrate use sc_cli::{ChainSpec, RuntimeVersion, SubstrateCli}; use sc_service::DatabaseSource; // Frontier -use fc_db::frontier_database_dir; +use fc_db::kv::frontier_database_dir; use crate::{ chain_spec, @@ -118,19 +118,45 @@ pub fn run() -> sc_cli::Result<()> { runner.sync_run(|config| { // Remove Frontier offchain db let db_config_dir = db_config_dir(&config); - let frontier_database_config = match config.database { - DatabaseSource::RocksDb { .. } => DatabaseSource::RocksDb { - path: frontier_database_dir(&db_config_dir, "db"), - cache_size: 0, - }, - DatabaseSource::ParityDb { .. } => DatabaseSource::ParityDb { - path: frontier_database_dir(&db_config_dir, "paritydb"), - }, - _ => { - return Err(format!("Cannot purge `{:?}` database", config.database).into()) + match cli.eth.frontier_backend_type { + crate::eth::BackendType::KeyValue => { + let frontier_database_config = match config.database { + DatabaseSource::RocksDb { .. } => DatabaseSource::RocksDb { + path: frontier_database_dir(&db_config_dir, "db"), + cache_size: 0, + }, + DatabaseSource::ParityDb { .. } => DatabaseSource::ParityDb { + path: frontier_database_dir(&db_config_dir, "paritydb"), + }, + _ => { + return Err(format!( + "Cannot purge `{:?}` database", + config.database + ) + .into()) + } + }; + cmd.run(frontier_database_config)?; + } + crate::eth::BackendType::Sql => { + let db_path = db_config_dir.join("sql"); + match std::fs::remove_dir_all(&db_path) { + Ok(_) => { + println!("{:?} removed.", &db_path); + } + Err(ref err) if err.kind() == std::io::ErrorKind::NotFound => { + eprintln!("{:?} did not exist.", &db_path); + } + Err(err) => { + return Err(format!( + "Cannot purge `{:?}` database: {:?}", + db_path, err, + ) + .into()) + } + }; } }; - cmd.run(frontier_database_config)?; cmd.run(config.database) }) } @@ -140,7 +166,7 @@ pub fn run() -> sc_cli::Result<()> { let (client, backend, _, task_manager, _) = service::new_chain_ops(&mut config, &cli.eth)?; let aux_revert = Box::new(move |client, _, blocks| { - sc_finality_grandpa::revert(client, blocks)?; + sc_consensus_grandpa::revert(client, blocks)?; Ok(()) }); Ok((cmd.run(client, backend, Some(aux_revert)), task_manager)) @@ -209,13 +235,19 @@ pub fn run() -> sc_cli::Result<()> { runner.sync_run(|mut config| { let (client, _, _, _, frontier_backend) = service::new_chain_ops(&mut config, &cli.eth)?; + let frontier_backend = match frontier_backend { + fc_db::Backend::KeyValue(kv) => std::sync::Arc::new(kv), + _ => panic!("Only fc_db::Backend::KeyValue supported"), + }; cmd.run(client, frontier_backend) }) } None => { let runner = cli.create_runner(&cli.run)?; runner.run_node_until_exit(|config| async move { - service::build_full(config, cli.eth, cli.sealing, cli.stability).map_err(Into::into) + service::build_full(config, cli.eth, cli.sealing, cli.stability) + .map_err(Into::into) + .await }) } } diff --git a/node/src/eth.rs b/node/src/eth.rs index 30a366a1..16630ce6 100644 --- a/node/src/eth.rs +++ b/node/src/eth.rs @@ -9,13 +9,13 @@ use futures::{future, prelude::*}; // Substrate use sc_client_api::{BlockchainEvents, StateBackendFor}; use sc_executor::NativeExecutionDispatch; +use sc_network_sync::SyncingService; use sc_service::{error::Error as ServiceError, BasePath, Configuration, TaskManager}; use sp_api::ConstructRuntimeApi; use sp_runtime::traits::BlakeTwo256; // Frontier pub use fc_consensus::FrontierBlockImport; -pub use fc_db::frontier_database_dir; -use fc_mapping_sync::{MappingSyncWorker, SyncStrategy}; + use fc_rpc::{EthTask, OverrideHandle}; pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool}; // Local @@ -37,6 +37,21 @@ pub fn db_config_dir(config: &Configuration) -> PathBuf { }) } +/// Avalailable frontier backend types. +#[derive(Debug, Copy, Clone, clap::ValueEnum)] +pub enum BackendType { + /// Either RocksDb or ParityDb as per inherited from the global backend settings. + KeyValue, + /// Sql database with custom log indexing. + Sql, +} + +impl Default for BackendType { + fn default() -> BackendType { + BackendType::KeyValue + } +} + /// The ethereum-compatibility configuration used to run a node. #[derive(Clone, Debug, clap::Parser)] pub struct EthConfiguration { @@ -64,6 +79,27 @@ pub struct EthConfiguration { /// Size in bytes of the LRU cache for transactions statuses data. #[arg(long, default_value = "50")] pub eth_statuses_cache: usize, + + /// Sets the frontier backend type (KeyValue or Sql) + #[arg(long, value_enum, ignore_case = true, default_value_t = BackendType::default())] + pub frontier_backend_type: BackendType, + + // Sets the SQL backend's pool size. + #[arg(long, default_value = "100")] + pub frontier_sql_backend_pool_size: u32, + + /// Sets the SQL backend's query timeout in number of VM ops. + #[arg(long, default_value = "10000000")] + pub frontier_sql_backend_num_ops_timeout: u32, + + /// Sets the SQL backend's auxiliary thread limit. + #[arg(long, default_value = "4")] + pub frontier_sql_backend_thread_count: u32, + + /// Sets the SQL backend's query timeout in number of VM ops. + /// Default value is 200MB. + #[arg(long, default_value = "209715200")] + pub frontier_sql_backend_cache_size: u64, } pub struct FrontierPartialComponents { @@ -101,15 +137,21 @@ where { } -pub fn spawn_frontier_tasks( +pub async fn spawn_frontier_tasks( task_manager: &TaskManager, client: Arc>, backend: Arc, - frontier_backend: Arc, + frontier_backend: FrontierBackend, filter_pool: Option, overrides: Arc>, fee_history_cache: FeeHistoryCache, fee_history_cache_limit: FeeHistoryCacheLimit, + sync: Arc>, + pubsub_notification_sinks: Arc< + fc_mapping_sync::EthereumBlockNotificationSinks< + fc_mapping_sync::EthereumBlockNotification, + >, + >, ) where RuntimeApi: ConstructRuntimeApi>, RuntimeApi: Send + Sync + 'static, @@ -117,23 +159,49 @@ pub fn spawn_frontier_tasks( EthCompatRuntimeApiCollection>, Executor: NativeExecutionDispatch + 'static, { - task_manager.spawn_essential_handle().spawn( - "frontier-mapping-sync-worker", - Some("frontier"), - MappingSyncWorker::new( - client.import_notification_stream(), - Duration::new(6, 0), - client.clone(), - backend, - overrides.clone(), - frontier_backend, - 3, - 0, - SyncStrategy::Normal, - ) - .for_each(|()| future::ready(())), - ); - + // Spawn main mapping sync worker background task. + match frontier_backend { + fc_db::Backend::KeyValue(b) => { + task_manager.spawn_essential_handle().spawn( + "frontier-mapping-sync-worker", + Some("frontier"), + fc_mapping_sync::kv::MappingSyncWorker::new( + client.import_notification_stream(), + Duration::new(6, 0), + client.clone(), + backend, + overrides.clone(), + Arc::new(b), + 3, + 0, + fc_mapping_sync::SyncStrategy::Normal, + sync, + pubsub_notification_sinks, + ) + .for_each(|()| future::ready(())), + ); + } + fc_db::Backend::Sql(b) => { + task_manager.spawn_essential_handle().spawn_blocking( + "frontier-mapping-sync-worker", + Some("frontier"), + fc_mapping_sync::sql::SyncWorker::run( + client.clone(), + backend, + Arc::new(b), + client.import_notification_stream(), + fc_mapping_sync::sql::SyncWorkerConfig { + read_notification_timeout: Duration::from_secs(10), + check_indexed_blocks_interval: Duration::from_secs(60), + }, + fc_mapping_sync::SyncStrategy::Parachain, + sync, + pubsub_notification_sinks, + ), + ); + } + } + // Spawn Frontier EthFilterApi maintenance task. if let Some(filter_pool) = filter_pool { // Each filter is allowed to stay in the pool for 100 blocks. diff --git a/node/src/rpc/eth.rs b/node/src/rpc/eth.rs index 5e615855..c14ddd25 100644 --- a/node/src/rpc/eth.rs +++ b/node/src/rpc/eth.rs @@ -1,4 +1,4 @@ -use std::sync::Arc; +use std::{collections::BTreeMap, sync::Arc}; use jsonrpsee::RpcModule; // Substrate @@ -7,16 +7,18 @@ use sc_client_api::{ client::BlockchainEvents, }; use sc_network::NetworkService; +use sc_network_sync::SyncingService; use sc_rpc::SubscriptionTaskExecutor; use sc_transaction_pool::{ChainApi, Pool}; use sc_transaction_pool_api::TransactionPool; -use sp_api::ProvideRuntimeApi; +use sp_api::{CallApiAt, ProvideRuntimeApi}; use sp_block_builder::BlockBuilder as BlockBuilderApi; use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; +use sp_core::H256; use sp_runtime::traits::Block as BlockT; // Frontier use fc_db::Backend as FrontierBackend; -pub use fc_rpc::{EthBlockDataCacheTask, OverrideHandle, StorageOverride}; +pub use fc_rpc::{EthBlockDataCacheTask, EthConfig, OverrideHandle, StorageOverride}; pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool}; pub use fc_storage::overrides_handle; use fp_rpc::{ConvertTransaction, ConvertTransactionRuntimeApi, EthereumRuntimeRPCApi}; @@ -37,8 +39,10 @@ pub struct EthDeps { pub enable_dev_signer: bool, /// Network service pub network: Arc>, + /// Chain syncing service + pub sync: Arc>, /// Frontier Backend. - pub frontier_backend: Arc>, + pub frontier_backend: Arc + Send + Sync>, /// Ethereum data access overrides. pub overrides: Arc>, /// Cache for Ethereum block data. @@ -54,6 +58,8 @@ pub struct EthDeps { /// Maximum allowed gas limit will be ` block.gas_limit * execute_gas_limit_multiplier` when /// using eth_call/eth_estimateGas. pub execute_gas_limit_multiplier: u64, + /// Mandated parent hashes for a given block hash. + pub forced_parent_hashes: Option>, } impl Clone for EthDeps { @@ -66,6 +72,7 @@ impl Clone for EthDeps is_authority: self.is_authority, enable_dev_signer: self.enable_dev_signer, network: self.network.clone(), + sync: self.sync.clone(), frontier_backend: self.frontier_backend.clone(), overrides: self.overrides.clone(), block_data_cache: self.block_data_cache.clone(), @@ -74,19 +81,25 @@ impl Clone for EthDeps fee_history_cache: self.fee_history_cache.clone(), fee_history_cache_limit: self.fee_history_cache_limit, execute_gas_limit_multiplier: self.execute_gas_limit_multiplier, + forced_parent_hashes: self.forced_parent_hashes.clone(), } } } /// Instantiate Ethereum-compatible RPC extensions. -pub fn create_eth( +pub fn create_eth>( mut io: RpcModule<()>, deps: EthDeps, subscription_task_executor: SubscriptionTaskExecutor, + pubsub_notification_sinks: Arc< + fc_mapping_sync::EthereumBlockNotificationSinks< + fc_mapping_sync::EthereumBlockNotification, + >, + >, ) -> Result, Box> where - B: BlockT, - C: ProvideRuntimeApi, + B: BlockT, + C: CallApiAt + ProvideRuntimeApi, C::Api: BlockBuilderApi + EthereumRuntimeRPCApi + ConvertTransactionRuntimeApi, C: BlockchainEvents + 'static, C: HeaderBackend + HeaderMetadata + StorageProvider, @@ -108,6 +121,7 @@ where is_authority, enable_dev_signer, network, + sync, frontier_backend, overrides, block_data_cache, @@ -116,6 +130,7 @@ where fee_history_cache, fee_history_cache_limit, execute_gas_limit_multiplier, + forced_parent_hashes, } = deps; let mut signers = Vec::new(); @@ -129,8 +144,8 @@ where pool.clone(), graph, converter, - network.clone(), - vec![], + sync.clone(), + signers, overrides.clone(), frontier_backend.clone(), is_authority, @@ -138,7 +153,9 @@ where fee_history_cache, fee_history_cache_limit, execute_gas_limit_multiplier, + forced_parent_hashes, ) + .replace_config::() .into_rpc(), )?; @@ -160,9 +177,10 @@ where EthPubSub::new( pool, client.clone(), - network.clone(), + sync, subscription_task_executor, overrides, + pubsub_notification_sinks, ) .into_rpc(), )?; diff --git a/node/src/rpc/mod.rs b/node/src/rpc/mod.rs index d270792f..05b5e17f 100644 --- a/node/src/rpc/mod.rs +++ b/node/src/rpc/mod.rs @@ -14,7 +14,7 @@ use sc_rpc::SubscriptionTaskExecutor; use sc_rpc_api::DenyUnsafe; use sc_service::TransactionPool; use sc_transaction_pool::ChainApi; -use sp_api::ProvideRuntimeApi; +use sp_api::{CallApiAt, ProvideRuntimeApi}; use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; use sp_runtime::traits::Block as BlockT; use stbl_primitives_zero_gas_transactions_api::ZeroGasTransactionApi; @@ -38,13 +38,30 @@ pub struct FullDeps { pub eth: EthDeps, } +pub struct DefaultEthConfig(std::marker::PhantomData<(C, BE)>); + +impl fc_rpc::EthConfig for DefaultEthConfig +where + C: sc_client_api::StorageProvider + Sync + Send + 'static, + BE: Backend + 'static, +{ + type EstimateGasAdapter = (); + type RuntimeStorageOverride = + fc_rpc::frontier_backend_client::SystemAccountId20StorageOverride; +} + /// Instantiate all Full RPC extensions. pub fn create_full( deps: FullDeps, subscription_task_executor: SubscriptionTaskExecutor, + pubsub_notification_sinks: Arc< + fc_mapping_sync::EthereumBlockNotificationSinks< + fc_mapping_sync::EthereumBlockNotification, + >, + >, ) -> Result, Box> where - C: ProvideRuntimeApi, + C: CallApiAt + ProvideRuntimeApi, C::Api: substrate_frame_rpc_system::AccountNonceApi, C::Api: sp_block_builder::BlockBuilder, C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, @@ -88,7 +105,12 @@ where } // Ethereum compatibility RPCs - let io = create_eth::<_, _, _, _, _, _>(io, eth, subscription_task_executor)?; + let io = create_eth::<_, _, _, _, _, _, DefaultEthConfig>( + io, + eth, + subscription_task_executor, + pubsub_notification_sinks, + )?; Ok(io) } diff --git a/node/src/service.rs b/node/src/service.rs index a7e0b56a..70c06888 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -1,6 +1,6 @@ //! Service and ServiceFactory implementation. Specialized wrapper over substrate service. -use std::{cell::RefCell, sync::Arc, time::Duration}; +use std::{cell::RefCell, path::Path, sync::Arc, time::Duration}; use futures::{channel::mpsc, prelude::*}; // Substrate @@ -23,8 +23,8 @@ use crate::{ cli::Sealing, client::{BaseRuntimeApiCollection, FullBackend, FullClient, RuntimeApiCollection}, eth::{ - new_frontier_partial, spawn_frontier_tasks, FrontierBackend, FrontierBlockImport, - FrontierPartialComponents, + new_frontier_partial, spawn_frontier_tasks, BackendType, EthCompatRuntimeApiCollection, + FrontierBackend, FrontierBlockImport, FrontierPartialComponents, }, }; pub use crate::{ @@ -39,8 +39,8 @@ type FullPool = sc_transaction_pool::FullPool; type FullSelectChain = sc_consensus::LongestChain; type GrandpaBlockImport = - sc_finality_grandpa::GrandpaBlockImport; -type GrandpaLinkHalf = sc_finality_grandpa::LinkHalf; + sc_consensus_grandpa::GrandpaBlockImport; +type GrandpaLinkHalf = sc_consensus_grandpa::LinkHalf; type BoxBlockImport = sc_consensus::BoxBlockImport>; pub fn new_partial( @@ -58,7 +58,8 @@ pub fn new_partial( Option, BoxBlockImport>, GrandpaLinkHalf>, - Arc, + FrontierBackend, + Arc>, ), >, ServiceError, @@ -66,8 +67,8 @@ pub fn new_partial( where RuntimeApi: ConstructRuntimeApi>, RuntimeApi: Send + Sync + 'static, - RuntimeApi::RuntimeApi: - BaseRuntimeApiCollection>, + RuntimeApi::RuntimeApi: BaseRuntimeApiCollection> + + EthCompatRuntimeApiCollection>, Executor: NativeExecutionDispatch + 'static, BIQ: FnOnce( Arc>, @@ -76,7 +77,6 @@ where &TaskManager, Option, GrandpaBlockImport>, - Arc, ) -> Result< ( BasicImportQueue>, @@ -119,18 +119,43 @@ where }); let select_chain = sc_consensus::LongestChain::new(backend.clone()); - let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import( + let (grandpa_block_import, grandpa_link) = sc_consensus_grandpa::block_import( client.clone(), &client, select_chain.clone(), telemetry.as_ref().map(|x| x.handle()), )?; - let frontier_backend = Arc::new(FrontierBackend::open( - client.clone(), - &config.database, - &db_config_dir(config), - )?); + let overrides = crate::rpc::overrides_handle(client.clone()); + let frontier_backend = match eth_config.frontier_backend_type { + BackendType::KeyValue => FrontierBackend::KeyValue(fc_db::kv::Backend::open( + Arc::clone(&client), + &config.database, + &db_config_dir(config), + )?), + BackendType::Sql => { + let db_path = db_config_dir(config).join("sql"); + std::fs::create_dir_all(&db_path).expect("failed creating sql db directory"); + let backend = futures::executor::block_on(fc_db::sql::Backend::new( + fc_db::sql::BackendConfig::Sqlite(fc_db::sql::SqliteBackendConfig { + path: Path::new("sqlite:///") + .join(db_path) + .join("frontier.db3") + .to_str() + .unwrap(), + create_if_missing: true, + thread_count: eth_config.frontier_sql_backend_thread_count, + cache_size: eth_config.frontier_sql_backend_cache_size, + }), + eth_config.frontier_sql_backend_pool_size, + std::num::NonZeroU32::new(eth_config.frontier_sql_backend_num_ops_timeout), + overrides.clone(), + )) + .unwrap_or_else(|err| panic!("failed creating sql backend: {:?}", err)); + FrontierBackend::Sql(backend) + } + }; + let (import_queue, block_import) = build_import_queue( client.clone(), config, @@ -138,7 +163,6 @@ where &task_manager, telemetry.as_ref().map(|x| x.handle()), grandpa_block_import, - frontier_backend.clone(), )?; let transaction_pool = sc_transaction_pool::BasicPool::new_full( @@ -157,7 +181,13 @@ where select_chain, import_queue, transaction_pool, - other: (telemetry, block_import, grandpa_link, frontier_backend), + other: ( + telemetry, + block_import, + grandpa_link, + frontier_backend, + overrides, + ), }) } @@ -169,7 +199,6 @@ pub fn build_aura_grandpa_import_queue( task_manager: &TaskManager, telemetry: Option, grandpa_block_import: GrandpaBlockImport>, - frontier_backend: Arc, ) -> Result< ( BasicImportQueue>, @@ -184,11 +213,8 @@ where RuntimeApiCollection>, Executor: NativeExecutionDispatch + 'static, { - let frontier_block_import = FrontierBlockImport::new( - grandpa_block_import.clone(), - client.clone(), - frontier_backend, - ); + let frontier_block_import = + FrontierBlockImport::new(grandpa_block_import.clone(), client.clone()); let slot_duration = sc_consensus_aura::slot_duration(&*client)?; let create_inherent_data_providers = move |_, ()| async move { @@ -228,7 +254,6 @@ pub fn build_manual_seal_import_queue( task_manager: &TaskManager, _telemetry: Option, _grandpa_block_import: GrandpaBlockImport>, - frontier_backend: Arc, ) -> Result< ( BasicImportQueue>, @@ -243,7 +268,7 @@ where RuntimeApiCollection>, Executor: NativeExecutionDispatch + 'static, { - let frontier_block_import = FrontierBlockImport::new(client.clone(), client, frontier_backend); + let frontier_block_import = FrontierBlockImport::new(client.clone(), client); Ok(( sc_consensus_manual_seal::import_queue( Box::new(frontier_block_import.clone()), @@ -255,7 +280,7 @@ where } /// Builds a new service for a full client. -pub fn new_full( +pub async fn new_full( mut config: Configuration, eth_config: EthConfiguration, sealing: Option, @@ -284,7 +309,7 @@ where keystore_container, select_chain, transaction_pool, - other: (mut telemetry, block_import, grandpa_link, frontier_backend), + other: (mut telemetry, block_import, grandpa_link, frontier_backend, overrides), } = new_partial(&config, ð_config, build_import_queue)?; let FrontierPartialComponents { @@ -293,7 +318,7 @@ where fee_history_cache_limit, } = new_frontier_partial(ð_config)?; - let grandpa_protocol_name = sc_finality_grandpa::protocol_standard_name( + let grandpa_protocol_name = sc_consensus_grandpa::protocol_standard_name( &client.block_hash(0)?.expect("Genesis block exists; qed"), &config.chain_spec, ); @@ -304,11 +329,11 @@ where config .network .extra_sets - .push(sc_finality_grandpa::grandpa_peers_set_config( + .push(sc_consensus_grandpa::grandpa_peers_set_config( grandpa_protocol_name.clone(), )); let warp_sync: Arc> = - Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new( + Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new( backend.clone(), grandpa_link.shared_authority_set().clone(), Vec::default(), @@ -316,7 +341,7 @@ where Some(WarpSyncParams::WithProvider(warp_sync)) }; - let (network, system_rpc_tx, tx_handler_controller, network_starter) = + let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) = sc_service::build_network(sc_service::BuildNetworkParams { config: &config, client: client.clone(), @@ -345,9 +370,18 @@ where // Channel for the rpc handler to communicate with the authorship task. let (command_sink, commands_stream) = mpsc::channel(1000); + // Sinks for pubsub notifications. + // Everytime a new subscription is created, a new mpsc channel is added to the sink pool. + // The MappingSyncWorker sends through the channel on block import and the subscription emits a notification to the subscriber on receiving a message through this channel. + // This way we avoid race conditions when using native substrate block import notification stream. + let pubsub_notification_sinks: fc_mapping_sync::EthereumBlockNotificationSinks< + fc_mapping_sync::EthereumBlockNotification, + > = Default::default(); + let pubsub_notification_sinks = Arc::new(pubsub_notification_sinks); + // for ethereum-compatibility rpc. config.rpc_id_provider = Some(Box::new(fc_rpc::EthereumSubIdProvider)); - let overrides = crate::rpc::overrides_handle(client.clone()); + let eth_rpc_params = crate::rpc::EthDeps { client: client.clone(), pool: transaction_pool.clone(), @@ -356,7 +390,11 @@ where is_authority: config.role.is_authority(), enable_dev_signer: eth_config.enable_dev_signer, network: network.clone(), - frontier_backend: frontier_backend.clone(), + sync: sync_service.clone(), + frontier_backend: match frontier_backend.clone() { + fc_db::Backend::KeyValue(b) => Arc::new(b), + fc_db::Backend::Sql(b) => Arc::new(b), + }, overrides: overrides.clone(), block_data_cache: Arc::new(fc_rpc::EthBlockDataCacheTask::new( task_manager.spawn_handle(), @@ -370,11 +408,13 @@ where fee_history_cache: fee_history_cache.clone(), fee_history_cache_limit, execute_gas_limit_multiplier: eth_config.execute_gas_limit_multiplier, + forced_parent_hashes: None, }; let rpc_builder = { let client = client.clone(); let pool = transaction_pool.clone(); + let pubsub_notification_sinks = pubsub_notification_sinks.clone(); Box::new(move |deny_unsafe, subscription_task_executor| { let deps = crate::rpc::FullDeps { @@ -389,7 +429,12 @@ where eth: eth_rpc_params.clone(), }; - crate::rpc::create_full(deps, subscription_task_executor).map_err(Into::into) + crate::rpc::create_full( + deps, + subscription_task_executor, + pubsub_notification_sinks.clone(), + ) + .map_err(Into::into) }) }; @@ -404,6 +449,7 @@ where network: network.clone(), system_rpc_tx, tx_handler_controller, + sync_service: sync_service.clone(), telemetry: telemetry.as_mut(), })?; @@ -416,7 +462,10 @@ where overrides, fee_history_cache, fee_history_cache_limit, - ); + sync_service.clone(), + pubsub_notification_sinks, + ) + .await; if role.is_authority() { // manual-seal authorship @@ -478,8 +527,8 @@ where select_chain, block_import, proposer_factory, - sync_oracle: network.clone(), - justification_sync_link: network.clone(), + sync_oracle: sync_service.clone(), + justification_sync_link: sync_service.clone(), create_inherent_data_providers, force_authoring, backoff_authoring_blocks: Option::<()>::None, @@ -505,7 +554,7 @@ where None }; - let grandpa_config = sc_finality_grandpa::Config { + let grandpa_config = sc_consensus_grandpa::Config { // FIXME #1578 make this available through chainspec gossip_duration: Duration::from_millis(333), justification_period: 512, @@ -524,13 +573,14 @@ where // been tested extensively yet and having most nodes in a network run it // could lead to finality stalls. let grandpa_voter = - sc_finality_grandpa::run_grandpa_voter(sc_finality_grandpa::GrandpaParams { + sc_consensus_grandpa::run_grandpa_voter(sc_consensus_grandpa::GrandpaParams { config: grandpa_config, link: grandpa_link, network, - voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(), + sync: sync_service, + voting_rule: sc_consensus_grandpa::VotingRulesBuilder::default().build(), prometheus_registry, - shared_voter_state: sc_finality_grandpa::SharedVoterState::empty(), + shared_voter_state: sc_consensus_grandpa::SharedVoterState::empty(), telemetry: telemetry.as_ref().map(|x| x.handle()), })?; @@ -643,17 +693,17 @@ where Ok(()) } -pub fn build_full( +pub async fn build_full( config: Configuration, eth_config: EthConfiguration, sealing: Option, stability_config: StabilityConfiguration, ) -> Result { - new_full::(config, eth_config, sealing, stability_config) + new_full::(config, eth_config, sealing, stability_config).await } pub fn new_chain_ops( - mut config: &mut Configuration, + config: &mut Configuration, eth_config: &EthConfiguration, ) -> Result< ( @@ -661,7 +711,7 @@ pub fn new_chain_ops( Arc, BasicQueue>, TaskManager, - Arc, + FrontierBackend, ), ServiceError, > { diff --git a/precompiles/fee-rewards-vault-controller/src/lib.rs b/precompiles/fee-rewards-vault-controller/src/lib.rs index af9f4bbf..8d8c667c 100644 --- a/precompiles/fee-rewards-vault-controller/src/lib.rs +++ b/precompiles/fee-rewards-vault-controller/src/lib.rs @@ -139,9 +139,7 @@ where handle.context().address, SELECTOR_LOG_TRANSFER_OWNER, Into::::into(owner), - EvmDataWriter::new() - .write(Into::::into(target_new_owner)) - .build(), + solidity::encode_event_data(Into::::into(target_new_owner)) ) .record(handle)?; @@ -171,9 +169,7 @@ where log1( handle.context().address, SELECTOR_LOG_NEW_OWNER, - EvmDataWriter::new() - .write(Into::::into(target_new_owner)) - .build(), + solidity::encode_event_data(Into::::into(target_new_owner)) ) .record(handle)?; @@ -266,8 +262,8 @@ where if claimant == holder { return Ok(true); } - - let code = pallet_evm::Pallet::::account_codes::(holder.into()); + + let code = pallet_evm::AccountCodes::::get(Into::::into(holder)); if code.is_empty() { return Ok(false); @@ -344,7 +340,7 @@ where return Err(revert("sender is not owner")); } - let code = pallet_evm::Pallet::::account_codes::(holder.into()); + let code = pallet_evm::AccountCodes::::get(Into::::into(holder)); if code.is_empty() { return Err(revert("address is not a smartcontract")); diff --git a/precompiles/fee-rewards-vault-controller/src/tests.rs b/precompiles/fee-rewards-vault-controller/src/tests.rs index 1239a551..e9e5159d 100644 --- a/precompiles/fee-rewards-vault-controller/src/tests.rs +++ b/precompiles/fee-rewards-vault-controller/src/tests.rs @@ -58,7 +58,7 @@ fn owner_correctly_init() { ExtBuilder::default().build().execute_with(|| { precompiles() .prepare_test(DefaultOwner::get(), Precompile1, PCall::owner {}) - .execute_returns_encoded(Into::::into(DefaultOwner::get())); + .execute_returns(Into::::into(DefaultOwner::get())); }) } @@ -79,28 +79,28 @@ fn transfer_ownership_set_target_if_owner_twice() { DefaultOwner::get(), Precompile1, PCall::transfer_ownership { - new_owner: precompile_utils::data::Address(new_owner), + new_owner: solidity::codec::Address(new_owner), }, ) .execute_some(); precompiles() .prepare_test(DefaultOwner::get(), Precompile1, PCall::pending_owner {}) - .execute_returns_encoded(Into::::into(new_owner)); + .execute_returns(Into::::into(new_owner)); precompiles() .prepare_test( DefaultOwner::get(), Precompile1, PCall::transfer_ownership { - new_owner: precompile_utils::data::Address(other_owner), + new_owner: solidity::codec::Address(other_owner), }, ) .execute_some(); precompiles() .prepare_test(DefaultOwner::get(), Precompile1, PCall::pending_owner {}) - .execute_returns_encoded(Into::::into(other_owner)); + .execute_returns(Into::::into(other_owner)); }) } @@ -114,7 +114,7 @@ fn fail_transfer_ownership_if_not_owner() { new_owner, Precompile1, PCall::transfer_ownership { - new_owner: precompile_utils::data::Address(new_owner), + new_owner: solidity::codec::Address(new_owner), }, ) .execute_reverts(|x| x.eq_ignore_ascii_case(b"sender is not owner")); @@ -141,7 +141,7 @@ fn claim_ownership_if_claimable() { owner, Precompile1, PCall::transfer_ownership { - new_owner: precompile_utils::data::Address(new_owner), + new_owner: solidity::codec::Address(new_owner), }, ) .execute_some(); @@ -151,15 +151,13 @@ fn claim_ownership_if_claimable() { .expect_log(log1( Precompile1, SELECTOR_LOG_NEW_OWNER, - EvmDataWriter::new() - .write(Into::::into(new_owner)) - .build(), + solidity::encode_event_data(Into::::into(new_owner)) )) .execute_some(); precompiles() .prepare_test(new_owner, Precompile1, PCall::owner {}) - .execute_returns_encoded(Into::::into(new_owner)); + .execute_returns(Into::::into(new_owner)); }); } @@ -174,7 +172,7 @@ fn test_set_whitelisted() { holder: SmartContratWithoutOwner::get().into(), }, ) - .execute_returns_encoded(false); + .execute_returns(false); precompiles() .prepare_test( @@ -185,7 +183,7 @@ fn test_set_whitelisted() { is_whitelisted: true, }, ) - .execute_returns_encoded(true); + .execute_returns(true); precompiles() .prepare_test( @@ -195,7 +193,7 @@ fn test_set_whitelisted() { holder: SmartContratWithoutOwner::get().into(), }, ) - .execute_returns_encoded(true); + .execute_returns(true); }); } @@ -210,7 +208,7 @@ fn test_set_whitelisted_should_fail_if_address_is_not_smartcontract() { holder: NotOwner::get().into(), }, ) - .execute_returns_encoded(false); + .execute_returns(false); precompiles() .prepare_test( @@ -258,7 +256,7 @@ fn test_can_claim_reward_returns_true_if_holder_and_claimant_are_equal() { is_whitelisted: true, }, ) - .execute_returns_encoded(true); + .execute_returns(true); precompiles() .prepare_test( SmartContratWithoutOwner::get(), @@ -268,7 +266,7 @@ fn test_can_claim_reward_returns_true_if_holder_and_claimant_are_equal() { holder: SmartContratWithoutOwner::get().into(), }, ) - .execute_returns_encoded(true); + .execute_returns(true); }); } @@ -284,7 +282,7 @@ fn test_can_claim_reward_should_return_false_if_not_whitelisted() { holder: Dapp1::get().into(), }, ) - .execute_returns_encoded(false); + .execute_returns(false); }); } @@ -301,7 +299,7 @@ fn test_can_claim_reward_should_return_true_if_claimant_is_validator() { holder: claimant, }, ) - .execute_returns_encoded(true); + .execute_returns(true); }) } @@ -317,7 +315,7 @@ fn test_can_claim_reward_should_return_true_if_claimant_are_the_owner_of_the_dap is_whitelisted: true, }, ) - .execute_returns_encoded(true); + .execute_returns(true); precompiles() .prepare_test( OwnerOfDapp::get(), @@ -355,7 +353,7 @@ fn test_can_claim_reward_should_return_true_if_claimant_are_the_owner_of_the_dap logs: vec![], } }) - .execute_returns_encoded(true); + .execute_returns(true); }); } @@ -371,7 +369,7 @@ fn test_can_claim_reward_should_return_false_if_claimant_are_not_the_owner_of_th is_whitelisted: true, }, ) - .execute_returns_encoded(true); + .execute_returns(true); precompiles() .prepare_test( OwnerOfDapp::get(), @@ -409,7 +407,7 @@ fn test_can_claim_reward_should_return_false_if_claimant_are_not_the_owner_of_th logs: vec![], } }) - .execute_returns_encoded(false); + .execute_returns(false); }); } @@ -425,7 +423,7 @@ fn test_can_claim_reward_should_return_false_if_dapp_not_implement_owner_functio is_whitelisted: true, }, ) - .execute_returns_encoded(true); + .execute_returns(true); precompiles() .prepare_test( OwnerOfDapp::get(), @@ -438,7 +436,7 @@ fn test_can_claim_reward_should_return_false_if_dapp_not_implement_owner_functio .with_subcall_handle(move |_| { panic!("should not be called"); }) - .execute_returns_encoded(false); + .execute_returns(false); }); } @@ -466,7 +464,7 @@ fn test_get_claimable_reward() { token: Token1::get().into(), }, ) - .execute_returns_encoded(sp_core::U256::from(100)); + .execute_returns(sp_core::U256::from(100)); }); } @@ -484,7 +482,7 @@ fn test_claim_reward() { is_whitelisted: true, }, ) - .execute_returns_encoded(true); + .execute_returns(true); assert_eq!( FeeRewardsVault::get_claimable_reward(SmartContratWithoutOwner::get(), Token1::get()), @@ -577,7 +575,7 @@ fn test_set_validator_percentage() { Precompile1, PCall::get_validator_percentage {}, ) - .execute_returns_encoded(sp_core::U256::from(0)); + .execute_returns(sp_core::U256::from(0)); precompiles() .prepare_test( DefaultOwner::get(), @@ -593,7 +591,7 @@ fn test_set_validator_percentage() { Precompile1, PCall::get_validator_percentage {}, ) - .execute_returns_encoded(sp_core::U256::from(10)); + .execute_returns(sp_core::U256::from(10)); }); } diff --git a/precompiles/token-fee-controller/fee-token-selector/src/lib.rs b/precompiles/token-fee-controller/fee-token-selector/src/lib.rs index a3074b8a..7bae2396 100644 --- a/precompiles/token-fee-controller/fee-token-selector/src/lib.rs +++ b/precompiles/token-fee-controller/fee-token-selector/src/lib.rs @@ -65,13 +65,13 @@ where let msg_sender = handle.context().caller; if token_address == H160::zero().into() { - return Err(revert(b"UserFeeTokenController: zero address is invalid")); + return Err(revert("UserFeeTokenController: zero address is invalid")); } handle.record_cost(RuntimeHelper::::db_write_gas_cost())?; match UserFeeTokenController::set_user_fee_token(msg_sender.into(), token_address.into()) { Err(_) => { - return Err(revert(b"UserFeeTokenController: token not supported")); + return Err(revert("UserFeeTokenController: token not supported")); } _ => {} }; @@ -81,9 +81,7 @@ where handle.context().address, SELECTOR_LOG_FEE_CHANGED, msg_sender, - EvmDataWriter::new() - .write::(Into::::into(token_address).into()) - .build(), + solidity::encode_event_data(token_address) ) .record(handle)?; diff --git a/precompiles/token-fee-controller/fee-token-selector/src/tests.rs b/precompiles/token-fee-controller/fee-token-selector/src/tests.rs index 4c4098ca..8f8556b4 100644 --- a/precompiles/token-fee-controller/fee-token-selector/src/tests.rs +++ b/precompiles/token-fee-controller/fee-token-selector/src/tests.rs @@ -25,7 +25,7 @@ fn default_token_address() { address: Address(CryptoAlith.into()), }, ) - .execute_returns_encoded(Into::::into(MockDefaultFeeToken::get())); + .execute_returns(Into::::into(MockDefaultFeeToken::get())); }); } diff --git a/precompiles/token-fee-controller/supported-tokens-manager/src/lib.rs b/precompiles/token-fee-controller/supported-tokens-manager/src/lib.rs index d677a16a..6157d86e 100644 --- a/precompiles/token-fee-controller/supported-tokens-manager/src/lib.rs +++ b/precompiles/token-fee-controller/supported-tokens-manager/src/lib.rs @@ -172,7 +172,7 @@ where handle.context().address, SELECTOR_LOG_TOKEN_SUPPORT_CHANGE, Into::::into(token), - EvmDataWriter::new().write(true).build(), + solidity::encode_event_data(true), ) .record(handle)?; Ok(()) @@ -211,7 +211,7 @@ where handle.context().address, SELECTOR_LOG_TOKEN_SUPPORT_CHANGE, Into::::into(token), - EvmDataWriter::new().write(false).build(), + solidity::encode_event_data(false) ) .record(handle)?; @@ -299,9 +299,7 @@ where handle.context().address, SELECTOR_LOG_TRANSFER_OWNER, Into::::into(owner), - EvmDataWriter::new() - .write(Into::::into(target_new_owner)) - .build(), + solidity::encode_event_data(Into::::into(target_new_owner)) ) .record(handle)?; @@ -333,9 +331,7 @@ where log1( handle.context().address, SELECTOR_LOG_NEW_OWNER, - EvmDataWriter::new() - .write(Into::::into(target_new_owner)) - .build(), + solidity::encode_event_data(Into::::into(target_new_owner)) ) .record(handle)?; diff --git a/precompiles/token-fee-controller/supported-tokens-manager/src/mock.rs b/precompiles/token-fee-controller/supported-tokens-manager/src/mock.rs index d9a24935..83c408f2 100644 --- a/precompiles/token-fee-controller/supported-tokens-manager/src/mock.rs +++ b/precompiles/token-fee-controller/supported-tokens-manager/src/mock.rs @@ -144,6 +144,7 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); } // Configure a mock runtime to test the pallet. diff --git a/precompiles/token-fee-controller/supported-tokens-manager/src/tests.rs b/precompiles/token-fee-controller/supported-tokens-manager/src/tests.rs index 17fda29a..8788abdb 100644 --- a/precompiles/token-fee-controller/supported-tokens-manager/src/tests.rs +++ b/precompiles/token-fee-controller/supported-tokens-manager/src/tests.rs @@ -5,7 +5,6 @@ use pallet_supported_tokens_manager::SupportedTokensManager as SupportedTokensMa use precompile_utils::{ prelude::{log1, Address}, testing::{Precompile1, PrecompileTesterExt}, - EvmDataWriter, }; use sp_core::{H160, H256}; @@ -27,7 +26,7 @@ fn owner_correctly_init() { ExtBuilder::default().build().execute_with(|| { precompiles() .prepare_test(DefaultOwner::get(), Precompile1, PCall::owner {}) - .execute_returns_encoded(Into::::into(DefaultOwner::get())); + .execute_returns(Into::::into(DefaultOwner::get())); }) } @@ -48,28 +47,28 @@ fn transfer_ownership_set_target_if_owner_twice() { DefaultOwner::get(), Precompile1, PCall::transfer_ownership { - new_owner: precompile_utils::data::Address(new_owner), + new_owner: solidity::codec::Address(new_owner), }, ) .execute_some(); precompiles() .prepare_test(DefaultOwner::get(), Precompile1, PCall::pending_owner {}) - .execute_returns_encoded(Into::::into(new_owner)); + .execute_returns(Into::::into(new_owner)); precompiles() .prepare_test( DefaultOwner::get(), Precompile1, PCall::transfer_ownership { - new_owner: precompile_utils::data::Address(other_owner), + new_owner: solidity::codec::Address(other_owner), }, ) .execute_some(); precompiles() .prepare_test(DefaultOwner::get(), Precompile1, PCall::pending_owner {}) - .execute_returns_encoded(Into::::into(other_owner)); + .execute_returns(Into::::into(other_owner)); }) } @@ -83,7 +82,7 @@ fn fail_transfer_ownership_if_not_owner() { new_owner, Precompile1, PCall::transfer_ownership { - new_owner: precompile_utils::data::Address(new_owner), + new_owner: solidity::codec::Address(new_owner), }, ) .execute_reverts(|x| { @@ -114,7 +113,7 @@ fn claim_ownership_if_claimable() { owner, Precompile1, PCall::transfer_ownership { - new_owner: precompile_utils::data::Address(new_owner), + new_owner: solidity::codec::Address(new_owner), }, ) .execute_some(); @@ -124,15 +123,13 @@ fn claim_ownership_if_claimable() { .expect_log(log1( Precompile1, SELECTOR_LOG_NEW_OWNER, - EvmDataWriter::new() - .write(Into::::into(new_owner)) - .build(), + solidity::encode_event_data(Into::::into(new_owner)) )) .execute_some(); precompiles() .prepare_test(new_owner, Precompile1, PCall::owner {}) - .execute_returns_encoded(Into::::into(new_owner)); + .execute_returns(Into::::into(new_owner)); }); } @@ -145,7 +142,7 @@ fn fail_add_token_if_not_owner() { new_owner, Precompile1, PCall::add_token { - token: precompile_utils::data::Address(new_owner), + token: solidity::codec::Address(new_owner), slot: H256::from_low_u64_be(0), }, ) @@ -164,7 +161,7 @@ fn fail_remove_token_if_not_owner() { new_owner, Precompile1, PCall::remove_token { - token: precompile_utils::data::Address(new_owner), + token: solidity::codec::Address(new_owner), }, ) .execute_reverts(|x| { @@ -181,7 +178,7 @@ fn fail_add_token_if_already_added() { DefaultOwner::get(), Precompile1, PCall::add_token { - token: precompile_utils::data::Address(MeaninglessTokenAddress::get()), + token: solidity::codec::Address(MeaninglessTokenAddress::get()), slot: H256::from_low_u64_be(0), }, ) @@ -192,7 +189,7 @@ fn fail_add_token_if_already_added() { DefaultOwner::get(), Precompile1, PCall::add_token { - token: precompile_utils::data::Address(MeaninglessTokenAddress::get()), + token: solidity::codec::Address(MeaninglessTokenAddress::get()), slot: H256::from_low_u64_be(0), }, ) @@ -226,7 +223,7 @@ fn fail_remove_token_if_not_added() { DefaultOwner::get(), Precompile1, PCall::remove_token { - token: precompile_utils::data::Address(MeaninglessTokenAddress::get()), + token: solidity::codec::Address(MeaninglessTokenAddress::get()), }, ) .execute_reverts(|x| { @@ -248,7 +245,7 @@ fn zero_address_should_not_be_included_never() { token: sp_core::H160::zero().into(), }, ) - .execute_returns_encoded(false); + .execute_returns(false); }) } @@ -260,7 +257,7 @@ fn add_token_and_remove_after() { DefaultOwner::get(), Precompile1, PCall::add_token { - token: precompile_utils::data::Address(MeaninglessTokenAddress::get()), + token: solidity::codec::Address(MeaninglessTokenAddress::get()), slot: H256::from_low_u64_be(0), }, ) @@ -271,14 +268,14 @@ fn add_token_and_remove_after() { DefaultOwner::get(), Precompile1, PCall::is_token_supported { - token: precompile_utils::data::Address(MeaninglessTokenAddress::get()), + token: solidity::codec::Address(MeaninglessTokenAddress::get()), }, ) - .execute_returns_encoded(true); + .execute_returns(true); precompiles() .prepare_test(DefaultOwner::get(), Precompile1, PCall::supported_tokens {}) - .execute_returns_encoded(vec![ + .execute_returns(vec![ Address(InitialDefaultTokenFee::get()), Address(MeaninglessTokenAddress::get()), ]); @@ -288,7 +285,7 @@ fn add_token_and_remove_after() { DefaultOwner::get(), Precompile1, PCall::remove_token { - token: precompile_utils::data::Address(MeaninglessTokenAddress::get()), + token: solidity::codec::Address(MeaninglessTokenAddress::get()), }, ) .execute_some(); @@ -298,10 +295,10 @@ fn add_token_and_remove_after() { DefaultOwner::get(), Precompile1, PCall::is_token_supported { - token: precompile_utils::data::Address(MeaninglessTokenAddress::get()), + token: solidity::codec::Address(MeaninglessTokenAddress::get()), }, ) - .execute_returns_encoded(false); + .execute_returns(false); }); } diff --git a/precompiles/token-fee-controller/validator-fee-selector/src/lib.rs b/precompiles/token-fee-controller/validator-fee-selector/src/lib.rs index 05c11042..9e764d47 100644 --- a/precompiles/token-fee-controller/validator-fee-selector/src/lib.rs +++ b/precompiles/token-fee-controller/validator-fee-selector/src/lib.rs @@ -177,7 +177,7 @@ where SELECTOR_LOG_VALIDATOR_TOKEN_ACCEPTANCE_CHANGED, msg_sender, Into::::into(token_address), - EvmDataWriter::new().write(acceptance_value).build(), + solidity::encode_event_data(acceptance_value), ) .record(handle)?; @@ -220,7 +220,7 @@ where cr_controller.into(), ) .map_err(|_| { - revert(b"ValidatorFeeTokenController: default token conversion rate cannot be updated") + revert("ValidatorFeeTokenController: default token conversion rate cannot be updated") })?; handle.record_log_costs_manual(2, 64)?; @@ -228,7 +228,7 @@ where handle.context().address, SELECTOR_LOG_VALIDATOR_CONTROLLER_CHANGED, msg_sender, - EvmDataWriter::new().write(cr_controller).build(), + solidity::encode_event_data(cr_controller), ) .record(handle)?; @@ -312,9 +312,7 @@ where handle.context().address, SELECTOR_LOG_TRANSFER_OWNER, Into::::into(owner), - EvmDataWriter::new() - .write(Into::::into(target_new_owner)) - .build(), + solidity::encode_event_data(Into::::into(target_new_owner)) ) .record(handle)?; @@ -346,9 +344,7 @@ where log1( handle.context().address, SELECTOR_LOG_NEW_OWNER, - EvmDataWriter::new() - .write(Into::::into(target_new_owner)) - .build(), + solidity::encode_event_data(Into::::into(target_new_owner)) ) .record(handle)?; diff --git a/precompiles/token-fee-controller/validator-fee-selector/src/tests.rs b/precompiles/token-fee-controller/validator-fee-selector/src/tests.rs index 63ea4d81..705f92fd 100644 --- a/precompiles/token-fee-controller/validator-fee-selector/src/tests.rs +++ b/precompiles/token-fee-controller/validator-fee-selector/src/tests.rs @@ -1,7 +1,6 @@ use precompile_utils::{ prelude::{log1, log2, log3, Address}, testing::{CryptoAlith, Precompile1, PrecompileTesterExt}, - EvmDataWriter, }; use sp_core::{H160, H256}; @@ -26,7 +25,7 @@ fn owner_correctly_init() { ExtBuilder::default().build().execute_with(|| { precompiles() .prepare_test(DefaultOwner::get(), Precompile1, PCall::owner {}) - .execute_returns_encoded(Into::::into(DefaultOwner::get())); + .execute_returns(Into::::into(DefaultOwner::get())); }) } @@ -42,28 +41,28 @@ fn transfer_ownership_set_target_if_owner_twice() { DefaultOwner::get(), Precompile1, PCall::transfer_ownership { - new_owner: precompile_utils::data::Address(new_owner), + new_owner: solidity::codec::Address(new_owner), }, ) .execute_some(); precompiles() .prepare_test(DefaultOwner::get(), Precompile1, PCall::pending_owner {}) - .execute_returns_encoded(Into::::into(new_owner)); + .execute_returns(Into::::into(new_owner)); precompiles() .prepare_test( DefaultOwner::get(), Precompile1, PCall::transfer_ownership { - new_owner: precompile_utils::data::Address(other_owner), + new_owner: solidity::codec::Address(other_owner), }, ) .execute_some(); precompiles() .prepare_test(DefaultOwner::get(), Precompile1, PCall::pending_owner {}) - .execute_returns_encoded(Into::::into(other_owner)); + .execute_returns(Into::::into(other_owner)); }) } @@ -77,7 +76,7 @@ fn fail_transfer_ownership_if_not_owner() { new_owner, Precompile1, PCall::transfer_ownership { - new_owner: precompile_utils::data::Address(new_owner), + new_owner: solidity::codec::Address(new_owner), }, ) .execute_reverts(|x| { @@ -110,7 +109,7 @@ fn claim_ownership_if_claimable() { owner, Precompile1, PCall::transfer_ownership { - new_owner: precompile_utils::data::Address(new_owner), + new_owner: solidity::codec::Address(new_owner), }, ) .execute_some(); @@ -120,15 +119,13 @@ fn claim_ownership_if_claimable() { .expect_log(log1( Precompile1, SELECTOR_LOG_NEW_OWNER, - EvmDataWriter::new() - .write(Into::::into(new_owner)) - .build(), + solidity::encode_event_data(Into::::into(new_owner)) )) .execute_some(); precompiles() .prepare_test(new_owner, Precompile1, PCall::owner {}) - .execute_returns_encoded(Into::::into(new_owner)); + .execute_returns(Into::::into(new_owner)); }); } @@ -178,7 +175,7 @@ fn non_default_token_address() { token_address: MeaninglessTokenAddress::get().into(), }, ) - .execute_returns_encoded(DefaultAcceptance::get()); + .execute_returns(DefaultAcceptance::get()); precompiles() .prepare_test( @@ -199,7 +196,7 @@ fn non_default_token_address() { token_address: MeaninglessTokenAddress::get().into(), }, ) - .execute_returns_encoded(!DefaultAcceptance::get()); + .execute_returns(!DefaultAcceptance::get()); }); } @@ -231,7 +228,7 @@ fn default_token_address() { token_address: crate::mock::MockDefaultFeeToken::get().into(), }, ) - .execute_returns_encoded(true); + .execute_returns(true); precompiles() .prepare_test( @@ -253,7 +250,7 @@ fn default_token_address() { token_address: crate::mock::MockDefaultFeeToken::get().into(), }, ) - .execute_returns_encoded(false); + .execute_returns(false); }); } @@ -294,7 +291,7 @@ fn accept_token_and_revoke() { SELECTOR_LOG_VALIDATOR_TOKEN_ACCEPTANCE_CHANGED, H160::from(CryptoAlith), MeaninglessTokenAddress::get(), - EvmDataWriter::new().write(true).build(), + solidity::encode_event_data(true), )) .execute_some(); @@ -307,7 +304,7 @@ fn accept_token_and_revoke() { token_address: MeaninglessTokenAddress::get().into(), }, ) - .execute_returns_encoded(true); + .execute_returns(true); precompiles() .prepare_test( @@ -323,7 +320,7 @@ fn accept_token_and_revoke() { SELECTOR_LOG_VALIDATOR_TOKEN_ACCEPTANCE_CHANGED, H160::from(CryptoAlith), MeaninglessTokenAddress::get(), - EvmDataWriter::new().write(false).build(), + solidity::encode_event_data(false), )) .execute_some(); @@ -336,7 +333,7 @@ fn accept_token_and_revoke() { token_address: MeaninglessTokenAddress::get().into(), }, ) - .execute_returns_encoded(false); + .execute_returns(false); }); } @@ -356,7 +353,7 @@ fn default_conversion_rate() { validator: Address(CryptoAlith.into()), }, ) - .execute_returns_encoded(default); + .execute_returns(default); }) } @@ -394,9 +391,7 @@ fn update_conversion_rate_controller() { Precompile1, SELECTOR_LOG_VALIDATOR_CONTROLLER_CHANGED, H160::from(CryptoAlith), - EvmDataWriter::new() - .write(Address(MeaninglessTokenAddress::get())) - .build(), + solidity::encode_event_data(Address(MeaninglessTokenAddress::get())) )) .execute_some(); @@ -408,7 +403,7 @@ fn update_conversion_rate_controller() { validator: Address(CryptoAlith.into()), }, ) - .execute_returns_encoded(Address(MeaninglessTokenAddress::get())); + .execute_returns(Address(MeaninglessTokenAddress::get())); }) } diff --git a/precompiles/upgrade-runtime-controller/src/lib.rs b/precompiles/upgrade-runtime-controller/src/lib.rs index 970e1122..6494c2b9 100644 --- a/precompiles/upgrade-runtime-controller/src/lib.rs +++ b/precompiles/upgrade-runtime-controller/src/lib.rs @@ -130,9 +130,7 @@ where handle.context().address, SELECTOR_LOG_TRANSFER_OWNER, Into::::into(owner), - EvmDataWriter::new() - .write(Into::::into(target_new_owner)) - .build(), + solidity::encode_event_data(Into::::into(target_new_owner)) ) .record(handle)?; @@ -162,9 +160,7 @@ where log1( handle.context().address, SELECTOR_LOG_NEW_OWNER, - EvmDataWriter::new() - .write(Into::::into(target_new_owner)) - .build(), + solidity::encode_event_data(Into::::into(target_new_owner)) ) .record(handle)?; @@ -195,7 +191,7 @@ where log1( handle.context().address, SELECTOR_SETTED__APPLICATION_BLOCK, - EvmDataWriter::new().write(block_number).build(), + solidity::encode_event_data(block_number), ) .record(handle)?; diff --git a/precompiles/upgrade-runtime-controller/src/tests.rs b/precompiles/upgrade-runtime-controller/src/tests.rs index 954dcf65..acee9348 100644 --- a/precompiles/upgrade-runtime-controller/src/tests.rs +++ b/precompiles/upgrade-runtime-controller/src/tests.rs @@ -52,7 +52,7 @@ fn owner_correctly_init() { ExtBuilder::default().build().execute_with(|| { precompiles() .prepare_test(DefaultOwner::get(), Precompile1, PCall::owner {}) - .execute_returns_encoded(Into::::into(DefaultOwner::get())); + .execute_returns(Into::::into(DefaultOwner::get())); }) } @@ -73,28 +73,28 @@ fn transfer_ownership_set_target_if_owner_twice() { DefaultOwner::get(), Precompile1, PCall::transfer_ownership { - new_owner: precompile_utils::data::Address(new_owner), + new_owner: solidity::codec::Address(new_owner), }, ) .execute_some(); precompiles() .prepare_test(DefaultOwner::get(), Precompile1, PCall::pending_owner {}) - .execute_returns_encoded(Into::::into(new_owner)); + .execute_returns(Into::::into(new_owner)); precompiles() .prepare_test( DefaultOwner::get(), Precompile1, PCall::transfer_ownership { - new_owner: precompile_utils::data::Address(other_owner), + new_owner: solidity::codec::Address(other_owner), }, ) .execute_some(); precompiles() .prepare_test(DefaultOwner::get(), Precompile1, PCall::pending_owner {}) - .execute_returns_encoded(Into::::into(other_owner)); + .execute_returns(Into::::into(other_owner)); }) } @@ -108,7 +108,7 @@ fn fail_transfer_ownership_if_not_owner() { new_owner, Precompile1, PCall::transfer_ownership { - new_owner: precompile_utils::data::Address(new_owner), + new_owner: solidity::codec::Address(new_owner), }, ) .execute_reverts(|x| x.eq_ignore_ascii_case(b"sender is not owner")); @@ -135,7 +135,7 @@ fn claim_ownership_if_claimable() { owner, Precompile1, PCall::transfer_ownership { - new_owner: precompile_utils::data::Address(new_owner), + new_owner: solidity::codec::Address(new_owner), }, ) .execute_some(); @@ -145,15 +145,13 @@ fn claim_ownership_if_claimable() { .expect_log(log1( Precompile1, SELECTOR_LOG_NEW_OWNER, - EvmDataWriter::new() - .write(Into::::into(new_owner)) - .build(), + solidity::encode_event_data(Into::::into(new_owner)) )) .execute_some(); precompiles() .prepare_test(new_owner, Precompile1, PCall::owner {}) - .execute_returns_encoded(Into::::into(new_owner)); + .execute_returns(Into::::into(new_owner)); }); } @@ -182,9 +180,7 @@ fn test_set_block_application() { .expect_log(log1( Precompile1, SELECTOR_SETTED__APPLICATION_BLOCK, - EvmDataWriter::new() - .write(Into::::into(block_number)) - .build(), + solidity::encode_event_data(Into::::into(block_number)) )) .execute_some(); diff --git a/precompiles/utils/Cargo.toml b/precompiles/utils/Cargo.toml index 7972e0c5..4a2550db 100644 --- a/precompiles/utils/Cargo.toml +++ b/precompiles/utils/Cargo.toml @@ -1,55 +1,60 @@ [package] name = "precompile-utils" -authors = [ "PureStake" ] +authors = { workspace = true } description = "Utils to write EVM precompiles." edition = "2021" version = "0.1.0" [dependencies] -affix = "0.1.2" -derive_more = { version = "0.99", optional = true } -hex = { version = "0.4.3", default-features = false } -hex-literal = { version = "0.3.1", optional = true } -impl-trait-for-tuples = "0.2.2" -log = "0.4" -num_enum = { version = "0.5.3", default-features = false } -paste = "1.0.8" -scale-info = { version = "2.0", optional = true, default-features = false, features = [ "derive" ] } -serde = { version = "1.0.100", optional = true } -sha3 = { version = "0.10", default-features = false } -similar-asserts = { version = "1.1.0", optional = true } - - +affix = { workspace = true } +derive_more = { workspace = true, optional = true } +environmental = { workspace = true } +hex = { workspace = true } +hex-literal = { workspace = true, optional = true } +impl-trait-for-tuples = { workspace = true } +log = { workspace = true } +num_enum = { workspace = true } +paste = { workspace = true } +scale-info = { workspace = true, optional = true, features = [ "derive" ] } +serde = { workspace = true, optional = true } +sha3 = { workspace = true } +similar-asserts = { workspace = true, optional = true } + +# Moonbeam precompile-utils-macro = { path = "macro" } # Substrate -codec = { package = "parity-scale-codec", workspace = true, default-features = false, features = [ "max-encoded-len" ] } frame-support = { workspace = true } frame-system = { workspace = true } +parity-scale-codec = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } sp-std = { workspace = true } # Frontier -evm = { version = "0.37.0", default-features = false, features = [ "with-codec" ] } +evm = { workspace = true, features = [ "with-codec" ] } fp-evm = { workspace = true } pallet-evm = { workspace = true, features = [ "forbid-evm-reentrancy" ] } # Polkadot / XCM -xcm = { workspace = true } +xcm = { workspace = true, optional = true } [dev-dependencies] -hex-literal = "0.3.1" +hex-literal = { workspace = true } +xcm = { workspace = true } [features] default = [ "std" ] std = [ - "codec/std", + "environmental/std", "fp-evm/std", "frame-support/std", "frame-system/std", "pallet-evm/std", + "parity-scale-codec/std", "sp-core/std", + "sp-io/std", "sp-std/std", ] +codec-xcm = [ "xcm" ] testing = [ "derive_more", "hex-literal", "scale-info", "serde", "similar-asserts", "std" ] diff --git a/precompiles/utils/macro/Cargo.toml b/precompiles/utils/macro/Cargo.toml index d3c63f55..f27ee05b 100644 --- a/precompiles/utils/macro/Cargo.toml +++ b/precompiles/utils/macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "precompile-utils-macro" -authors = [ "Stability" ] +authors = { workspace = true } description = "" edition = "2021" version = "0.1.0" @@ -12,10 +12,6 @@ proc-macro = true name = "tests" path = "tests/tests.rs" -[[test]] -name = "precompile-macro" -path = "tests/precompile.rs" - [dependencies] case = "1.0" num_enum = { version = "0.5.3", default-features = false } @@ -32,6 +28,6 @@ trybuild = "1.0" precompile-utils = { path = "../", features = [ "testing" ] } fp-evm = { workspace = true } -frame-support = { workspace = true, default-features = false } +frame-support = { workspace = true } sp-core = { workspace = true } sp-std = { workspace = true } diff --git a/precompiles/utils/macro/docs/precompile_macro.md b/precompiles/utils/macro/docs/precompile_macro.md index 0ff7ec20..e72a4e00 100644 --- a/precompiles/utils/macro/docs/precompile_macro.md +++ b/precompiles/utils/macro/docs/precompile_macro.md @@ -4,7 +4,7 @@ This procedural macro allows to simplify the implementation of an EVM precompile using an `impl` block with annotations to automatically generate: - the implementation of the trait `Precompile` or `PrecompileSet` (exposed by the `fp_evm` crate) -- parsing of the method parameters from Solidity encoding into Rust type, based on the `EvmData` +- parsing of the method parameters from Solidity encoding into Rust type, based on the `solidity::Codec` trait (exposed by the `precompile-utils` crate) - a test to ensure the types expressed in the Solidity signature match the Rust types in the implementation. @@ -60,11 +60,11 @@ support renamed functions with backward compatibility, however the arguments mus type. It is not allowed to use the exact same signature multiple times. The function must take a `&mut impl PrecompileHandle` as parameter, followed by all the parameters -of the Solidity function in the same order. Those parameters types must implement `EvmData`, and +of the Solidity function in the same order. Those parameters types must implement `solidity::Codec`, and their name should match the one used in the Solidity interface (.sol) while being in `snake_case`, which will automatically be converted to `camelCase` in revert messages. The function must return an `EvmResult`, which is an alias of `Result`. This `T` must implement the -`EvmData` trait and must match the return type in the Solidity interface. The macro will +`solidity::Codec` trait and must match the return type in the Solidity interface. The macro will automatically encode it to Solidity format. By default those functions are considered non-payable and non-view (can cause state changes). This @@ -133,7 +133,7 @@ where ## Solidity signatures test The macro will automatically generate a unit test to ensure that the types expressed in a `public` -attribute matches the Rust parameters of the function, thanks to the `EvmData` trait having the +attribute matches the Rust parameters of the function, thanks to the `solidity::Codec` trait having the `solidity_type() -> String` function. If any **parsed** argument (discriminant is not concerned) depends on the type parameters of the diff --git a/precompiles/utils/macro/src/derive_codec.rs b/precompiles/utils/macro/src/derive_codec.rs new file mode 100644 index 00000000..e988e380 --- /dev/null +++ b/precompiles/utils/macro/src/derive_codec.rs @@ -0,0 +1,130 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +use proc_macro::TokenStream; +use proc_macro2::Span; +use quote::{quote, quote_spanned}; +use syn::{ + parse_macro_input, punctuated::Punctuated, spanned::Spanned, DeriveInput, Ident, LitStr, Path, + PathSegment, PredicateType, TraitBound, TraitBoundModifier, +}; + +pub fn main(input: TokenStream) -> TokenStream { + let DeriveInput { + ident, + mut generics, + data, + .. + } = parse_macro_input!(input as DeriveInput); + + let syn::Data::Struct (syn::DataStruct {fields: syn::Fields::Named(fields), ..}) = data else { + return quote_spanned! { ident.span() => + compile_error!("Codec can only be derived for structs with named fields"); + } + .into() + }; + let fields = fields.named; + + if fields.len() == 0 { + return quote_spanned! { ident.span() => + compile_error!("Codec can only be derived for structs with at least one field"); + } + .into(); + } + + if let Some(unamed_field) = fields.iter().find(|f| f.ident.is_none()) { + return quote_spanned! { unamed_field.ty.span() => + compile_error!("Codec can only be derived for structs with named fields"); + } + .into(); + } + + let fields_ty: Vec<_> = fields.iter().map(|f| &f.ty).collect(); + let fields_ident: Vec<_> = fields + .iter() + .map(|f| f.ident.as_ref().expect("None case checked above")) + .collect(); + let fields_name_lit: Vec<_> = fields_ident + .iter() + .map(|i| LitStr::new(&i.to_string(), i.span())) + .collect(); + + let evm_data_trait_path = { + let mut segments = Punctuated::::new(); + segments.push(Ident::new("precompile_utils", Span::call_site()).into()); + segments.push(Ident::new("solidity", Span::call_site()).into()); + segments.push(Ident::new("Codec", Span::call_site()).into()); + Path { + leading_colon: Some(Default::default()), + segments, + } + }; + let where_clause = generics.make_where_clause(); + + for ty in &fields_ty { + let mut bounds = Punctuated::new(); + bounds.push( + TraitBound { + paren_token: None, + modifier: TraitBoundModifier::None, + lifetimes: None, + path: evm_data_trait_path.clone(), + } + .into(), + ); + + where_clause.predicates.push( + PredicateType { + lifetimes: None, + bounded_ty: (*ty).clone(), + colon_token: Default::default(), + bounds, + } + .into(), + ); + } + + let (impl_generics, ty_generics, where_clause) = generics.split_for_impl(); + quote! { + impl #impl_generics ::precompile_utils::solidity::codec::Codec for #ident #ty_generics + #where_clause { + fn read( + reader: &mut ::precompile_utils::solidity::codec::Reader + ) -> ::precompile_utils::solidity::revert::MayRevert { + use ::precompile_utils::solidity::revert::BacktraceExt as _; + let (#(#fields_ident,)*): (#(#fields_ty,)*) = reader + .read() + .map_in_tuple_to_field(&[#(#fields_name_lit),*])?; + Ok(Self { + #(#fields_ident,)* + }) + } + + fn write(writer: &mut ::precompile_utils::solidity::codec::Writer, value: Self) { + ::precompile_utils::solidity::codec::Codec::write(writer, (#(value.#fields_ident,)*)); + } + + fn has_static_size() -> bool { + <(#(#fields_ty,)*)>::has_static_size() + } + + fn signature() -> String { + <(#(#fields_ty,)*)>::signature() + } + } + } + .into() +} diff --git a/precompiles/utils/macro/src/generate_function_selector.rs b/precompiles/utils/macro/src/generate_function_selector.rs index 82a494d0..405db1e0 100644 --- a/precompiles/utils/macro/src/generate_function_selector.rs +++ b/precompiles/utils/macro/src/generate_function_selector.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use super::*; pub fn main(_: TokenStream, input: TokenStream) -> TokenStream { @@ -44,20 +45,20 @@ pub fn main(_: TokenStream, input: TokenStream) -> TokenStream { variant_attrs.push(variant.attrs); } else { return quote_spanned! { - lit.span() => compile_error("Expected literal string"); + lit.span() => compile_error!("Expected literal string"); } .into(); } } Some((_eg, expr)) => { return quote_spanned! { - expr.span() => compile_error("Expected literal"); + expr.span() => compile_error!("Expected literal"); } .into() } None => { return quote_spanned! { - variant.span() => compile_error("Each variant must have a discriminant"); + variant.span() => compile_error!("Each variant must have a discriminant"); } .into() } diff --git a/precompiles/utils/macro/src/lib.rs b/precompiles/utils/macro/src/lib.rs index 6e1bffa8..92144828 100644 --- a/precompiles/utils/macro/src/lib.rs +++ b/precompiles/utils/macro/src/lib.rs @@ -1,31 +1,28 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + #![crate_type = "proc-macro"] extern crate proc_macro; use proc_macro::TokenStream; -use proc_macro2::Literal; use quote::{quote, quote_spanned}; use sha3::{Digest, Keccak256}; -use syn::{ - parse_macro_input, spanned::Spanned, Attribute, Expr, ExprLit, Ident, ItemEnum, ItemType, Lit, - LitStr, -}; +use syn::{parse_macro_input, spanned::Spanned, Expr, Ident, ItemType, Lit, LitStr}; -mod generate_function_selector; +mod derive_codec; mod precompile; mod precompile_name_from_address; @@ -63,35 +60,6 @@ pub fn keccak256(input: TokenStream) -> TokenStream { quote!(#eval_ts).into() } -/// This macro allows to associate to each variant of an enumeration a discriminant (of type u32 -/// whose value corresponds to the first 4 bytes of the Hash Keccak256 of the character string -///indicated by the user of this macro. -/// -/// Usage: -/// -/// ```ignore -/// #[generate_function_selector] -/// enum Action { -/// Toto = "toto()", -/// Tata = "tata()", -/// } -/// ``` -/// -/// Extended to: -/// -/// ```rust -/// #[repr(u32)] -/// enum Action { -/// Toto = 119097542u32, -/// Tata = 1414311903u32, -/// } -/// ``` -/// -#[proc_macro_attribute] -pub fn generate_function_selector(attr: TokenStream, input: TokenStream) -> TokenStream { - generate_function_selector::main(attr, input) -} - #[proc_macro_attribute] pub fn precompile(attr: TokenStream, input: TokenStream) -> TokenStream { precompile::main(attr, input) @@ -101,3 +69,8 @@ pub fn precompile(attr: TokenStream, input: TokenStream) -> TokenStream { pub fn precompile_name_from_address(attr: TokenStream, input: TokenStream) -> TokenStream { precompile_name_from_address::main(attr, input) } + +#[proc_macro_derive(Codec)] +pub fn derive_codec(input: TokenStream) -> TokenStream { + derive_codec::main(input) +} diff --git a/precompiles/utils/macro/src/precompile/attr.rs b/precompiles/utils/macro/src/precompile/attr.rs index f29d8808..db29087b 100644 --- a/precompiles/utils/macro/src/precompile/attr.rs +++ b/precompiles/utils/macro/src/precompile/attr.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use proc_macro2::Span; use quote::ToTokens; use syn::spanned::Spanned; diff --git a/precompiles/utils/macro/src/precompile/expand.rs b/precompiles/utils/macro/src/precompile/expand.rs index 3c79f5bf..e12eba6f 100644 --- a/precompiles/utils/macro/src/precompile/expand.rs +++ b/precompiles/utils/macro/src/precompile/expand.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use super::*; impl Precompile { @@ -62,7 +63,10 @@ impl Precompile { )* #[doc(hidden)] - __phantom(PhantomData<( #( #type_parameters ),* )>, ::core::convert::Infallible), + __phantom( + ::core::marker::PhantomData<( #( #type_parameters ),* )>, + ::core::convert::Infallible + ), } ) } @@ -86,8 +90,8 @@ impl Precompile { let modifier = syn::Ident::new(modifier, span); quote!( - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::#modifier)?; ) }); @@ -104,7 +108,7 @@ impl Precompile { fn #fn_parse( handle: &mut impl PrecompileHandle ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; + use ::precompile_utils::solidity::revert::InjectBacktrace; #modifier_check #variant_parsing @@ -114,7 +118,7 @@ impl Precompile { } /// Generates the parsing code for a variant, reading the input from the handle and - /// parsing it using EvmDataReader. + /// parsing it using Reader. fn expand_variant_parsing_from_handle( variant_ident: &syn::Ident, variant: &Variant, @@ -214,7 +218,7 @@ impl Precompile { )* pub fn encode(self) -> ::sp_std::vec::Vec { - use ::precompile_utils::EvmDataWriter; + use ::precompile_utils::solidity::codec::Writer; match self { #( Self::#variants_ident2 { #(#variants_list),* } => { @@ -266,11 +270,11 @@ impl Precompile { .as_ref() .map(|_| quote!(discriminant,)); - let write_output = - quote_spanned!(output_span=> EvmDataWriter::new().write(output?).build()); + let write_output = quote_spanned!(output_span=> + ::precompile_utils::solidity::encode_return_value(output?) + ); quote!( - use ::precompile_utils::EvmDataWriter; let output = <#impl_type>::#variant_ident( #opt_discriminant_arg handle, @@ -286,7 +290,7 @@ impl Precompile { #opt_discriminant_arg handle: &mut impl PrecompileHandle ) -> ::precompile_utils::EvmResult<::fp_evm::PrecompileOutput> { - use ::precompile_utils::data::EvmDataWriter; + use ::precompile_utils::solidity::codec::Writer; use ::fp_evm::{PrecompileOutput, ExitSucceed}; let output = match self { @@ -317,7 +321,7 @@ impl Precompile { }); quote!( - EvmDataWriter::new_with_selector(#selector) + Writer::new_with_selector(#selector) #(#write_arguments)* .build() ) @@ -352,7 +356,7 @@ impl Precompile { pub fn parse_call_data( handle: &mut impl PrecompileHandle ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::RevertReason; + use ::precompile_utils::solidity::revert::RevertReason; let input = handle.input(); @@ -397,11 +401,24 @@ impl Precompile { &self, handle: &mut impl PrecompileHandle ) -> Option<::precompile_utils::EvmResult<::fp_evm::PrecompileOutput>> { - let discriminant = match <#impl_type>::#discriminant_fn( - handle.code_address() - ) { - Some(d) => d, - None => return None, + use ::precompile_utils::precompile_set::DiscriminantResult; + + let discriminant = <#impl_type>::#discriminant_fn( + handle.code_address(), + handle.remaining_gas() + ); + + if let DiscriminantResult::Some(_, cost) | DiscriminantResult::None(cost) = discriminant { + let result = handle.record_cost(cost); + if let Err(e) = result { + return Some(Err(e.into())); + } + } + + let discriminant = match discriminant { + DiscriminantResult::Some(d, _) => d, + DiscriminantResult::None(cost) => return None, + DiscriminantResult::OutOfGas => return Some(Err(ExitError::OutOfGas.into())) }; #opt_pre_check @@ -412,8 +429,8 @@ impl Precompile { ) } - fn is_precompile(&self, address: H160) -> bool { - <#impl_type>::#discriminant_fn(address).is_some() + fn is_precompile(&self, address: H160, gas: u64) -> ::fp_evm::IsPrecompileResult { + <#impl_type>::#discriminant_fn(address, gas).into() } } ) @@ -458,7 +475,7 @@ impl Precompile { quote_spanned!(span=> assert_eq!( #solidity, - <(#(#types,)*) as EvmData>::solidity_type(), + <(#(#types,)*) as Codec>::signature(), "{} function signature doesn't match (left: attribute, right: computed \ from Rust types)", #name @@ -476,7 +493,7 @@ impl Precompile { quote!( #[allow(non_snake_case)] pub(crate) fn #inner_name #impl_generics () #where_clause { - use ::precompile_utils::data::EvmData; + use ::precompile_utils::solidity::Codec; #(#variant_test)* } @@ -491,7 +508,7 @@ impl Precompile { quote!( #[allow(non_snake_case)] pub(crate) fn #inner_name() { - use ::precompile_utils::data::EvmData; + use ::precompile_utils::solidity::Codec; #(#variant_test)* } diff --git a/precompiles/utils/macro/src/precompile/mod.rs b/precompiles/utils/macro/src/precompile/mod.rs index 50a5f0c1..4cd63ed2 100644 --- a/precompiles/utils/macro/src/precompile/mod.rs +++ b/precompiles/utils/macro/src/precompile/mod.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + #![doc = include_str!("../../docs/precompile_macro.md")] use proc_macro::TokenStream; @@ -105,7 +106,7 @@ struct Variant { /// A unit test will be generated to check that this selector matches /// the Rust arguments. /// - /// > EvmData trait allows to generate this string at runtime only. Thus + /// > solidity::Codec trait allows to generate this string at runtime only. Thus /// > it is required to write it manually in the selector attribute, and /// > a unit test is generated to check it matches. solidity_arguments_type: String, diff --git a/precompiles/utils/macro/src/precompile/parse.rs b/precompiles/utils/macro/src/precompile/parse.rs index 8b162e55..3a644912 100644 --- a/precompiles/utils/macro/src/precompile/parse.rs +++ b/precompiles/utils/macro/src/precompile/parse.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use super::*; impl Precompile { @@ -274,6 +275,7 @@ impl Precompile { } }; let ty = input.ty.as_ref().clone(); + self.check_type_parameter_usage(&ty)?; arguments.push(Argument { ident, ty }) } @@ -407,13 +409,13 @@ impl Precompile { let span = method.sig.span(); - if method.sig.inputs.len() != 1 { - let msg = "The discriminant function must only take the code address (H160) as \ - parameter."; + if method.sig.inputs.len() != 2 { + let msg = "The discriminant function must only take code address (H160) and \ + remaining gas (u64) as parameters."; return Err(syn::Error::new(span, msg)); } - let msg = "The discriminant function must return an Option<_> (no type alias)"; + let msg = "The discriminant function must return an DiscriminantResult<_> (no type alias)"; let return_type = match &method.sig.output { syn::ReturnType::Type(_, t) => t.as_ref(), @@ -437,23 +439,23 @@ impl Precompile { let return_segment = &return_path.segments[0]; - if return_segment.ident.to_string() != "Option" { + if return_segment.ident.to_string() != "DiscriminantResult" { return Err(syn::Error::new(return_segment.ident.span(), msg)); } - let option_arguments = match &return_segment.arguments { + let result_arguments = match &return_segment.arguments { syn::PathArguments::AngleBracketed(args) => args, _ => return Err(syn::Error::new(return_segment.ident.span(), msg)), }; - if option_arguments.args.len() != 1 { - let msg = "Option type should only have 1 type argument"; - return Err(syn::Error::new(option_arguments.args.span(), msg)); + if result_arguments.args.len() != 1 { + let msg = "DiscriminantResult type should only have 1 type argument"; + return Err(syn::Error::new(result_arguments.args.span(), msg)); } - let discriminant_type: &syn::Type = match &option_arguments.args[0] { + let discriminant_type: &syn::Type = match &result_arguments.args[0] { syn::GenericArgument::Type(t) => t, - _ => return Err(syn::Error::new(option_arguments.args.span(), msg)), + _ => return Err(syn::Error::new(result_arguments.args.span(), msg)), }; self.try_register_discriminant_type(&discriminant_type)?; @@ -535,6 +537,78 @@ impl Precompile { Ok(selector) } + + /// Check that the provided type doesn't depend on one of the type parameters of the + /// precompile. Check is skipped if `test_concrete_types` attribute is used. + fn check_type_parameter_usage(&self, ty: &syn::Type) -> syn::Result<()> { + if self.test_concrete_types.is_some() { + return Ok(()); + } + + const ERR_MESSAGE: &'static str = + "impl type parameter is used in functions arguments. Arguments should not have a type +depending on a type parameter, unless it is a length bound for BoundedBytes, +BoundedString or alike, which doesn't affect the Solidity type. + +In that case, you must add a #[precompile::test_concrete_types(...)] attribute on the impl +block to provide concrete types that will be used to run the automatically generated tests +ensuring the Solidity function signatures are correct."; + + match ty { + syn::Type::Array(syn::TypeArray { elem, .. }) + | syn::Type::Group(syn::TypeGroup { elem, .. }) + | syn::Type::Paren(syn::TypeParen { elem, .. }) + | syn::Type::Reference(syn::TypeReference { elem, .. }) + | syn::Type::Ptr(syn::TypePtr { elem, .. }) + | syn::Type::Slice(syn::TypeSlice { elem, .. }) => self.check_type_parameter_usage(&elem)?, + + syn::Type::Path(syn::TypePath { + path: syn::Path { segments, .. }, + .. + }) => { + let impl_params: Vec<_> = self + .generics + .params + .iter() + .filter_map(|param| match param { + syn::GenericParam::Type(syn::TypeParam { ident, .. }) => Some(ident), + _ => None, + }) + .collect(); + + for segment in segments { + if impl_params.contains(&&segment.ident) { + return Err(syn::Error::new(segment.ident.span(), ERR_MESSAGE)); + } + + if let syn::PathArguments::AngleBracketed(args) = &segment.arguments { + let types = args.args.iter().filter_map(|arg| match arg { + syn::GenericArgument::Type(ty) + | syn::GenericArgument::Binding(syn::Binding { ty, .. }) => Some(ty), + _ => None, + }); + + for ty in types { + self.check_type_parameter_usage(&ty)?; + } + } + } + } + syn::Type::Tuple(tuple) => { + for ty in tuple.elems.iter() { + self.check_type_parameter_usage(ty)?; + } + } + // BareFn => very unlikely this appear as parameter + // ImplTrait => will cause other errors, it must be a concrete type + // TypeInfer => it must be explicit concrete types since it ends up in enum fields + // Macro => Cannot check easily + // Never => Function will not be callable. + ty => println!("Skipping type parameter check for non supported kind of type: {ty:?}"), + } + + Ok(()) + } } /// Helper to check 2 types are equal. diff --git a/precompiles/utils/macro/src/precompile_name_from_address.rs b/precompiles/utils/macro/src/precompile_name_from_address.rs index 90ba01e3..27ce5f11 100644 --- a/precompiles/utils/macro/src/precompile_name_from_address.rs +++ b/precompiles/utils/macro/src/precompile_name_from_address.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use super::*; use syn::{GenericArgument, Type}; @@ -44,7 +45,7 @@ pub fn main(_: TokenStream, input: TokenStream) -> TokenStream { #(#attrs)* #vis #type_token #ident #generics #eq_token #ty #semi_token - #[derive(num_enum::TryFromPrimitive, num_enum::IntoPrimitive)] + #[derive(num_enum::TryFromPrimitive, num_enum::IntoPrimitive, Debug)] #[repr(u64)] pub enum PrecompileName { #( @@ -67,7 +68,7 @@ pub fn main(_: TokenStream, input: TokenStream) -> TokenStream { .into() } else { return quote_spanned! { - ty.span() => compile_error("Expected tuple"); + ty.span() => compile_error!("Expected tuple"); } .into(); } diff --git a/precompiles/utils/macro/tests/compile-fail/derive_codec/empty_struct.rs b/precompiles/utils/macro/tests/compile-fail/derive_codec/empty_struct.rs new file mode 100644 index 00000000..ea2cd462 --- /dev/null +++ b/precompiles/utils/macro/tests/compile-fail/derive_codec/empty_struct.rs @@ -0,0 +1,28 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +use precompile_utils::prelude::*; + +#[derive(solidity::Codec)] +struct Empty1; + +#[derive(solidity::Codec)] +struct Empty2 {} + +#[derive(solidity::Codec)] +struct Empty3 (); + +fn main() {} \ No newline at end of file diff --git a/precompiles/utils/macro/tests/compile-fail/derive_codec/empty_struct.stderr b/precompiles/utils/macro/tests/compile-fail/derive_codec/empty_struct.stderr new file mode 100644 index 00000000..8c0a9d8b --- /dev/null +++ b/precompiles/utils/macro/tests/compile-fail/derive_codec/empty_struct.stderr @@ -0,0 +1,17 @@ +error: Codec can only be derived for structs with named fields + --> tests/compile-fail/derive_codec/empty_struct.rs:20:8 + | +20 | struct Empty1; + | ^^^^^^ + +error: Codec can only be derived for structs with at least one field + --> tests/compile-fail/derive_codec/empty_struct.rs:23:8 + | +23 | struct Empty2 {} + | ^^^^^^ + +error: Codec can only be derived for structs with named fields + --> tests/compile-fail/derive_codec/empty_struct.rs:26:8 + | +26 | struct Empty3 (); + | ^^^^^^ diff --git a/precompiles/utils/macro/tests/compile-fail/derive_codec/enum.rs b/precompiles/utils/macro/tests/compile-fail/derive_codec/enum.rs new file mode 100644 index 00000000..de0a7a61 --- /dev/null +++ b/precompiles/utils/macro/tests/compile-fail/derive_codec/enum.rs @@ -0,0 +1,26 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +use precompile_utils::prelude::*; + +#[derive(solidity::Codec)] +enum Test { + One, + Two(u8), + Three { test: u16 } +} + +fn main() {} \ No newline at end of file diff --git a/precompiles/utils/macro/tests/compile-fail/derive_codec/enum.stderr b/precompiles/utils/macro/tests/compile-fail/derive_codec/enum.stderr new file mode 100644 index 00000000..42a65d4a --- /dev/null +++ b/precompiles/utils/macro/tests/compile-fail/derive_codec/enum.stderr @@ -0,0 +1,5 @@ +error: Codec can only be derived for structs with named fields + --> tests/compile-fail/derive_codec/enum.rs:20:6 + | +20 | enum Test { + | ^^^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/evm-data/arg-dont-impl-evmdata.rs b/precompiles/utils/macro/tests/compile-fail/precompile/codec/arg-dont-impl-codec.rs similarity index 72% rename from precompiles/utils/macro/tests/precompile/compile-fail/evm-data/arg-dont-impl-evmdata.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/codec/arg-dont-impl-codec.rs index 33263f56..d37fda0e 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/evm-data/arg-dont-impl-evmdata.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/codec/arg-dont-impl-codec.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; use fp_evm::PrecompileHandle; use precompile_utils::EvmResult; @@ -27,4 +28,4 @@ impl Precompile { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/evm-data/arg-dont-impl-evmdata.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/codec/arg-dont-impl-codec.stderr similarity index 59% rename from precompiles/utils/macro/tests/precompile/compile-fail/evm-data/arg-dont-impl-evmdata.stderr rename to precompiles/utils/macro/tests/compile-fail/precompile/codec/arg-dont-impl-codec.stderr index b4146c2d..1e87e3c7 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/evm-data/arg-dont-impl-evmdata.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/codec/arg-dont-impl-codec.stderr @@ -1,10 +1,10 @@ -error[E0277]: the trait bound `String: EvmData` is not satisfied - --> tests/precompile/compile-fail/evm-data/arg-dont-impl-evmdata.rs:25:43 +error[E0277]: the trait bound `String: Codec` is not satisfied + --> tests/compile-fail/precompile/codec/arg-dont-impl-codec.rs:26:43 | -25 | fn foo(test: &mut impl PrecompileHandle, arg: String) -> EvmResult { - | ^^^ the trait `EvmData` is not implemented for `String` +26 | fn foo(test: &mut impl PrecompileHandle, arg: String) -> EvmResult { + | ^^^ the trait `Codec` is not implemented for `String` | - = help: the following other types implement trait `EvmData`: + = help: the following other types implement trait `Codec`: () (TupleElement0, TupleElement1) (TupleElement0, TupleElement1, TupleElement2) @@ -14,19 +14,19 @@ error[E0277]: the trait bound `String: EvmData` is not satisfied (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6) (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7) and $N others -note: required by a bound in `EvmDataReader::<'a>::read` - --> $WORKSPACE/precompiles/utils/src/data/mod.rs +note: required by a bound in `Reader::<'inner>::read` + --> $WORKSPACE/precompiles/utils/src/solidity/codec/mod.rs | - | pub fn read(&mut self) -> MayRevert { - | ^^^^^^^ required by this bound in `EvmDataReader::<'a>::read` + | pub fn read(&mut self) -> MayRevert { + | ^^^^^ required by this bound in `Reader::<'inner>::read` -error[E0277]: the trait bound `String: EvmData` is not satisfied - --> tests/precompile/compile-fail/evm-data/arg-dont-impl-evmdata.rs:25:43 +error[E0277]: the trait bound `String: Codec` is not satisfied + --> tests/compile-fail/precompile/codec/arg-dont-impl-codec.rs:26:43 | -25 | fn foo(test: &mut impl PrecompileHandle, arg: String) -> EvmResult { - | ^^^ the trait `EvmData` is not implemented for `String` +26 | fn foo(test: &mut impl PrecompileHandle, arg: String) -> EvmResult { + | ^^^ the trait `Codec` is not implemented for `String` | - = help: the following other types implement trait `EvmData`: + = help: the following other types implement trait `Codec`: () (TupleElement0, TupleElement1) (TupleElement0, TupleElement1, TupleElement2) @@ -36,19 +36,19 @@ error[E0277]: the trait bound `String: EvmData` is not satisfied (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6) (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7) and $N others -note: required by a bound in `EvmDataWriter::write` - --> $WORKSPACE/precompiles/utils/src/data/mod.rs +note: required by a bound in `precompile_utils::solidity::codec::Writer::write` + --> $WORKSPACE/precompiles/utils/src/solidity/codec/mod.rs | - | pub fn write(mut self, value: T) -> Self { - | ^^^^^^^ required by this bound in `EvmDataWriter::write` + | pub fn write(mut self, value: T) -> Self { + | ^^^^^ required by this bound in `Writer::write` -error[E0277]: the trait bound `String: EvmData` is not satisfied - --> tests/precompile/compile-fail/evm-data/arg-dont-impl-evmdata.rs:25:5 +error[E0277]: the trait bound `String: Codec` is not satisfied + --> tests/compile-fail/precompile/codec/arg-dont-impl-codec.rs:26:5 | -25 | fn foo(test: &mut impl PrecompileHandle, arg: String) -> EvmResult { - | ^^^ the trait `EvmData` is not implemented for `String` +26 | fn foo(test: &mut impl PrecompileHandle, arg: String) -> EvmResult { + | ^^^ the trait `Codec` is not implemented for `String` | - = help: the following other types implement trait `EvmData`: + = help: the following other types implement trait `Codec`: () (TupleElement0, TupleElement1) (TupleElement0, TupleElement1, TupleElement2) @@ -58,4 +58,4 @@ error[E0277]: the trait bound `String: EvmData` is not satisfied (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6) (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7) and $N others - = note: required for `(String,)` to implement `EvmData` + = note: required for `(String,)` to implement `Codec` diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/evm-data/no-output.rs b/precompiles/utils/macro/tests/compile-fail/precompile/codec/no-output.rs similarity index 69% rename from precompiles/utils/macro/tests/precompile/compile-fail/evm-data/no-output.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/codec/no-output.rs index e51e1513..1f0ab2ae 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/evm-data/no-output.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/codec/no-output.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; pub struct Precompile(PhantomData); @@ -25,4 +26,4 @@ impl Precompile { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/codec/no-output.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/codec/no-output.stderr new file mode 100644 index 00000000..7a2758d0 --- /dev/null +++ b/precompiles/utils/macro/tests/compile-fail/precompile/codec/no-output.stderr @@ -0,0 +1,5 @@ +error: A precompile method must have a return type of `EvmResult<_>` (exposed by `precompile_utils`) + --> tests/compile-fail/precompile/codec/no-output.rs:24:2 + | +24 | fn foo(test: &mut impl PrecompileHandle) { + | ^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/evm-data/output-dont-impl-evmdata.rs b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-dont-impl-codec.rs similarity index 71% rename from precompiles/utils/macro/tests/precompile/compile-fail/evm-data/output-dont-impl-evmdata.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/codec/output-dont-impl-codec.rs index 9fb36801..bb7ffb72 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/evm-data/output-dont-impl-evmdata.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-dont-impl-codec.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; use fp_evm::PrecompileHandle; use precompile_utils::EvmResult; @@ -27,4 +28,4 @@ impl Precompile { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/evm-data/output-dont-impl-evmdata.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-dont-impl-codec.stderr similarity index 51% rename from precompiles/utils/macro/tests/precompile/compile-fail/evm-data/output-dont-impl-evmdata.stderr rename to precompiles/utils/macro/tests/compile-fail/precompile/codec/output-dont-impl-codec.stderr index fcf1778b..52ba67e6 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/evm-data/output-dont-impl-evmdata.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-dont-impl-codec.stderr @@ -1,10 +1,10 @@ -error[E0277]: the trait bound `String: EvmData` is not satisfied - --> tests/precompile/compile-fail/evm-data/output-dont-impl-evmdata.rs:25:46 +error[E0277]: the trait bound `String: Codec` is not satisfied + --> tests/compile-fail/precompile/codec/output-dont-impl-codec.rs:26:46 | -25 | fn foo(test: &mut impl PrecompileHandle) -> EvmResult { - | ^^^^^^^^^^^^^^^^^ the trait `EvmData` is not implemented for `String` +26 | fn foo(test: &mut impl PrecompileHandle) -> EvmResult { + | ^^^^^^^^^ the trait `Codec` is not implemented for `String` | - = help: the following other types implement trait `EvmData`: + = help: the following other types implement trait `Codec`: () (TupleElement0, TupleElement1) (TupleElement0, TupleElement1, TupleElement2) @@ -14,8 +14,8 @@ error[E0277]: the trait bound `String: EvmData` is not satisfied (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6) (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7) and $N others -note: required by a bound in `EvmDataWriter::write` - --> $WORKSPACE/precompiles/utils/src/data/mod.rs +note: required by a bound in `encode_arguments` + --> $WORKSPACE/precompiles/utils/src/solidity/codec/mod.rs | - | pub fn write(mut self, value: T) -> Self { - | ^^^^^^^ required by this bound in `EvmDataWriter::write` + | pub fn encode_arguments(value: T) -> Vec { + | ^^^^^ required by this bound in `encode_arguments` diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/evm-data/output-not-result.rs b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-not-result.rs similarity index 70% rename from precompiles/utils/macro/tests/precompile/compile-fail/evm-data/output-not-result.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/codec/output-not-result.rs index b17a88ac..686f3bd0 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/evm-data/output-not-result.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-not-result.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; use fp_evm::PrecompileHandle; @@ -26,4 +27,4 @@ impl Precompile { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/evm-data/output-not-result.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-not-result.stderr similarity index 66% rename from precompiles/utils/macro/tests/precompile/compile-fail/evm-data/output-not-result.stderr rename to precompiles/utils/macro/tests/compile-fail/precompile/codec/output-not-result.stderr index 1cc47098..c104ae8f 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/evm-data/output-not-result.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-not-result.stderr @@ -1,7 +1,7 @@ error[E0277]: the `?` operator can only be applied to values that implement `Try` - --> tests/precompile/compile-fail/evm-data/output-not-result.rs:24:46 + --> tests/compile-fail/precompile/codec/output-not-result.rs:25:46 | -24 | fn foo(test: &mut impl PrecompileHandle) -> String { +25 | fn foo(test: &mut impl PrecompileHandle) -> String { | ^^^^^^ the `?` operator cannot be applied to type `String` | = help: the trait `Try` is not implemented for `String` diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/evm-data/output-wrong-error-result.rs b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-wrong-error-result.rs similarity index 71% rename from precompiles/utils/macro/tests/precompile/compile-fail/evm-data/output-wrong-error-result.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/codec/output-wrong-error-result.rs index df712e0d..df90aadd 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/evm-data/output-wrong-error-result.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-wrong-error-result.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; use fp_evm::PrecompileHandle; @@ -26,4 +27,4 @@ impl Precompile { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/evm-data/output-wrong-error-result.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-wrong-error-result.stderr similarity index 61% rename from precompiles/utils/macro/tests/precompile/compile-fail/evm-data/output-wrong-error-result.stderr rename to precompiles/utils/macro/tests/compile-fail/precompile/codec/output-wrong-error-result.stderr index d0b7f195..fa1fc8f7 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/evm-data/output-wrong-error-result.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-wrong-error-result.stderr @@ -1,13 +1,13 @@ error[E0277]: `?` couldn't convert the error to `PrecompileFailure` - --> tests/precompile/compile-fail/evm-data/output-wrong-error-result.rs:24:63 + --> tests/compile-fail/precompile/codec/output-wrong-error-result.rs:25:51 | -24 | fn foo(test: &mut impl PrecompileHandle) -> Result<(), String> { - | ^ the trait `From` is not implemented for `PrecompileFailure` +25 | fn foo(test: &mut impl PrecompileHandle) -> Result<(), String> { + | ^ the trait `From` is not implemented for `PrecompileFailure` | = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait = help: the following other types implement trait `From`: > > > - > + > = note: required for `Result` to implement `FromResidual>` diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/dont-return-option.rs b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/dont-return-option.rs similarity index 73% rename from precompiles/utils/macro/tests/precompile/compile-fail/discriminant/dont-return-option.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/discriminant/dont-return-option.rs index 217eff8e..ca9faeaf 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/dont-return-option.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/dont-return-option.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; pub struct Precompile(PhantomData); @@ -31,4 +32,4 @@ impl Precompile { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/dont-return-option.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/dont-return-option.stderr similarity index 50% rename from precompiles/utils/macro/tests/precompile/compile-fail/discriminant/dont-return-option.stderr rename to precompiles/utils/macro/tests/compile-fail/precompile/discriminant/dont-return-option.stderr index 3ac973b7..66d90708 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/dont-return-option.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/dont-return-option.stderr @@ -1,5 +1,5 @@ error: The discriminant function must return an Option<_> (no type alias) - --> tests/precompile/compile-fail/discriminant/dont-return-option.rs:24:36 + --> tests/compile-fail/precompile/discriminant/dont-return-option.rs:25:36 | -24 | fn discriminant(address: H160) -> u32 { +25 | fn discriminant(address: H160) -> u32 { | ^^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/missing-fn.rs b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-fn.rs similarity index 71% rename from precompiles/utils/macro/tests/precompile/compile-fail/discriminant/missing-fn.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-fn.rs index fd6d1af0..9eb81c8d 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/missing-fn.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-fn.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; pub struct Precompile(PhantomData); @@ -26,4 +27,4 @@ impl Precompile { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/missing-fn.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-fn.stderr similarity index 73% rename from precompiles/utils/macro/tests/precompile/compile-fail/discriminant/missing-fn.stderr rename to precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-fn.stderr index 67e513e7..b24b8ddd 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/missing-fn.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-fn.stderr @@ -1,7 +1,7 @@ error: A PrecompileSet must have exactly one function tagged with `#[precompile::discriminant]` - --> tests/precompile/compile-fail/discriminant/missing-fn.rs:20:1 + --> tests/compile-fail/precompile/discriminant/missing-fn.rs:21:1 | -20 | #[precompile_utils_macro::precompile] +21 | #[precompile_utils_macro::precompile] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this error originates in the attribute macro `precompile_utils_macro::precompile` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/missing-param.rs b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-param.rs similarity index 73% rename from precompiles/utils/macro/tests/precompile/compile-fail/discriminant/missing-param.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-param.rs index 0ea8fc17..534c9b2a 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/missing-param.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-param.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; pub struct Precompile(PhantomData); @@ -31,4 +32,4 @@ impl Precompile { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-param.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-param.stderr new file mode 100644 index 00000000..3026b5ce --- /dev/null +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-param.stderr @@ -0,0 +1,5 @@ +error: The discriminant function must only take the code address (H160) as parameter. + --> tests/compile-fail/precompile/discriminant/missing-param.rs:25:2 + | +25 | fn discriminant() -> Option { + | ^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/return-incomplete-option.rs b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/return-incomplete-option.rs similarity index 73% rename from precompiles/utils/macro/tests/precompile/compile-fail/discriminant/return-incomplete-option.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/discriminant/return-incomplete-option.rs index ee6a7aed..8d08a6af 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/return-incomplete-option.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/return-incomplete-option.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; pub struct Precompile(PhantomData); @@ -31,4 +32,4 @@ impl Precompile { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/return-incomplete-option.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/return-incomplete-option.stderr new file mode 100644 index 00000000..dc6db9f6 --- /dev/null +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/return-incomplete-option.stderr @@ -0,0 +1,5 @@ +error: The discriminant function must return an Option<_> (no type alias) + --> tests/compile-fail/precompile/discriminant/return-incomplete-option.rs:25:36 + | +25 | fn discriminant(address: H160) -> Option { + | ^^^^^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/too-many-arguments.rs b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/too-many-arguments.rs similarity index 74% rename from precompiles/utils/macro/tests/precompile/compile-fail/discriminant/too-many-arguments.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/discriminant/too-many-arguments.rs index 3a130030..63281a7a 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/too-many-arguments.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/too-many-arguments.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; pub struct Precompile(PhantomData); @@ -31,4 +32,4 @@ impl Precompile { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/too-many-arguments.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/too-many-arguments.stderr new file mode 100644 index 00000000..a1b6e878 --- /dev/null +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/too-many-arguments.stderr @@ -0,0 +1,5 @@ +error: The discriminant function must only take the code address (H160) as parameter. + --> tests/compile-fail/precompile/discriminant/too-many-arguments.rs:25:2 + | +25 | fn discriminant(address: H160, other: u32) -> Option { + | ^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/type-mismatch-1.rs b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-1.rs similarity index 73% rename from precompiles/utils/macro/tests/precompile/compile-fail/discriminant/type-mismatch-1.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-1.rs index 96f0ce30..9a392560 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/type-mismatch-1.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-1.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; pub struct Precompile(PhantomData); @@ -31,4 +32,4 @@ impl Precompile { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-1.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-1.stderr new file mode 100644 index 00000000..8d999769 --- /dev/null +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-1.stderr @@ -0,0 +1,5 @@ +error: All discriminants must have the same type (found u64 before) + --> tests/compile-fail/precompile/discriminant/type-mismatch-1.rs:30:24 + | +30 | fn foo(_discriminant: u32, test: &mut impl PrecompileHandle) -> EvmResult { + | ^^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/type-mismatch-2.rs b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-2.rs similarity index 73% rename from precompiles/utils/macro/tests/precompile/compile-fail/discriminant/type-mismatch-2.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-2.rs index 14ec9e0d..4ebfdd84 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/type-mismatch-2.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-2.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; pub struct Precompile(PhantomData); @@ -31,4 +32,4 @@ impl Precompile { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-2.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-2.stderr new file mode 100644 index 00000000..d5ed6750 --- /dev/null +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-2.stderr @@ -0,0 +1,5 @@ +error: All discriminants must have the same type (found u32 before) + --> tests/compile-fail/precompile/discriminant/type-mismatch-2.rs:30:43 + | +30 | fn discriminant(address: H160) -> Option { + | ^^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/fn-modifiers/discriminant-multiple.rs b/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/discriminant-multiple.rs similarity index 70% rename from precompiles/utils/macro/tests/precompile/compile-fail/fn-modifiers/discriminant-multiple.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/discriminant-multiple.rs index 78ecd430..6aac2cd2 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/fn-modifiers/discriminant-multiple.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/discriminant-multiple.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; pub struct PrecompileSet(PhantomData); @@ -27,4 +28,4 @@ impl PrecompileSet { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/fn-modifiers/discriminant-multiple.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/discriminant-multiple.stderr similarity index 52% rename from precompiles/utils/macro/tests/precompile/compile-fail/fn-modifiers/discriminant-multiple.stderr rename to precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/discriminant-multiple.stderr index 9571166b..93f4fb26 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/fn-modifiers/discriminant-multiple.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/discriminant-multiple.stderr @@ -1,5 +1,5 @@ error: The discriminant attribute must be the only precompile attribute of a function - --> tests/precompile/compile-fail/fn-modifiers/discriminant-multiple.rs:23:16 + --> tests/compile-fail/precompile/fn-modifiers/discriminant-multiple.rs:24:16 | -23 | #[precompile::discriminant] +24 | #[precompile::discriminant] | ^^^^^^^^^^^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/fn-modifiers/multiple-modifiers.rs b/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/multiple-modifiers.rs similarity index 71% rename from precompiles/utils/macro/tests/precompile/compile-fail/fn-modifiers/multiple-modifiers.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/multiple-modifiers.rs index 7fbaaa4f..70d5ea92 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/fn-modifiers/multiple-modifiers.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/multiple-modifiers.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; pub struct Precompile(PhantomData); @@ -27,4 +28,4 @@ impl Precompile { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/fn-modifiers/multiple-modifiers.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/multiple-modifiers.stderr similarity index 50% rename from precompiles/utils/macro/tests/precompile/compile-fail/fn-modifiers/multiple-modifiers.stderr rename to precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/multiple-modifiers.stderr index fcda5527..678199ab 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/fn-modifiers/multiple-modifiers.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/multiple-modifiers.stderr @@ -1,5 +1,5 @@ error: A precompile method can have at most one modifier (payable, view) - --> tests/precompile/compile-fail/fn-modifiers/multiple-modifiers.rs:24:16 + --> tests/compile-fail/precompile/fn-modifiers/multiple-modifiers.rs:25:16 | -24 | #[precompile::payable] +25 | #[precompile::payable] | ^^^^^^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/fn-modifiers/pre-check-multiple.rs b/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/pre-check-multiple.rs similarity index 70% rename from precompiles/utils/macro/tests/precompile/compile-fail/fn-modifiers/pre-check-multiple.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/pre-check-multiple.rs index 5b275ceb..f80194ee 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/fn-modifiers/pre-check-multiple.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/pre-check-multiple.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; pub struct Precompile(PhantomData); @@ -26,4 +27,4 @@ impl Precompile { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/fn-modifiers/pre-check-multiple.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/pre-check-multiple.stderr similarity index 52% rename from precompiles/utils/macro/tests/precompile/compile-fail/fn-modifiers/pre-check-multiple.stderr rename to precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/pre-check-multiple.stderr index a639d9ad..7f96f8b5 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/fn-modifiers/pre-check-multiple.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/pre-check-multiple.stderr @@ -1,5 +1,5 @@ error: The pre_check attribute must be the only precompile attribute of a function - --> tests/precompile/compile-fail/fn-modifiers/pre-check-multiple.rs:22:16 + --> tests/compile-fail/precompile/fn-modifiers/pre-check-multiple.rs:23:16 | -22 | #[precompile::pre_check] +23 | #[precompile::pre_check] | ^^^^^^^^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/handle/missing.rs b/precompiles/utils/macro/tests/compile-fail/precompile/handle/missing.rs similarity index 68% rename from precompiles/utils/macro/tests/precompile/compile-fail/handle/missing.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/handle/missing.rs index fc95c137..50bee5b9 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/handle/missing.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/handle/missing.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; pub struct Precompile(PhantomData); @@ -25,4 +26,4 @@ impl Precompile { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/handle/missing.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/handle/missing.stderr new file mode 100644 index 00000000..2760a719 --- /dev/null +++ b/precompiles/utils/macro/tests/compile-fail/precompile/handle/missing.stderr @@ -0,0 +1,5 @@ +error: Precompile methods must have at least 1 parameter (the PrecompileHandle) + --> tests/compile-fail/precompile/handle/missing.rs:24:2 + | +24 | fn foo() { + | ^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/handle/set-missing.rs b/precompiles/utils/macro/tests/compile-fail/precompile/handle/set-missing.rs similarity index 69% rename from precompiles/utils/macro/tests/precompile/compile-fail/handle/set-missing.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/handle/set-missing.rs index a3ae71c3..14477da6 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/handle/set-missing.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/handle/set-missing.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; pub struct Precompile(PhantomData); @@ -26,4 +27,4 @@ impl Precompile { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/handle/set-missing.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/handle/set-missing.stderr similarity index 53% rename from precompiles/utils/macro/tests/precompile/compile-fail/handle/set-missing.stderr rename to precompiles/utils/macro/tests/compile-fail/precompile/handle/set-missing.stderr index cd384ad0..8f0a10d8 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/handle/set-missing.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/handle/set-missing.stderr @@ -1,5 +1,5 @@ error: PrecompileSet methods must have at least 2 parameters (the precompile instance discriminant and the PrecompileHandle) - --> tests/precompile/compile-fail/handle/set-missing.rs:24:2 + --> tests/compile-fail/precompile/handle/set-missing.rs:25:2 | -24 | fn foo(_: u32) { - | ^^^^^^^^^^^^^^ +25 | fn foo(_: u32) { + | ^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/handle/set-wrong-type.rs b/precompiles/utils/macro/tests/compile-fail/precompile/handle/set-wrong-type.rs similarity index 70% rename from precompiles/utils/macro/tests/precompile/compile-fail/handle/set-wrong-type.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/handle/set-wrong-type.rs index b4f7d09a..0c33d150 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/handle/set-wrong-type.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/handle/set-wrong-type.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; pub struct Precompile(PhantomData); @@ -26,4 +27,4 @@ impl Precompile { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/handle/set-wrong-type.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/handle/set-wrong-type.stderr similarity index 51% rename from precompiles/utils/macro/tests/precompile/compile-fail/handle/set-wrong-type.stderr rename to precompiles/utils/macro/tests/compile-fail/precompile/handle/set-wrong-type.stderr index c5ef7573..bf62c138 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/handle/set-wrong-type.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/handle/set-wrong-type.stderr @@ -1,5 +1,5 @@ error: This parameter must have type `&mut impl PrecompileHandle` - --> tests/precompile/compile-fail/handle/set-wrong-type.rs:24:38 + --> tests/compile-fail/precompile/handle/set-wrong-type.rs:25:38 | -24 | fn foo(_discriminant: u32, _handle: u32) { +25 | fn foo(_discriminant: u32, _handle: u32) { | ^^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/handle/wrong-type.rs b/precompiles/utils/macro/tests/compile-fail/precompile/handle/wrong-type.rs similarity index 68% rename from precompiles/utils/macro/tests/precompile/compile-fail/handle/wrong-type.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/handle/wrong-type.rs index 006bc0d6..39efe052 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/handle/wrong-type.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/handle/wrong-type.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; pub struct Precompile(PhantomData); @@ -25,4 +26,4 @@ impl Precompile { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/handle/wrong-type.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/handle/wrong-type.stderr similarity index 51% rename from precompiles/utils/macro/tests/precompile/compile-fail/handle/wrong-type.stderr rename to precompiles/utils/macro/tests/compile-fail/precompile/handle/wrong-type.stderr index 916aaed1..12e06e48 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/handle/wrong-type.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/handle/wrong-type.stderr @@ -1,5 +1,5 @@ error: This parameter must have type `&mut impl PrecompileHandle` - --> tests/precompile/compile-fail/handle/wrong-type.rs:23:18 + --> tests/compile-fail/precompile/handle/wrong-type.rs:24:18 | -23 | fn foo(_handle: u32) { +24 | fn foo(_handle: u32) { | ^^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/pre-check/no-parameter.rs b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/no-parameter.rs similarity index 71% rename from precompiles/utils/macro/tests/precompile/compile-fail/pre-check/no-parameter.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/pre-check/no-parameter.rs index 1b6a68c8..0c40d715 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/pre-check/no-parameter.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/no-parameter.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; pub struct Precompile(PhantomData); @@ -30,4 +31,4 @@ impl Precompile { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/no-parameter.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/no-parameter.stderr new file mode 100644 index 00000000..406806c5 --- /dev/null +++ b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/no-parameter.stderr @@ -0,0 +1,5 @@ +error: Precompile methods must have at least 1 parameter (the PrecompileHandle) + --> tests/compile-fail/precompile/pre-check/no-parameter.rs:24:2 + | +24 | fn pre_check() { + | ^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/pre-check/too-many-parameters.rs b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/too-many-parameters.rs similarity index 72% rename from precompiles/utils/macro/tests/precompile/compile-fail/pre-check/too-many-parameters.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/pre-check/too-many-parameters.rs index 60df725f..1ad09c62 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/pre-check/too-many-parameters.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/too-many-parameters.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; pub struct Precompile(PhantomData); @@ -30,4 +31,4 @@ impl Precompile { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/too-many-parameters.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/too-many-parameters.stderr new file mode 100644 index 00000000..474b5c9d --- /dev/null +++ b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/too-many-parameters.stderr @@ -0,0 +1,5 @@ +error: Precompile pre_check method must have exactly 1 parameter (the PrecompileHandle) + --> tests/compile-fail/precompile/pre-check/too-many-parameters.rs:24:2 + | +24 | fn pre_check(_: &mut impl PrecompileHandle, _: u32) { + | ^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/pre-check/wrong-parameter.rs b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/wrong-parameter.rs similarity index 71% rename from precompiles/utils/macro/tests/precompile/compile-fail/pre-check/wrong-parameter.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/pre-check/wrong-parameter.rs index 86c5fb9e..d081415b 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/pre-check/wrong-parameter.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/wrong-parameter.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use core::marker::PhantomData; pub struct Precompile(PhantomData); @@ -30,4 +31,4 @@ impl Precompile { } } -fn main() {} +fn main() { } \ No newline at end of file diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/wrong-parameter.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/wrong-parameter.stderr new file mode 100644 index 00000000..ea95fb0d --- /dev/null +++ b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/wrong-parameter.stderr @@ -0,0 +1,5 @@ +error: This parameter must have type `&mut impl PrecompileHandle` + --> tests/compile-fail/precompile/pre-check/wrong-parameter.rs:24:18 + | +24 | fn pre_check(_: u32) { + | ^^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/test/generic-arg.rs b/precompiles/utils/macro/tests/compile-fail/precompile/test-gen/generic-arg.rs similarity index 64% rename from precompiles/utils/macro/tests/precompile/compile-fail/test/generic-arg.rs rename to precompiles/utils/macro/tests/compile-fail/precompile/test-gen/generic-arg.rs index 0de627e6..c5670db2 100644 --- a/precompiles/utils/macro/tests/precompile/compile-fail/test/generic-arg.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/test-gen/generic-arg.rs @@ -1,19 +1,20 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . -use {core::marker::PhantomData, frame_support::pallet_prelude::Get, precompile_utils::prelude::*}; +// along with Moonbeam. If not, see . + +use core::marker::PhantomData; pub struct Precompile(PhantomData); diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/test-gen/generic-arg.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/test-gen/generic-arg.stderr new file mode 100644 index 00000000..8b4daeb3 --- /dev/null +++ b/precompiles/utils/macro/tests/compile-fail/precompile/test-gen/generic-arg.stderr @@ -0,0 +1,11 @@ +error: impl type parameter is used in functions arguments. Arguments should not have a type + depending on a type parameter, unless it is a length bound for BoundedBytes, + BoundedString or alike, which doesn't affect the Solidity type. + + In that case, you must add a #[precompile::test_concrete_types(...)] attribute on the impl + block to provide concrete types that will be used to run the automatically generated tests + ensuring the Solidity function signatures are correct. + --> tests/compile-fail/precompile/test-gen/generic-arg.rs:24:63 + | +24 | fn foo(handle: &mut impl PrecompileHandle, arg: BoundedBytes) -> EvmResult { + | ^ diff --git a/precompiles/utils/macro/tests/compile-fail/precompile_name/not_tuple.rs b/precompiles/utils/macro/tests/compile-fail/precompile_name/not_tuple.rs new file mode 100644 index 00000000..838e53d2 --- /dev/null +++ b/precompiles/utils/macro/tests/compile-fail/precompile_name/not_tuple.rs @@ -0,0 +1,22 @@ +// Copyright 2019-2023 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +struct Dummy; + +#[precompile_utils_macro::precompile_name_from_address] +type Precompiles = Dummy; + +fn main() {} diff --git a/precompiles/utils/macro/tests/compile-fail/precompile_name/not_tuple.stderr b/precompiles/utils/macro/tests/compile-fail/precompile_name/not_tuple.stderr new file mode 100644 index 00000000..343443a2 --- /dev/null +++ b/precompiles/utils/macro/tests/compile-fail/precompile_name/not_tuple.stderr @@ -0,0 +1,5 @@ +error: Expected tuple + --> tests/compile-fail/precompile_name/not_tuple.rs:20:20 + | +20 | type Precompiles = Dummy; + | ^^^^^ diff --git a/precompiles/utils/macro/tests/precompile/expand/precompile.expanded.rs b/precompiles/utils/macro/tests/expand/precompile.expanded.rs similarity index 68% rename from precompiles/utils/macro/tests/precompile/expand/precompile.expanded.rs rename to precompiles/utils/macro/tests/expand/precompile.expanded.rs index e7d293c0..c5c5d5f4 100644 --- a/precompiles/utils/macro/tests/precompile/expand/precompile.expanded.rs +++ b/precompiles/utils/macro/tests/expand/precompile.expanded.rs @@ -12,14 +12,7 @@ where { fn pre_check(handle: &mut impl PrecompileHandle) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["pre_check"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("pre_check")), ) } fn batch_some( @@ -30,14 +23,7 @@ where gas_limit: BoundedVec, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["batch_some"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("batch_some")), ) } fn batch_some_until_failure( @@ -48,16 +34,8 @@ where gas_limit: BoundedVec, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1( - &["batch_some_until_failure"], - &[], - ), - ), - ], + format_args!( + "not yet implemented: {0}", format_args!("batch_some_until_failure") ), ) } @@ -69,26 +47,12 @@ where gas_limit: BoundedVec, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["batch_all"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("batch_all")), ) } fn fallback(handle: &mut impl PrecompileHandle) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["fallback"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("fallback")), ) } } @@ -117,7 +81,7 @@ where }, fallback {}, #[doc(hidden)] - __phantom(PhantomData<(Runtime)>, ::core::convert::Infallible), + __phantom(::core::marker::PhantomData<(Runtime)>, ::core::convert::Infallible), } impl BatchPrecompileCall where @@ -126,7 +90,7 @@ where pub fn parse_call_data( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::RevertReason; + use ::precompile_utils::solidity::revert::RevertReason; let input = handle.input(); let selector = input .get(0..4) @@ -145,9 +109,9 @@ where fn _parse_batch_all( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; let mut input = handle.read_after_selector()?; input.expect_arguments(4usize)?; @@ -161,9 +125,9 @@ where fn _parse_batch_some( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; let mut input = handle.read_after_selector()?; input.expect_arguments(4usize)?; @@ -177,9 +141,9 @@ where fn _parse_batch_some_until_failure( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; let mut input = handle.read_after_selector()?; input.expect_arguments(4usize)?; @@ -193,9 +157,9 @@ where fn _parse_fallback( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; Ok(Self::fallback {}) } @@ -203,41 +167,34 @@ where self, handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult<::fp_evm::PrecompileOutput> { - use ::precompile_utils::data::EvmDataWriter; + use ::precompile_utils::solidity::codec::Writer; use ::fp_evm::{PrecompileOutput, ExitSucceed}; let output = match self { Self::batch_all { to, value, call_data, gas_limit } => { - use ::precompile_utils::EvmDataWriter; let output = >::batch_all(handle, to, value, call_data, gas_limit); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::batch_some { to, value, call_data, gas_limit } => { - use ::precompile_utils::EvmDataWriter; let output = >::batch_some(handle, to, value, call_data, gas_limit); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::batch_some_until_failure { to, value, call_data, gas_limit } => { - use ::precompile_utils::EvmDataWriter; let output = >::batch_some_until_failure(handle, to, value, call_data, gas_limit); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::fallback {} => { - use ::precompile_utils::EvmDataWriter; let output = >::fallback(handle); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::__phantom(_, _) => { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["__phantom variant should not be used"], - &[], - ), + format_args!("__phantom variant should not be used"), ) } }; @@ -270,10 +227,10 @@ where &[] } pub fn encode(self) -> ::sp_std::vec::Vec { - use ::precompile_utils::EvmDataWriter; + use ::precompile_utils::solidity::codec::Writer; match self { Self::batch_all { to, value, call_data, gas_limit } => { - EvmDataWriter::new_with_selector(2531431096u32) + Writer::new_with_selector(2531431096u32) .write(to) .write(value) .write(call_data) @@ -281,7 +238,7 @@ where .build() } Self::batch_some { to, value, call_data, gas_limit } => { - EvmDataWriter::new_with_selector(2044677020u32) + Writer::new_with_selector(2044677020u32) .write(to) .write(value) .write(call_data) @@ -289,7 +246,7 @@ where .build() } Self::batch_some_until_failure { to, value, call_data, gas_limit } => { - EvmDataWriter::new_with_selector(3473183175u32) + Writer::new_with_selector(3473183175u32) .write(to) .write(value) .write(call_data) @@ -299,10 +256,7 @@ where Self::fallback {} => Default::default(), Self::__phantom(_, _) => { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["__phantom variant should not be used"], - &[], - ), + format_args!("__phantom variant should not be used"), ) } } @@ -329,7 +283,7 @@ where } #[allow(non_snake_case)] pub(crate) fn __BatchPrecompile_test_solidity_signatures_inner() { - use ::precompile_utils::data::EvmData; + use ::precompile_utils::solidity::Codec; match ( &"(address[],uint256[],bytes[],uint64[])", &<( @@ -337,7 +291,7 @@ pub(crate) fn __BatchPrecompile_test_solidity_signatures_inner() { BoundedVec, BoundedVec, GetArrayLimit>, BoundedVec, - ) as EvmData>::solidity_type(), + ) as Codec>::signature(), ) { (left_val, right_val) => { if !(*left_val == *right_val) { @@ -347,12 +301,9 @@ pub(crate) fn __BatchPrecompile_test_solidity_signatures_inner() { &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"batch_all")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "batch_all" ), ), ); @@ -366,7 +317,7 @@ pub(crate) fn __BatchPrecompile_test_solidity_signatures_inner() { BoundedVec, BoundedVec, GetArrayLimit>, BoundedVec, - ) as EvmData>::solidity_type(), + ) as Codec>::signature(), ) { (left_val, right_val) => { if !(*left_val == *right_val) { @@ -376,12 +327,9 @@ pub(crate) fn __BatchPrecompile_test_solidity_signatures_inner() { &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"batch_some")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "batch_some" ), ), ); @@ -395,7 +343,7 @@ pub(crate) fn __BatchPrecompile_test_solidity_signatures_inner() { BoundedVec, BoundedVec, GetArrayLimit>, BoundedVec, - ) as EvmData>::solidity_type(), + ) as Codec>::signature(), ) { (left_val, right_val) => { if !(*left_val == *right_val) { @@ -405,23 +353,16 @@ pub(crate) fn __BatchPrecompile_test_solidity_signatures_inner() { &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[ - ::core::fmt::ArgumentV1::new_display( - &"batch_some_until_failure", - ), - ], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "batch_some_until_failure" ), ), ); } } }; - match (&"()", &<() as EvmData>::solidity_type()) { + match (&"()", &<() as Codec>::signature()) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -430,12 +371,9 @@ pub(crate) fn __BatchPrecompile_test_solidity_signatures_inner() { &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"fallback")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "fallback" ), ), ); diff --git a/precompiles/utils/macro/tests/precompile/expand/precompile.rs b/precompiles/utils/macro/tests/expand/precompile.rs similarity index 89% rename from precompiles/utils/macro/tests/precompile/expand/precompile.rs rename to precompiles/utils/macro/tests/expand/precompile.rs index 93a6770f..fc1d76e7 100644 --- a/precompiles/utils/macro/tests/precompile/expand/precompile.rs +++ b/precompiles/utils/macro/tests/expand/precompile.rs @@ -1,18 +1,18 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . use { core::marker::PhantomData, diff --git a/precompiles/utils/macro/tests/expand/precompile_name.expanded.rs b/precompiles/utils/macro/tests/expand/precompile_name.expanded.rs new file mode 100644 index 00000000..1d04b9ed --- /dev/null +++ b/precompiles/utils/macro/tests/expand/precompile_name.expanded.rs @@ -0,0 +1,37 @@ +struct PrecompileAt(PhantomData<(T, U, V)>); +struct AddressU64; +struct FooPrecompile(PhantomData); +struct BarPrecompile(PhantomData<(R, S)>); +struct MockCheck; +type Precompiles = ( + PrecompileAt, FooPrecompile>, + PrecompileAt, BarPrecompile, (MockCheck, MockCheck)>, +); +#[repr(u64)] +pub enum PrecompileName { + FooPrecompile = 1u64, + BarPrecompile = 2u64, +} +#[automatically_derived] +impl ::core::fmt::Debug for PrecompileName { + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + PrecompileName::FooPrecompile => "FooPrecompile", + PrecompileName::BarPrecompile => "BarPrecompile", + }, + ) + } +} +impl PrecompileName { + pub fn from_address(address: sp_core::H160) -> Option { + let _u64 = address.to_low_u64_be(); + if address == sp_core::H160::from_low_u64_be(_u64) { + use num_enum::TryFromPrimitive; + Self::try_from_primitive(_u64).ok() + } else { + None + } + } +} diff --git a/precompiles/utils/macro/tests/expand/precompile_name.rs b/precompiles/utils/macro/tests/expand/precompile_name.rs new file mode 100644 index 00000000..3e14f9fb --- /dev/null +++ b/precompiles/utils/macro/tests/expand/precompile_name.rs @@ -0,0 +1,28 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +// Few mock structs to check the macro. +struct PrecompileAt(PhantomData<(T, U, V)>); +struct AddressU64; +struct FooPrecompile(PhantomData); +struct BarPrecompile(PhantomData<(R, S)>); +struct MockCheck; + +#[precompile_utils_macro::precompile_name_from_address] +type Precompiles = ( + PrecompileAt, FooPrecompile>, + PrecompileAt, BarPrecompile, (MockCheck, MockCheck)>, +); diff --git a/precompiles/utils/macro/tests/precompile/expand/precompileset.expanded.rs b/precompiles/utils/macro/tests/expand/precompileset.expanded.rs similarity index 59% rename from precompiles/utils/macro/tests/precompile/expand/precompileset.expanded.rs rename to precompiles/utils/macro/tests/expand/precompileset.expanded.rs index dfdf5d87..59163757 100644 --- a/precompiles/utils/macro/tests/precompile/expand/precompileset.expanded.rs +++ b/precompiles/utils/macro/tests/expand/precompileset.expanded.rs @@ -15,14 +15,7 @@ where /// and if this is the case which one. fn discriminant(address: H160) -> Option { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["discriminant"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("discriminant")), ) } fn total_supply( @@ -30,14 +23,7 @@ where handle: &mut impl PrecompileHandle, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["total_supply"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("total_supply")), ) } fn balance_of( @@ -46,14 +32,7 @@ where who: Address, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["balance_of"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("balance_of")), ) } fn allowance( @@ -63,14 +42,7 @@ where spender: Address, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["allowance"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("allowance")), ) } fn approve( @@ -80,14 +52,7 @@ where value: U256, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["approve"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("approve")), ) } fn approve_inner( @@ -98,14 +63,7 @@ where value: U256, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["approve_inner"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("approve_inner")), ) } fn transfer( @@ -115,14 +73,7 @@ where value: U256, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["transfer"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("transfer")), ) } fn transfer_from( @@ -133,14 +84,7 @@ where value: U256, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["transfer_from"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("transfer_from")), ) } fn name( @@ -148,14 +92,7 @@ where handle: &mut impl PrecompileHandle, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["name"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("name")), ) } fn symbol( @@ -163,14 +100,7 @@ where handle: &mut impl PrecompileHandle, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["symbol"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("symbol")), ) } fn decimals( @@ -178,14 +108,7 @@ where handle: &mut impl PrecompileHandle, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["decimals"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("decimals")), ) } fn mint( @@ -195,14 +118,7 @@ where value: U256, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["mint"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("mint")), ) } fn burn( @@ -212,14 +128,7 @@ where value: U256, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["burn"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("burn")), ) } fn freeze( @@ -228,14 +137,7 @@ where account: Address, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["freeze"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("freeze")), ) } fn thaw( @@ -244,14 +146,7 @@ where account: Address, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["thaw"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("thaw")), ) } fn freeze_asset( @@ -259,14 +154,7 @@ where handle: &mut impl PrecompileHandle, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["freeze_asset"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("freeze_asset")), ) } fn thaw_asset( @@ -274,14 +162,7 @@ where handle: &mut impl PrecompileHandle, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["thaw_asset"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("thaw_asset")), ) } fn transfer_ownership( @@ -290,14 +171,7 @@ where owner: Address, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["transfer_ownership"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("transfer_ownership")), ) } fn set_team( @@ -308,14 +182,7 @@ where freezer: Address, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["set_team"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("set_team")), ) } fn set_metadata( @@ -326,14 +193,7 @@ where decimals: u8, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["set_metadata"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("set_metadata")), ) } fn clear_metadata( @@ -341,14 +201,7 @@ where handle: &mut impl PrecompileHandle, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["clear_metadata"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("clear_metadata")), ) } fn eip2612_permit( @@ -363,14 +216,7 @@ where s: H256, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["eip2612_permit"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("eip2612_permit")), ) } fn eip2612_nonces( @@ -379,14 +225,7 @@ where owner: Address, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1(&["eip2612_nonces"], &[]), - ), - ], - ), + format_args!("not yet implemented: {0}", format_args!("eip2612_nonces")), ) } fn eip2612_domain_separator( @@ -394,16 +233,8 @@ where handle: &mut impl PrecompileHandle, ) -> EvmResult { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["not yet implemented: "], - &[ - ::core::fmt::ArgumentV1::new_display( - &::core::fmt::Arguments::new_v1( - &["eip2612_domain_separator"], - &[], - ), - ), - ], + format_args!( + "not yet implemented: {0}", format_args!("eip2612_domain_separator") ), ) } @@ -448,7 +279,7 @@ where transfer_from { from: Address, to: Address, value: U256 }, transfer_ownership { owner: Address }, #[doc(hidden)] - __phantom(PhantomData<(Runtime)>, ::core::convert::Infallible), + __phantom(::core::marker::PhantomData<(Runtime)>, ::core::convert::Infallible), } impl PrecompileSetCall where @@ -457,7 +288,7 @@ where pub fn parse_call_data( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::RevertReason; + use ::precompile_utils::solidity::revert::RevertReason; let input = handle.input(); let selector = input .get(0..4) @@ -502,9 +333,9 @@ where fn _parse_allowance( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; let mut input = handle.read_after_selector()?; input.expect_arguments(2usize)?; @@ -516,9 +347,9 @@ where fn _parse_approve( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; let mut input = handle.read_after_selector()?; input.expect_arguments(2usize)?; @@ -530,9 +361,9 @@ where fn _parse_balance_of( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; let mut input = handle.read_after_selector()?; input.expect_arguments(1usize)?; @@ -543,9 +374,9 @@ where fn _parse_burn( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; let mut input = handle.read_after_selector()?; input.expect_arguments(2usize)?; @@ -557,36 +388,36 @@ where fn _parse_clear_metadata( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; Ok(Self::clear_metadata {}) } fn _parse_decimals( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; Ok(Self::decimals {}) } fn _parse_eip2612_domain_separator( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::View)?; Ok(Self::eip2612_domain_separator {}) } fn _parse_eip2612_nonces( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::View)?; let mut input = handle.read_after_selector()?; input.expect_arguments(1usize)?; @@ -597,9 +428,9 @@ where fn _parse_eip2612_permit( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; let mut input = handle.read_after_selector()?; input.expect_arguments(7usize)?; @@ -616,9 +447,9 @@ where fn _parse_freeze( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; let mut input = handle.read_after_selector()?; input.expect_arguments(1usize)?; @@ -629,18 +460,18 @@ where fn _parse_freeze_asset( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; Ok(Self::freeze_asset {}) } fn _parse_mint( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; let mut input = handle.read_after_selector()?; input.expect_arguments(2usize)?; @@ -652,18 +483,18 @@ where fn _parse_name( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; Ok(Self::name {}) } fn _parse_set_metadata( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; let mut input = handle.read_after_selector()?; input.expect_arguments(3usize)?; @@ -676,9 +507,9 @@ where fn _parse_set_team( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; let mut input = handle.read_after_selector()?; input.expect_arguments(3usize)?; @@ -691,18 +522,18 @@ where fn _parse_symbol( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; Ok(Self::symbol {}) } fn _parse_thaw( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; let mut input = handle.read_after_selector()?; input.expect_arguments(1usize)?; @@ -713,27 +544,27 @@ where fn _parse_thaw_asset( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; Ok(Self::thaw_asset {}) } fn _parse_total_supply( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; Ok(Self::total_supply {}) } fn _parse_transfer( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; let mut input = handle.read_after_selector()?; input.expect_arguments(2usize)?; @@ -745,9 +576,9 @@ where fn _parse_transfer_from( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; let mut input = handle.read_after_selector()?; input.expect_arguments(3usize)?; @@ -760,9 +591,9 @@ where fn _parse_transfer_ownership( handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::revert::InjectBacktrace; - use ::precompile_utils::modifier::FunctionModifier; - use ::precompile_utils::handle::PrecompileHandleExt; + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; handle.check_function_modifier(FunctionModifier::NonPayable)?; let mut input = handle.read_after_selector()?; input.expect_arguments(1usize)?; @@ -775,65 +606,56 @@ where discriminant: Discriminant, handle: &mut impl PrecompileHandle, ) -> ::precompile_utils::EvmResult<::fp_evm::PrecompileOutput> { - use ::precompile_utils::data::EvmDataWriter; + use ::precompile_utils::solidity::codec::Writer; use ::fp_evm::{PrecompileOutput, ExitSucceed}; let output = match self { Self::allowance { owner, spender } => { - use ::precompile_utils::EvmDataWriter; let output = >::allowance(discriminant, handle, owner, spender); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::approve { spender, value } => { - use ::precompile_utils::EvmDataWriter; let output = >::approve(discriminant, handle, spender, value); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::balance_of { who } => { - use ::precompile_utils::EvmDataWriter; let output = >::balance_of(discriminant, handle, who); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::burn { from, value } => { - use ::precompile_utils::EvmDataWriter; let output = >::burn(discriminant, handle, from, value); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::clear_metadata {} => { - use ::precompile_utils::EvmDataWriter; let output = >::clear_metadata(discriminant, handle); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::decimals {} => { - use ::precompile_utils::EvmDataWriter; let output = >::decimals(discriminant, handle); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::eip2612_domain_separator {} => { - use ::precompile_utils::EvmDataWriter; let output = >::eip2612_domain_separator(discriminant, handle); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::eip2612_nonces { owner } => { - use ::precompile_utils::EvmDataWriter; let output = >::eip2612_nonces(discriminant, handle, owner); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::eip2612_permit { owner, spender, value, deadline, v, r, s } => { - use ::precompile_utils::EvmDataWriter; let output = >::eip2612_permit( @@ -847,99 +669,83 @@ where r, s, ); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::freeze { account } => { - use ::precompile_utils::EvmDataWriter; let output = >::freeze(discriminant, handle, account); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::freeze_asset {} => { - use ::precompile_utils::EvmDataWriter; let output = >::freeze_asset(discriminant, handle); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::mint { to, value } => { - use ::precompile_utils::EvmDataWriter; let output = >::mint(discriminant, handle, to, value); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::name {} => { - use ::precompile_utils::EvmDataWriter; let output = >::name(discriminant, handle); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::set_metadata { name, symbol, decimals } => { - use ::precompile_utils::EvmDataWriter; let output = >::set_metadata(discriminant, handle, name, symbol, decimals); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::set_team { issuer, admin, freezer } => { - use ::precompile_utils::EvmDataWriter; let output = >::set_team(discriminant, handle, issuer, admin, freezer); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::symbol {} => { - use ::precompile_utils::EvmDataWriter; let output = >::symbol(discriminant, handle); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::thaw { account } => { - use ::precompile_utils::EvmDataWriter; let output = >::thaw(discriminant, handle, account); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::thaw_asset {} => { - use ::precompile_utils::EvmDataWriter; let output = >::thaw_asset(discriminant, handle); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::total_supply {} => { - use ::precompile_utils::EvmDataWriter; let output = >::total_supply(discriminant, handle); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::transfer { to, value } => { - use ::precompile_utils::EvmDataWriter; let output = >::transfer(discriminant, handle, to, value); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::transfer_from { from, to, value } => { - use ::precompile_utils::EvmDataWriter; let output = >::transfer_from(discriminant, handle, from, to, value); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::transfer_ownership { owner } => { - use ::precompile_utils::EvmDataWriter; let output = >::transfer_ownership(discriminant, handle, owner); - EvmDataWriter::new().write(output?).build() + ::precompile_utils::solidity::encode_return_value(output?) } Self::__phantom(_, _) => { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["__phantom variant should not be used"], - &[], - ), + format_args!("__phantom variant should not be used"), ) } }; @@ -1080,41 +886,36 @@ where &[4076725131u32, 4030008324u32] } pub fn encode(self) -> ::sp_std::vec::Vec { - use ::precompile_utils::EvmDataWriter; + use ::precompile_utils::solidity::codec::Writer; match self { Self::allowance { owner, spender } => { - EvmDataWriter::new_with_selector(3714247998u32) + Writer::new_with_selector(3714247998u32) .write(owner) .write(spender) .build() } Self::approve { spender, value } => { - EvmDataWriter::new_with_selector(157198259u32) + Writer::new_with_selector(157198259u32) .write(spender) .write(value) .build() } Self::balance_of { who } => { - EvmDataWriter::new_with_selector(1889567281u32).write(who).build() + Writer::new_with_selector(1889567281u32).write(who).build() } Self::burn { from, value } => { - EvmDataWriter::new_with_selector(2646777772u32) - .write(from) - .write(value) - .build() - } - Self::clear_metadata {} => { - EvmDataWriter::new_with_selector(4021736498u32).build() + Writer::new_with_selector(2646777772u32).write(from).write(value).build() } - Self::decimals {} => EvmDataWriter::new_with_selector(826074471u32).build(), + Self::clear_metadata {} => Writer::new_with_selector(4021736498u32).build(), + Self::decimals {} => Writer::new_with_selector(826074471u32).build(), Self::eip2612_domain_separator {} => { - EvmDataWriter::new_with_selector(910484757u32).build() + Writer::new_with_selector(910484757u32).build() } Self::eip2612_nonces { owner } => { - EvmDataWriter::new_with_selector(2127478272u32).write(owner).build() + Writer::new_with_selector(2127478272u32).write(owner).build() } Self::eip2612_permit { owner, spender, value, deadline, v, r, s } => { - EvmDataWriter::new_with_selector(3573918927u32) + Writer::new_with_selector(3573918927u32) .write(owner) .write(spender) .write(value) @@ -1125,64 +926,49 @@ where .build() } Self::freeze { account } => { - EvmDataWriter::new_with_selector(2367676207u32).write(account).build() - } - Self::freeze_asset {} => { - EvmDataWriter::new_with_selector(3566436177u32).build() + Writer::new_with_selector(2367676207u32).write(account).build() } + Self::freeze_asset {} => Writer::new_with_selector(3566436177u32).build(), Self::mint { to, value } => { - EvmDataWriter::new_with_selector(1086394137u32) - .write(to) - .write(value) - .build() + Writer::new_with_selector(1086394137u32).write(to).write(value).build() } - Self::name {} => EvmDataWriter::new_with_selector(117300739u32).build(), + Self::name {} => Writer::new_with_selector(117300739u32).build(), Self::set_metadata { name, symbol, decimals } => { - EvmDataWriter::new_with_selector(936559348u32) + Writer::new_with_selector(936559348u32) .write(name) .write(symbol) .write(decimals) .build() } Self::set_team { issuer, admin, freezer } => { - EvmDataWriter::new_with_selector(3352902745u32) + Writer::new_with_selector(3352902745u32) .write(issuer) .write(admin) .write(freezer) .build() } - Self::symbol {} => EvmDataWriter::new_with_selector(2514000705u32).build(), + Self::symbol {} => Writer::new_with_selector(2514000705u32).build(), Self::thaw { account } => { - EvmDataWriter::new_with_selector(1587675670u32).write(account).build() - } - Self::thaw_asset {} => { - EvmDataWriter::new_with_selector(1374431959u32).build() - } - Self::total_supply {} => { - EvmDataWriter::new_with_selector(404098525u32).build() + Writer::new_with_selector(1587675670u32).write(account).build() } + Self::thaw_asset {} => Writer::new_with_selector(1374431959u32).build(), + Self::total_supply {} => Writer::new_with_selector(404098525u32).build(), Self::transfer { to, value } => { - EvmDataWriter::new_with_selector(2835717307u32) - .write(to) - .write(value) - .build() + Writer::new_with_selector(2835717307u32).write(to).write(value).build() } Self::transfer_from { from, to, value } => { - EvmDataWriter::new_with_selector(599290589u32) + Writer::new_with_selector(599290589u32) .write(from) .write(to) .write(value) .build() } Self::transfer_ownership { owner } => { - EvmDataWriter::new_with_selector(4076725131u32).write(owner).build() + Writer::new_with_selector(4076725131u32).write(owner).build() } Self::__phantom(_, _) => { ::core::panicking::panic_fmt( - ::core::fmt::Arguments::new_v1( - &["__phantom variant should not be used"], - &[], - ), + format_args!("__phantom variant should not be used"), ) } } @@ -1215,8 +1001,8 @@ where .and_then(|call| call.execute(discriminant, handle)), ) } - fn is_precompile(&self, address: H160) -> bool { - >::discriminant(address).is_some() + fn is_precompile(&self, address: H160, gas: u64) -> ::fp_evm::IsPrecompileResult { + >::discriminant(address, gas).is_some() } } #[allow(non_snake_case)] @@ -1224,8 +1010,8 @@ pub(crate) fn __PrecompileSet_test_solidity_signatures_inner() where Runtime: Get, { - use ::precompile_utils::data::EvmData; - match (&"(address,address)", &<(Address, Address) as EvmData>::solidity_type()) { + use ::precompile_utils::solidity::Codec; + match (&"(address,address)", &<(Address, Address) as Codec>::signature()) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -1234,19 +1020,16 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"allowance")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "allowance" ), ), ); } } }; - match (&"(address,uint256)", &<(Address, U256) as EvmData>::solidity_type()) { + match (&"(address,uint256)", &<(Address, U256) as Codec>::signature()) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -1255,19 +1038,16 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"approve")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "approve" ), ), ); } } }; - match (&"(address)", &<(Address,) as EvmData>::solidity_type()) { + match (&"(address)", &<(Address,) as Codec>::signature()) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -1276,19 +1056,16 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"balance_of")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "balance_of" ), ), ); } } }; - match (&"(address,uint256)", &<(Address, U256) as EvmData>::solidity_type()) { + match (&"(address,uint256)", &<(Address, U256) as Codec>::signature()) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -1297,19 +1074,16 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"burn")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "burn" ), ), ); } } }; - match (&"()", &<() as EvmData>::solidity_type()) { + match (&"()", &<() as Codec>::signature()) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -1318,19 +1092,16 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"clear_metadata")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "clear_metadata" ), ), ); } } }; - match (&"()", &<() as EvmData>::solidity_type()) { + match (&"()", &<() as Codec>::signature()) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -1339,19 +1110,16 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"decimals")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "decimals" ), ), ); } } }; - match (&"()", &<() as EvmData>::solidity_type()) { + match (&"()", &<() as Codec>::signature()) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -1360,23 +1128,16 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[ - ::core::fmt::ArgumentV1::new_display( - &"eip2612_domain_separator", - ), - ], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "eip2612_domain_separator" ), ), ); } } }; - match (&"(address)", &<(Address,) as EvmData>::solidity_type()) { + match (&"(address)", &<(Address,) as Codec>::signature()) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -1385,12 +1146,9 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"eip2612_nonces")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "eip2612_nonces" ), ), ); @@ -1399,7 +1157,7 @@ where }; match ( &"(address,address,uint256,uint256,uint8,bytes32,bytes32)", - &<(Address, Address, U256, U256, u8, H256, H256) as EvmData>::solidity_type(), + &<(Address, Address, U256, U256, u8, H256, H256) as Codec>::signature(), ) { (left_val, right_val) => { if !(*left_val == *right_val) { @@ -1409,19 +1167,16 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"eip2612_permit")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "eip2612_permit" ), ), ); } } }; - match (&"(address)", &<(Address,) as EvmData>::solidity_type()) { + match (&"(address)", &<(Address,) as Codec>::signature()) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -1430,19 +1185,16 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"freeze")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "freeze" ), ), ); } } }; - match (&"()", &<() as EvmData>::solidity_type()) { + match (&"()", &<() as Codec>::signature()) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -1451,19 +1203,16 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"freeze_asset")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "freeze_asset" ), ), ); } } }; - match (&"(address,uint256)", &<(Address, U256) as EvmData>::solidity_type()) { + match (&"(address,uint256)", &<(Address, U256) as Codec>::signature()) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -1472,19 +1221,16 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"mint")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "mint" ), ), ); } } }; - match (&"()", &<() as EvmData>::solidity_type()) { + match (&"()", &<() as Codec>::signature()) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -1493,12 +1239,9 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"name")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "name" ), ), ); @@ -1511,7 +1254,7 @@ where BoundedString>, BoundedString>, u8, - ) as EvmData>::solidity_type(), + ) as Codec>::signature(), ) { (left_val, right_val) => { if !(*left_val == *right_val) { @@ -1521,12 +1264,9 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"set_metadata")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "set_metadata" ), ), ); @@ -1535,7 +1275,7 @@ where }; match ( &"(address,address,address)", - &<(Address, Address, Address) as EvmData>::solidity_type(), + &<(Address, Address, Address) as Codec>::signature(), ) { (left_val, right_val) => { if !(*left_val == *right_val) { @@ -1545,19 +1285,16 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"set_team")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "set_team" ), ), ); } } }; - match (&"()", &<() as EvmData>::solidity_type()) { + match (&"()", &<() as Codec>::signature()) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -1566,19 +1303,16 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"symbol")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "symbol" ), ), ); } } }; - match (&"(address)", &<(Address,) as EvmData>::solidity_type()) { + match (&"(address)", &<(Address,) as Codec>::signature()) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -1587,19 +1321,16 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"thaw")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "thaw" ), ), ); } } }; - match (&"()", &<() as EvmData>::solidity_type()) { + match (&"()", &<() as Codec>::signature()) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -1608,19 +1339,16 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"thaw_asset")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "thaw_asset" ), ), ); } } }; - match (&"()", &<() as EvmData>::solidity_type()) { + match (&"()", &<() as Codec>::signature()) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -1629,19 +1357,16 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"total_supply")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "total_supply" ), ), ); } } }; - match (&"(address,uint256)", &<(Address, U256) as EvmData>::solidity_type()) { + match (&"(address,uint256)", &<(Address, U256) as Codec>::signature()) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -1650,12 +1375,9 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"transfer")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "transfer" ), ), ); @@ -1664,7 +1386,7 @@ where }; match ( &"(address,address,uint256)", - &<(Address, Address, U256) as EvmData>::solidity_type(), + &<(Address, Address, U256) as Codec>::signature(), ) { (left_val, right_val) => { if !(*left_val == *right_val) { @@ -1674,19 +1396,16 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[::core::fmt::ArgumentV1::new_display(&"transfer_from")], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "transfer_from" ), ), ); } } }; - match (&"(address)", &<(Address,) as EvmData>::solidity_type()) { + match (&"(address)", &<(Address,) as Codec>::signature()) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; @@ -1695,14 +1414,9 @@ where &*left_val, &*right_val, ::core::option::Option::Some( - ::core::fmt::Arguments::new_v1( - &[ - "", - " function signature doesn\'t match (left: attribute, right: computed from Rust types)", - ], - &[ - ::core::fmt::ArgumentV1::new_display(&"transfer_ownership"), - ], + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "transfer_ownership" ), ), ); diff --git a/precompiles/utils/macro/tests/precompile/expand/precompileset.rs b/precompiles/utils/macro/tests/expand/precompileset.rs similarity index 95% rename from precompiles/utils/macro/tests/precompile/expand/precompileset.rs rename to precompiles/utils/macro/tests/expand/precompileset.rs index 16c132ae..8edb5edd 100644 --- a/precompiles/utils/macro/tests/precompile/expand/precompileset.rs +++ b/precompiles/utils/macro/tests/expand/precompileset.rs @@ -1,18 +1,18 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . use { core::marker::PhantomData, diff --git a/precompiles/utils/macro/tests/expand/returns_tuple.expanded.rs b/precompiles/utils/macro/tests/expand/returns_tuple.expanded.rs new file mode 100644 index 00000000..1f4f4642 --- /dev/null +++ b/precompiles/utils/macro/tests/expand/returns_tuple.expanded.rs @@ -0,0 +1,128 @@ +use { + precompile_utils::{EvmResult, prelude::*}, + sp_core::{H160, U256}, +}; +struct ExamplePrecompile; +impl ExamplePrecompile { + fn example( + handle: &mut impl PrecompileHandle, + ) -> EvmResult<(Address, U256, UnboundedBytes)> { + ::core::panicking::panic_fmt( + format_args!("not yet implemented: {0}", format_args!("example")), + ) + } +} +#[allow(non_camel_case_types)] +pub enum ExamplePrecompileCall { + example {}, + #[doc(hidden)] + __phantom(::core::marker::PhantomData<()>, ::core::convert::Infallible), +} +impl ExamplePrecompileCall { + pub fn parse_call_data( + handle: &mut impl PrecompileHandle, + ) -> ::precompile_utils::EvmResult { + use ::precompile_utils::solidity::revert::RevertReason; + let input = handle.input(); + let selector = input + .get(0..4) + .map(|s| { + let mut buffer = [0u8; 4]; + buffer.copy_from_slice(s); + u32::from_be_bytes(buffer) + }); + match selector { + Some(1412775727u32) => Self::_parse_example(handle), + Some(_) => Err(RevertReason::UnknownSelector.into()), + None => Err(RevertReason::read_out_of_bounds("selector").into()), + } + } + fn _parse_example( + handle: &mut impl PrecompileHandle, + ) -> ::precompile_utils::EvmResult { + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; + handle.check_function_modifier(FunctionModifier::NonPayable)?; + Ok(Self::example {}) + } + pub fn execute( + self, + handle: &mut impl PrecompileHandle, + ) -> ::precompile_utils::EvmResult<::fp_evm::PrecompileOutput> { + use ::precompile_utils::solidity::codec::Writer; + use ::fp_evm::{PrecompileOutput, ExitSucceed}; + let output = match self { + Self::example {} => { + let output = ::example(handle); + ::precompile_utils::solidity::encode_return_value(output?) + } + Self::__phantom(_, _) => { + ::core::panicking::panic_fmt( + format_args!("__phantom variant should not be used"), + ) + } + }; + Ok(PrecompileOutput { + exit_status: ExitSucceed::Returned, + output, + }) + } + pub fn supports_selector(selector: u32) -> bool { + match selector { + 1412775727u32 => true, + _ => false, + } + } + pub fn selectors() -> &'static [u32] { + &[1412775727u32] + } + pub fn example_selectors() -> &'static [u32] { + &[1412775727u32] + } + pub fn encode(self) -> ::sp_std::vec::Vec { + use ::precompile_utils::solidity::codec::Writer; + match self { + Self::example {} => Writer::new_with_selector(1412775727u32).build(), + Self::__phantom(_, _) => { + ::core::panicking::panic_fmt( + format_args!("__phantom variant should not be used"), + ) + } + } + } +} +impl From for ::sp_std::vec::Vec { + fn from(a: ExamplePrecompileCall) -> ::sp_std::vec::Vec { + a.encode() + } +} +impl ::fp_evm::Precompile for ExamplePrecompile { + fn execute( + handle: &mut impl PrecompileHandle, + ) -> ::precompile_utils::EvmResult<::fp_evm::PrecompileOutput> { + ::parse_call_data(handle)?.execute(handle) + } +} +#[allow(non_snake_case)] +pub(crate) fn __ExamplePrecompile_test_solidity_signatures_inner() { + use ::precompile_utils::solidity::Codec; + match (&"()", &<() as Codec>::signature()) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::Some( + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "example" + ), + ), + ); + } + } + }; +} diff --git a/precompiles/utils/macro/tests/expand/returns_tuple.rs b/precompiles/utils/macro/tests/expand/returns_tuple.rs new file mode 100644 index 00000000..b87fe122 --- /dev/null +++ b/precompiles/utils/macro/tests/expand/returns_tuple.rs @@ -0,0 +1,33 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +use { + precompile_utils::{EvmResult, prelude::*}, + sp_core::{H160, U256}, +}; + +struct ExamplePrecompile; + +#[precompile_utils_macro::precompile] +impl ExamplePrecompile +{ + #[precompile::public("example()")] + fn example( + handle: &mut impl PrecompileHandle, + ) -> EvmResult<(Address, U256, UnboundedBytes)> { + todo!("example") + } +} \ No newline at end of file diff --git a/precompiles/utils/macro/tests/pass/derive_codec.rs b/precompiles/utils/macro/tests/pass/derive_codec.rs new file mode 100644 index 00000000..c23f5611 --- /dev/null +++ b/precompiles/utils/macro/tests/pass/derive_codec.rs @@ -0,0 +1,79 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +use precompile_utils::solidity::codec::{Address, Codec, Reader, Writer}; +use sp_core::H160; + +#[derive(Debug, Clone, PartialEq, Eq, Codec)] +struct StaticSize { + id: u32, + address: Address, +} + +#[derive(Debug, Clone, PartialEq, Eq, Codec)] +struct DynamicSize { + id: u32, + array: Vec, +} + +fn main() { + // static + let static_size = StaticSize { + id: 5, + address: H160::repeat_byte(0x42).into(), + }; + + assert!(StaticSize::has_static_size()); + assert_eq!(&StaticSize::signature(), "(uint32,address)"); + + let bytes = Writer::new().write(static_size.clone()).build(); + assert_eq!( + bytes, + Writer::new() + .write(5u32) + .write(Address::from(H160::repeat_byte(0x42))) + .build() + ); + + let mut reader = Reader::new(&bytes); + let static_size_2: StaticSize = reader.read().expect("to decode properly"); + assert_eq!(static_size_2, static_size); + + // dynamic + let dynamic_size = DynamicSize { + id: 6, + array: vec![10u32, 15u32], + }; + assert!(!DynamicSize::::has_static_size()); + assert_eq!(DynamicSize::::signature(), "(uint32,uint32[])"); + + let bytes = Writer::new().write(dynamic_size.clone()).build(); + assert_eq!( + bytes, + Writer::new() + .write(0x20u32) // offset of struct + .write(6u32) // id + .write(0x40u32) // array offset + .write(2u32) // array size + .write(10u32) // array[0] + .write(15u32) // array[1] + .build() + ); + + let mut reader = Reader::new(&bytes); + let dynamic_size_2: DynamicSize = reader.read().expect("to decode properly"); + assert_eq!(dynamic_size_2, dynamic_size); +} diff --git a/precompiles/utils/macro/tests/pass/precompile_fn_modifiers.rs b/precompiles/utils/macro/tests/pass/precompile_fn_modifiers.rs new file mode 100644 index 00000000..7437a11e --- /dev/null +++ b/precompiles/utils/macro/tests/pass/precompile_fn_modifiers.rs @@ -0,0 +1,89 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +use { + precompile_utils::{EvmResult, prelude::*, testing::PrecompileTesterExt}, + sp_core::H160 +}; + +pub struct PrecompileSet; + +#[precompile_utils_macro::precompile] +#[precompile::precompile_set] +impl PrecompileSet { + #[precompile::discriminant] + fn discriminant(_: H160) -> Option<()> { + Some(()) + } + + #[precompile::public("default()")] + fn default(_: (), _: &mut impl PrecompileHandle) -> EvmResult { + Ok(()) + } + + #[precompile::public("view()")] + #[precompile::view] + fn view(_: (), _: &mut impl PrecompileHandle) -> EvmResult { + Ok(()) + } + + #[precompile::public("payable()")] + #[precompile::payable] + fn payable(_: (), _: &mut impl PrecompileHandle) -> EvmResult { + Ok(()) + } +} + +fn main() { + PrecompileSet.prepare_test( + [0u8;20], + [0u8;20], + PrecompileSetCall::default {} + ).with_value(1) + .execute_reverts(|output| output == b"Function is not payable"); + + PrecompileSet.prepare_test( + [0u8;20], + [0u8;20], + PrecompileSetCall::default {} + ).with_static_call(true) + .execute_reverts(|output| output == b"Can't call non-static function in static context"); + + PrecompileSet.prepare_test( + [0u8;20], + [0u8;20], + PrecompileSetCall::view {} + ).with_value(1) + .execute_reverts(|output| output == b"Function is not payable"); + + PrecompileSet.prepare_test( + [0u8;20], + [0u8;20], + PrecompileSetCall::view {} + ).with_static_call(true) + .execute_returns(()); + + PrecompileSet.prepare_test( + [0u8;20], + [0u8;20], + PrecompileSetCall::payable {} + ).with_value(1) + .execute_returns(()); + + PrecompileSet.prepare_test( + [0u8;20], + [0u8;20], + PrecompileSetCall::payable {} + ).with_static_call(true) + .execute_reverts(|output| output == b"Can't call non-static function in static context"); +} \ No newline at end of file diff --git a/precompiles/utils/macro/tests/precompile.rs b/precompiles/utils/macro/tests/precompile.rs deleted file mode 100644 index 5501a286..00000000 --- a/precompiles/utils/macro/tests/precompile.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. - -// Stability is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Stability is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Stability. If not, see . -#[test] -fn ui() { - let t = trybuild::TestCases::new(); - t.compile_fail("tests/precompile/compile-fail/**/*.rs"); - t.pass("tests/precompile/pass/**/*.rs"); -} - -#[test] -fn expand() { - macrotest::expand("tests/precompile/expand/**/*.rs"); -} diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/missing-param.stderr b/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/missing-param.stderr deleted file mode 100644 index 1f974294..00000000 --- a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/missing-param.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error: The discriminant function must only take the code address (H160) as parameter. - --> tests/precompile/compile-fail/discriminant/missing-param.rs:24:2 - | -24 | fn discriminant() -> Option { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/return-incomplete-option.stderr b/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/return-incomplete-option.stderr deleted file mode 100644 index 12700a76..00000000 --- a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/return-incomplete-option.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error: The discriminant function must return an Option<_> (no type alias) - --> tests/precompile/compile-fail/discriminant/return-incomplete-option.rs:24:36 - | -24 | fn discriminant(address: H160) -> Option { - | ^^^^^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/too-many-arguments.stderr b/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/too-many-arguments.stderr deleted file mode 100644 index 749bc8e8..00000000 --- a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/too-many-arguments.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error: The discriminant function must only take the code address (H160) as parameter. - --> tests/precompile/compile-fail/discriminant/too-many-arguments.rs:24:2 - | -24 | fn discriminant(address: H160, other: u32) -> Option { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/type-mismatch-1.stderr b/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/type-mismatch-1.stderr deleted file mode 100644 index 57dea26e..00000000 --- a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/type-mismatch-1.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error: All discriminants must have the same type (found u64 before) - --> tests/precompile/compile-fail/discriminant/type-mismatch-1.rs:29:24 - | -29 | fn foo(_discriminant: u32, test: &mut impl PrecompileHandle) -> EvmResult { - | ^^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/type-mismatch-2.stderr b/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/type-mismatch-2.stderr deleted file mode 100644 index a429d740..00000000 --- a/precompiles/utils/macro/tests/precompile/compile-fail/discriminant/type-mismatch-2.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error: All discriminants must have the same type (found u32 before) - --> tests/precompile/compile-fail/discriminant/type-mismatch-2.rs:29:43 - | -29 | fn discriminant(address: H160) -> Option { - | ^^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/evm-data/no-output.stderr b/precompiles/utils/macro/tests/precompile/compile-fail/evm-data/no-output.stderr deleted file mode 100644 index 2db5ff97..00000000 --- a/precompiles/utils/macro/tests/precompile/compile-fail/evm-data/no-output.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error: A precompile method must have a return type of `EvmResult<_>` (exposed by `precompile_utils`) - --> tests/precompile/compile-fail/evm-data/no-output.rs:23:2 - | -23 | fn foo(test: &mut impl PrecompileHandle) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/handle/missing.stderr b/precompiles/utils/macro/tests/precompile/compile-fail/handle/missing.stderr deleted file mode 100644 index 44ed36d3..00000000 --- a/precompiles/utils/macro/tests/precompile/compile-fail/handle/missing.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error: Precompile methods must have at least 1 parameter (the PrecompileHandle) - --> tests/precompile/compile-fail/handle/missing.rs:23:2 - | -23 | fn foo() { - | ^^^^^^^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/pre-check/no-parameter.stderr b/precompiles/utils/macro/tests/precompile/compile-fail/pre-check/no-parameter.stderr deleted file mode 100644 index 01df4cd5..00000000 --- a/precompiles/utils/macro/tests/precompile/compile-fail/pre-check/no-parameter.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error: Precompile methods must have at least 1 parameter (the PrecompileHandle) - --> tests/precompile/compile-fail/pre-check/no-parameter.rs:23:2 - | -23 | fn pre_check() { - | ^^^^^^^^^^^^^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/pre-check/too-many-parameters.stderr b/precompiles/utils/macro/tests/precompile/compile-fail/pre-check/too-many-parameters.stderr deleted file mode 100644 index cbb908a5..00000000 --- a/precompiles/utils/macro/tests/precompile/compile-fail/pre-check/too-many-parameters.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error: Precompile pre_check method must have exactly 1 parameter (the PrecompileHandle) - --> tests/precompile/compile-fail/pre-check/too-many-parameters.rs:23:2 - | -23 | fn pre_check(_: &mut impl PrecompileHandle, _: u32) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/pre-check/wrong-parameter.stderr b/precompiles/utils/macro/tests/precompile/compile-fail/pre-check/wrong-parameter.stderr deleted file mode 100644 index c1207e46..00000000 --- a/precompiles/utils/macro/tests/precompile/compile-fail/pre-check/wrong-parameter.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error: This parameter must have type `&mut impl PrecompileHandle` - --> tests/precompile/compile-fail/pre-check/wrong-parameter.rs:23:18 - | -23 | fn pre_check(_: u32) { - | ^^^ diff --git a/precompiles/utils/macro/tests/precompile/compile-fail/test/generic-arg.stderr b/precompiles/utils/macro/tests/precompile/compile-fail/test/generic-arg.stderr deleted file mode 100644 index b37f5ee7..00000000 --- a/precompiles/utils/macro/tests/precompile/compile-fail/test/generic-arg.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error[E0412]: cannot find type `R` in this scope - --> tests/precompile/compile-fail/test/generic-arg.rs:23:63 - | -21 | impl> Precompile { - | - help: you might be missing a type parameter: `` -22 | #[precompile::public("foo(bytes)")] -23 | fn foo(handle: &mut impl PrecompileHandle, arg: BoundedBytes) -> EvmResult { - | ^ not found in this scope diff --git a/precompiles/utils/macro/tests/precompile/pass/fn-modifiers.rs b/precompiles/utils/macro/tests/precompile/pass/fn-modifiers.rs deleted file mode 100644 index b9c16f76..00000000 --- a/precompiles/utils/macro/tests/precompile/pass/fn-modifiers.rs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. - -// Stability is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Stability is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Stability. If not, see . - -use { - core::marker::PhantomData, - precompile_utils::{prelude::*, testing::PrecompileTesterExt, EvmResult}, - sp_core::H160, -}; - -pub struct PrecompileSet; - -#[precompile_utils_macro::precompile] -#[precompile::precompile_set] -impl PrecompileSet { - #[precompile::discriminant] - fn discriminant(_: H160) -> Option<()> { - Some(()) - } - - #[precompile::public("default()")] - fn default(_: (), _: &mut impl PrecompileHandle) -> EvmResult { - Ok(()) - } - - #[precompile::public("view()")] - #[precompile::view] - fn view(_: (), _: &mut impl PrecompileHandle) -> EvmResult { - Ok(()) - } - - #[precompile::public("payable()")] - #[precompile::payable] - fn payable(_: (), _: &mut impl PrecompileHandle) -> EvmResult { - Ok(()) - } -} - -fn main() { - PrecompileSet - .prepare_test([0u8; 20], [0u8; 20], PrecompileSetCall::default {}) - .with_value(1) - .execute_reverts(|output| output == b"Function is not payable"); - - PrecompileSet - .prepare_test([0u8; 20], [0u8; 20], PrecompileSetCall::default {}) - .with_static_call(true) - .execute_reverts(|output| output == b"Can't call non-static function in static context"); - - PrecompileSet - .prepare_test([0u8; 20], [0u8; 20], PrecompileSetCall::view {}) - .with_value(1) - .execute_reverts(|output| output == b"Function is not payable"); - - PrecompileSet - .prepare_test([0u8; 20], [0u8; 20], PrecompileSetCall::view {}) - .with_static_call(true) - .execute_returns_encoded(()); - - PrecompileSet - .prepare_test([0u8; 20], [0u8; 20], PrecompileSetCall::payable {}) - .with_value(1) - .execute_returns_encoded(()); - - PrecompileSet - .prepare_test([0u8; 20], [0u8; 20], PrecompileSetCall::payable {}) - .with_static_call(true) - .execute_reverts(|output| output == b"Can't call non-static function in static context"); -} diff --git a/precompiles/utils/macro/tests/tests.rs b/precompiles/utils/macro/tests/tests.rs index 163b34cb..b392fd02 100644 --- a/precompiles/utils/macro/tests/tests.rs +++ b/precompiles/utils/macro/tests/tests.rs @@ -1,25 +1,20 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . -use sha3::{Digest, Keccak256}; +// along with Moonbeam. If not, see . -#[precompile_utils_macro::generate_function_selector] -pub enum Action { - Toto = "toto()", - Tata = "tata()", -} +use sha3::{Digest, Keccak256}; #[test] fn test_keccak256() { @@ -38,14 +33,21 @@ fn test_keccak256() { } #[test] -fn test_generate_function_selector() { - assert_eq!( - &(Action::Toto as u32).to_be_bytes()[..], - &Keccak256::digest(b"toto()")[0..4], - ); - assert_eq!( - &(Action::Tata as u32).to_be_bytes()[..], - &Keccak256::digest(b"tata()")[0..4], - ); - assert_ne!(Action::Toto as u32, Action::Tata as u32); +#[ignore] +fn ui() { + let t = trybuild::TestCases::new(); + t.compile_fail("tests/compile-fail/**/*.rs"); + t.pass("tests/pass/**/*.rs"); +} + +// Cargo expand is not supported on stable rust +#[test] +#[ignore] +fn expand() { + // Use `expand` to update the expansions + // Replace it with `expand_without_refresh` afterward so that + // CI checks the expension don't change + + // macrotest::expand("tests/expand/**/*.rs"); + macrotest::expand_without_refresh("tests/expand/**/*.rs"); } diff --git a/precompiles/utils/src/costs.rs b/precompiles/utils/src/evm/costs.rs similarity index 91% rename from precompiles/utils/src/costs.rs rename to precompiles/utils/src/evm/costs.rs index 7786e818..5f2abd25 100644 --- a/precompiles/utils/src/costs.rs +++ b/precompiles/utils/src/evm/costs.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + //! Cost calculations. //! TODO: PR EVM to make those cost calculations public. diff --git a/precompiles/utils/src/evm/handle.rs b/precompiles/utils/src/evm/handle.rs new file mode 100644 index 00000000..a468fa9a --- /dev/null +++ b/precompiles/utils/src/evm/handle.rs @@ -0,0 +1,199 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +use { + crate::{ + solidity::{ + codec::Reader, + modifier::FunctionModifier, + revert::{MayRevert, RevertReason}, + }, + EvmResult, + }, + fp_evm::{Log, PrecompileHandle}, +}; + +pub trait PrecompileHandleExt: PrecompileHandle { + /// Record cost of a log manually. + /// This can be useful to record log costs early when their content have static size. + #[must_use] + fn record_log_costs_manual(&mut self, topics: usize, data_len: usize) -> EvmResult; + + /// Record cost of logs. + #[must_use] + fn record_log_costs(&mut self, logs: &[&Log]) -> EvmResult; + + #[must_use] + /// Check that a function call is compatible with the context it is + /// called into. + fn check_function_modifier(&self, modifier: FunctionModifier) -> MayRevert; + + #[must_use] + /// Read the selector from the input data. + fn read_u32_selector(&self) -> MayRevert; + + #[must_use] + /// Returns a reader of the input, skipping the selector. + fn read_after_selector(&self) -> MayRevert; +} + +impl PrecompileHandleExt for T { + /// Record cost of a log manualy. + /// This can be useful to record log costs early when their content have static size. + #[must_use] + fn record_log_costs_manual(&mut self, topics: usize, data_len: usize) -> EvmResult { + self.record_cost(crate::evm::costs::log_costs(topics, data_len)?)?; + + Ok(()) + } + + /// Record cost of logs. + #[must_use] + fn record_log_costs(&mut self, logs: &[&Log]) -> EvmResult { + for log in logs { + self.record_log_costs_manual(log.topics.len(), log.data.len())?; + } + + Ok(()) + } + + #[must_use] + /// Check that a function call is compatible with the context it is + /// called into. + fn check_function_modifier(&self, modifier: FunctionModifier) -> MayRevert { + crate::solidity::modifier::check_function_modifier( + self.context(), + self.is_static(), + modifier, + ) + } + + #[must_use] + /// Read the selector from the input data as u32. + fn read_u32_selector(&self) -> MayRevert { + crate::solidity::codec::selector(self.input()) + .ok_or(RevertReason::read_out_of_bounds("selector").into()) + } + + #[must_use] + /// Returns a reader of the input, skipping the selector. + fn read_after_selector(&self) -> MayRevert { + Reader::new_skip_selector(self.input()) + } +} + +environmental::environmental!(EVM_CONTEXT: trait PrecompileHandle); + +pub fn using_precompile_handle<'a, R, F: FnOnce() -> R>( + precompile_handle: &'a mut dyn PrecompileHandle, + mutator: F, +) -> R { + // # Safety + // + // unsafe rust does not mean unsafe, but "the compiler cannot guarantee the safety of the + // memory". + // + // The only risk here is that the lifetime 'a comes to its end while the global variable + // `EVM_CONTEXT` still contains the reference to the precompile handle. + // The `using` method guarantee that it can't happen because the global variable is freed right + // after the execution of the `mutator` closure (whatever the result of the execution). + unsafe { + EVM_CONTEXT::using( + core::mem::transmute::<&'a mut dyn PrecompileHandle, &'static mut dyn PrecompileHandle>( + precompile_handle, + ), + mutator, + ) + } +} + +pub fn with_precompile_handle R>(f: F) -> Option { + EVM_CONTEXT::with(|precompile_handle| f(precompile_handle)) +} + +#[cfg(test)] +mod tests { + use super::*; + + struct MockPrecompileHandle; + impl PrecompileHandle for MockPrecompileHandle { + fn call( + &mut self, + _: sp_core::H160, + _: Option, + _: Vec, + _: Option, + _: bool, + _: &evm::Context, + ) -> (evm::ExitReason, Vec) { + unimplemented!() + } + + fn record_cost(&mut self, _: u64) -> Result<(), evm::ExitError> { + unimplemented!() + } + + fn remaining_gas(&self) -> u64 { + unimplemented!() + } + + fn log( + &mut self, + _: sp_core::H160, + _: Vec, + _: Vec, + ) -> Result<(), evm::ExitError> { + unimplemented!() + } + + fn code_address(&self) -> sp_core::H160 { + unimplemented!() + } + + fn input(&self) -> &[u8] { + unimplemented!() + } + + fn context(&self) -> &evm::Context { + unimplemented!() + } + + fn is_static(&self) -> bool { + true + } + + fn gas_limit(&self) -> Option { + unimplemented!() + } + } + + #[test] + fn with_precompile_handle_without_context() { + assert_eq!(with_precompile_handle(|_| {}), None); + } + + #[test] + fn with_precompile_handle_with_context() { + let mut precompile_handle = MockPrecompileHandle; + + assert_eq!( + using_precompile_handle(&mut precompile_handle, || with_precompile_handle( + |handle| handle.is_static() + )), + Some(true) + ); + } +} diff --git a/precompiles/utils/src/logs.rs b/precompiles/utils/src/evm/logs.rs similarity index 87% rename from precompiles/utils/src/logs.rs rename to precompiles/utils/src/evm/logs.rs index d1bafa4d..2dde6ff1 100644 --- a/precompiles/utils/src/logs.rs +++ b/precompiles/utils/src/evm/logs.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use { crate::EvmResult, pallet_evm::{Log, PrecompileHandle}, @@ -102,6 +103,6 @@ impl LogExt for Log { } fn compute_cost(&self) -> EvmResult { - crate::costs::log_costs(self.topics.len(), self.data.len()) + crate::evm::costs::log_costs(self.topics.len(), self.data.len()) } } diff --git a/precompiles/utils/src/evm/mod.rs b/precompiles/utils/src/evm/mod.rs new file mode 100644 index 00000000..6b4cc27f --- /dev/null +++ b/precompiles/utils/src/evm/mod.rs @@ -0,0 +1,19 @@ +// Copyright 2019-2023 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +pub mod costs; +pub mod handle; +pub mod logs; diff --git a/precompiles/utils/src/handle.rs b/precompiles/utils/src/handle.rs deleted file mode 100644 index dbeb01a8..00000000 --- a/precompiles/utils/src/handle.rs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. - -// Stability is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Stability is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Stability. If not, see . -use { - crate::{data::EvmDataReader, modifier::FunctionModifier, revert::MayRevert, EvmResult}, - fp_evm::{Log, PrecompileHandle}, -}; - -pub trait PrecompileHandleExt: PrecompileHandle { - /// Record cost of a log manually. - /// This can be useful to record log costs early when their content have static size. - #[must_use] - fn record_log_costs_manual(&mut self, topics: usize, data_len: usize) -> EvmResult; - - /// Record cost of logs. - #[must_use] - fn record_log_costs(&mut self, logs: &[&Log]) -> EvmResult; - - #[must_use] - /// Check that a function call is compatible with the context it is - /// called into. - fn check_function_modifier(&self, modifier: FunctionModifier) -> MayRevert; - - #[must_use] - /// Read the selector from the input data. - fn read_selector(&self) -> MayRevert - where - T: num_enum::TryFromPrimitive; - - #[must_use] - /// Read the selector from the input data. - fn read_u32_selector(&self) -> MayRevert; - - #[must_use] - /// Returns a reader of the input, skipping the selector. - fn read_after_selector(&self) -> MayRevert; -} - -impl PrecompileHandleExt for T { - /// Record cost of a log manualy. - /// This can be useful to record log costs early when their content have static size. - #[must_use] - fn record_log_costs_manual(&mut self, topics: usize, data_len: usize) -> EvmResult { - self.record_cost(crate::costs::log_costs(topics, data_len)?)?; - - Ok(()) - } - - /// Record cost of logs. - #[must_use] - fn record_log_costs(&mut self, logs: &[&Log]) -> EvmResult { - for log in logs { - self.record_log_costs_manual(log.topics.len(), log.data.len())?; - } - - Ok(()) - } - - #[must_use] - /// Check that a function call is compatible with the context it is - /// called into. - fn check_function_modifier(&self, modifier: FunctionModifier) -> MayRevert { - crate::modifier::check_function_modifier(self.context(), self.is_static(), modifier) - } - - #[must_use] - /// Read the selector from the input data. - fn read_selector(&self) -> MayRevert - where - S: num_enum::TryFromPrimitive, - { - EvmDataReader::read_selector(self.input()) - } - - #[must_use] - /// Read the selector from the input data as u32. - fn read_u32_selector(&self) -> MayRevert { - EvmDataReader::read_u32_selector(self.input()) - } - - #[must_use] - /// Returns a reader of the input, skipping the selector. - fn read_after_selector(&self) -> MayRevert { - EvmDataReader::new_skip_selector(self.input()) - } -} diff --git a/precompiles/utils/src/lib.rs b/precompiles/utils/src/lib.rs index add73d78..7c847654 100644 --- a/precompiles/utils/src/lib.rs +++ b/precompiles/utils/src/lib.rs @@ -1,104 +1,83 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + #![cfg_attr(not(feature = "std"), no_std)] -#![feature(assert_matches)] extern crate alloc; -pub mod costs; -pub mod handle; -pub mod logs; -pub mod modifier; +// Allows to use inside this crate `solidity::Codec` derive macro,which depends on +// `precompile_utils` being in the list of imported crates. +extern crate self as precompile_utils; + +pub mod evm; pub mod precompile_set; -pub mod revert; pub mod substrate; +pub mod solidity; + #[cfg(feature = "testing")] pub mod testing; #[cfg(test)] mod tests; -use crate::alloc::{borrow::ToOwned, vec::Vec}; -use fp_evm::{ExitRevert, ExitSucceed, PrecompileFailure, PrecompileHandle, PrecompileOutput}; +use fp_evm::PrecompileFailure; -pub mod data; +// pub mod data; -pub use data::{EvmData, EvmDataReader, EvmDataWriter}; +// pub use data::{solidity::Codec, Reader, Writer}; pub use fp_evm::Precompile; -pub use precompile_utils_macro::{ - generate_function_selector, keccak256, precompile, precompile_name_from_address, -}; - -/// Generated a `PrecompileFailure::Revert` with proper encoding for the output. -/// If the revert needs improved formatting such as backtraces, `Revert` type should -/// be used instead. -#[must_use] -pub fn revert(output: impl AsRef<[u8]>) -> PrecompileFailure { - PrecompileFailure::Revert { - exit_status: ExitRevert::Reverted, - output: encoded_revert(output), - } -} - -pub fn encoded_revert(output: impl AsRef<[u8]>) -> Vec { - EvmDataWriter::new_with_selector(revert::RevertSelector::Generic) - .write::(output.as_ref().to_owned().into()) - .build() -} - -#[must_use] -pub fn succeed(output: impl AsRef<[u8]>) -> PrecompileOutput { - PrecompileOutput { - exit_status: ExitSucceed::Returned, - output: output.as_ref().to_owned(), - } -} +pub use precompile_utils_macro::{keccak256, precompile, precompile_name_from_address}; /// Alias for Result returning an EVM precompile error. pub type EvmResult = Result; -/// Trait similar to `fp_evm::Precompile` but with a `&self` parameter to manage some -/// state (this state is only kept in a single transaction and is lost afterward). -pub trait StatefulPrecompile { - /// Instanciate the precompile. - /// Will be called once when building the PrecompileSet at the start of each - /// Ethereum transaction. - fn new() -> Self; - - /// Execute the precompile with a reference to its state. - fn execute(&self, handle: &mut impl PrecompileHandle) -> EvmResult; -} - pub mod prelude { pub use { crate::{ - data::{ - Address, BoundedBytes, BoundedString, BoundedVec, EvmData, EvmDataReader, - EvmDataWriter, SolidityConvert, UnboundedBytes, UnboundedString, + evm::{ + handle::PrecompileHandleExt, + logs::{log0, log1, log2, log3, log4, LogExt}, + }, + precompile_set::DiscriminantResult, + solidity::{ + // We export solidity itself to encourage using `solidity::Codec` to avoid confusion + // with parity_scale_codec, + self, + codec::{ + Address, + BoundedBytes, + BoundedString, + BoundedVec, + // Allow usage of Codec methods while not exporting the name directly. + Codec as _, + Convert, + UnboundedBytes, + UnboundedString, + }, + revert::{ + revert, BacktraceExt, InjectBacktrace, MayRevert, Revert, RevertExt, + RevertReason, + }, }, - handle::PrecompileHandleExt, - logs::{log0, log1, log2, log3, log4, LogExt}, - modifier::{check_function_modifier, FunctionModifier}, - read_args, read_struct, revert, - revert::{BacktraceExt, InjectBacktrace, MayRevert, Revert, RevertExt, RevertReason}, substrate::{RuntimeHelper, TryDispatchError}, - succeed, EvmResult, StatefulPrecompile, + EvmResult, }, + alloc::string::String, pallet_evm::{PrecompileHandle, PrecompileOutput}, - precompile_utils_macro::{generate_function_selector, keccak256, precompile}, + precompile_utils_macro::{keccak256, precompile}, }; } diff --git a/precompiles/utils/src/precompile_set.rs b/precompiles/utils/src/precompile_set.rs index e423465a..f84eb862 100644 --- a/precompiles/utils/src/precompile_set.rs +++ b/precompiles/utils/src/precompile_set.rs @@ -1,93 +1,394 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . -//! Provide utils assemble precompiles and precompilesets into a +// along with Moonbeam. If not, see . + +//! Provide utils to assemble precompiles and precompilesets into a //! final precompile set with security checks. All security checks are enabled by //! default and must be disabled explicely throught type annotations. -use crate::{revert, StatefulPrecompile}; -use fp_evm::{Precompile, PrecompileHandle, PrecompileResult, PrecompileSet}; +use crate::{ + solidity::{codec::String, revert::revert}, + substrate::RuntimeHelper, + EvmResult, +}; +use fp_evm::{ + ExitError, IsPrecompileResult, Precompile, PrecompileFailure, PrecompileHandle, + PrecompileResult, PrecompileSet, +}; use frame_support::pallet_prelude::Get; use impl_trait_for_tuples::impl_for_tuples; -use sp_core::H160; +use pallet_evm::AddressMapping; +use sp_core::{H160, H256}; use sp_std::{ cell::RefCell, collections::btree_map::BTreeMap, marker::PhantomData, ops::RangeInclusive, vec, vec::Vec, }; -// CONFIGURATION TYPES +/// Trait representing checks that can be made on a precompile call. +/// Types implementing this trait are made to be chained in a tuple. +/// +/// For that reason every method returns an Option, None meaning that +/// the implementor have no constraint and the decision is left to +/// latter elements in the chain. If None is returned by all elements of +/// the chain then sensible defaults are used. +/// +/// Both `PrecompileAt` and `PrecompileSetStartingWith` have a type parameter that must +/// implement this trait to configure the checks of the precompile(set) it represents. +pub trait PrecompileChecks { + #[inline(always)] + /// Is there a limit to the amount of recursions this precompile + /// can make using subcalls? 0 means this specific precompile will not + /// be callable as a subcall of itself, 1 will allow one level of recursion, + /// etc... + /// + /// If all checks return None, defaults to `Some(0)` (no recursion allowed). + fn recursion_limit() -> Option> { + None + } + + #[inline(always)] + /// Does this precompile supports being called with DELEGATECALL or CALLCODE? + /// + /// If all checks return None, defaults to `false`. + fn accept_delegate_call() -> Option { + None + } + + #[inline(always)] + /// Is this precompile callable by a smart contract? + /// + /// If all checks return None, defaults to `false`. + fn callable_by_smart_contract(_caller: H160, _called_selector: Option) -> Option { + None + } + + #[inline(always)] + /// Is this precompile callable by a precompile? + /// + /// If all checks return None, defaults to `false`. + fn callable_by_precompile(_caller: H160, _called_selector: Option) -> Option { + None + } + + #[inline(always)] + /// Is this precompile able to do subcalls? + /// + /// If all checks return None, defaults to `false`. + fn allow_subcalls() -> Option { + None + } + + /// Summarize the checks when being called by a smart contract. + fn callable_by_smart_contract_summary() -> Option { + None + } + + /// Summarize the checks when being called by a precompile. + fn callable_by_precompile_summary() -> Option { + None + } +} + +#[derive(Debug, Clone)] +pub enum DiscriminantResult { + Some(T, u64), + None(u64), + OutOfGas, +} + +impl Into for DiscriminantResult { + fn into(self) -> IsPrecompileResult { + match self { + Self::Some(_, extra_cost) => IsPrecompileResult::Answer { + is_precompile: true, + extra_cost, + }, + Self::None(extra_cost) => IsPrecompileResult::Answer { + is_precompile: false, + extra_cost, + }, + Self::OutOfGas => IsPrecompileResult::OutOfGas, + } + } +} -mod sealed { - pub trait Sealed {} +#[derive(Debug, Clone)] +#[cfg_attr(feature = "testing", derive(serde::Serialize, serde::Deserialize))] +pub enum PrecompileKind { + Single(H160), + Prefixed(Vec), } -/// How much recursion is allows for a precompile. -pub trait RecursionLimit: sealed::Sealed { - fn recursion_limit() -> Option; +#[derive(Debug, Clone)] +#[cfg_attr(feature = "testing", derive(serde::Serialize, serde::Deserialize))] +pub struct PrecompileCheckSummary { + pub name: Option, + pub precompile_kind: PrecompileKind, + pub recursion_limit: Option, + pub accept_delegate_call: bool, + pub callable_by_smart_contract: String, + pub callable_by_precompile: String, } -/// There is no limit to the amount times a precompiles can -/// call itself recursively. -/// Should be used with care as it could cause stack overflows. -pub struct UnlimitedRecursion; -impl sealed::Sealed for UnlimitedRecursion {} -impl RecursionLimit for UnlimitedRecursion { +#[impl_for_tuples(0, 20)] +impl PrecompileChecks for Tuple { + #[inline(always)] + fn recursion_limit() -> Option> { + for_tuples!(#( + if let Some(check) = Tuple::recursion_limit() { + return Some(check); + } + )*); + + None + } + + #[inline(always)] + fn accept_delegate_call() -> Option { + for_tuples!(#( + if let Some(check) = Tuple::accept_delegate_call() { + return Some(check); + } + )*); + + None + } + + #[inline(always)] + fn callable_by_smart_contract(caller: H160, called_selector: Option) -> Option { + for_tuples!(#( + if let Some(check) = Tuple::callable_by_smart_contract(caller, called_selector) { + return Some(check); + } + )*); + + None + } + + #[inline(always)] + fn callable_by_precompile(caller: H160, called_selector: Option) -> Option { + for_tuples!(#( + if let Some(check) = Tuple::callable_by_precompile(caller, called_selector) { + return Some(check); + } + )*); + + None + } + #[inline(always)] - fn recursion_limit() -> Option { + fn allow_subcalls() -> Option { + for_tuples!(#( + if let Some(check) = Tuple::allow_subcalls() { + return Some(check); + } + )*); + + None + } + + fn callable_by_smart_contract_summary() -> Option { + for_tuples!(#( + if let Some(check) = Tuple::callable_by_smart_contract_summary() { + return Some(check); + } + )*); + None } + + fn callable_by_precompile_summary() -> Option { + for_tuples!(#( + if let Some(check) = Tuple::callable_by_precompile_summary() { + return Some(check); + } + )*); + + None + } +} + +/// Precompile can be called using DELEGATECALL/CALLCODE. +pub struct AcceptDelegateCall; + +impl PrecompileChecks for AcceptDelegateCall { + #[inline(always)] + fn accept_delegate_call() -> Option { + Some(true) + } } -/// A precompile can (even indirectly) call itself with N levels of nesting. -/// 0 = anyone can call the precompile but a subcall of the precompile will not be able to call it -/// back (re-entrancy protection). -pub struct LimitRecursionTo; -impl sealed::Sealed for LimitRecursionTo {} -impl RecursionLimit for LimitRecursionTo { +/// Precompile is able to do subcalls with provided nesting limit. +pub struct SubcallWithMaxNesting; + +impl PrecompileChecks for SubcallWithMaxNesting { #[inline(always)] - fn recursion_limit() -> Option { - Some(N) + fn recursion_limit() -> Option> { + Some(Some(R)) + } + + #[inline(always)] + fn allow_subcalls() -> Option { + Some(true) + } +} + +pub trait SelectorFilter { + fn is_allowed(_caller: H160, _selector: Option) -> bool; + + fn description() -> String; +} +pub struct ForAllSelectors; +impl SelectorFilter for ForAllSelectors { + fn is_allowed(_caller: H160, _selector: Option) -> bool { + true + } + + fn description() -> String { + "Allowed for all selectors and callers".into() } } -pub type ForbidRecursion = LimitRecursionTo<0>; +pub struct OnlyFrom(PhantomData); +impl> SelectorFilter for OnlyFrom { + fn is_allowed(caller: H160, _selector: Option) -> bool { + caller == T::get() + } -/// Is DELEGATECALL allowed to use for a precompile. -pub trait DelegateCallSupport: sealed::Sealed { - fn allow_delegate_call() -> bool; + fn description() -> String { + alloc::format!("Allowed for all selectors only if called from {}", T::get()) + } } -/// DELEGATECALL is forbiden. -pub struct ForbidDelegateCall; -impl sealed::Sealed for ForbidDelegateCall {} -impl DelegateCallSupport for ForbidDelegateCall { +pub struct CallableByContract(PhantomData); + +impl PrecompileChecks for CallableByContract { #[inline(always)] - fn allow_delegate_call() -> bool { - false + fn callable_by_smart_contract(caller: H160, called_selector: Option) -> Option { + Some(T::is_allowed(caller, called_selector)) + } + + fn callable_by_smart_contract_summary() -> Option { + Some(T::description()) } } -/// DELEGATECALL is allowed. -/// Should be used with care if the precompile use -/// custom storage, as the caller could impersonate its own caller. -pub struct AllowDelegateCall; -impl sealed::Sealed for AllowDelegateCall {} -impl DelegateCallSupport for AllowDelegateCall { +/// Precompiles are allowed to call this precompile. +pub struct CallableByPrecompile(PhantomData); + +impl PrecompileChecks for CallableByPrecompile { #[inline(always)] - fn allow_delegate_call() -> bool { - true + fn callable_by_precompile(caller: H160, called_selector: Option) -> Option { + Some(T::is_allowed(caller, called_selector)) + } + + fn callable_by_precompile_summary() -> Option { + Some(T::description()) + } +} + +/// The type of EVM address. +#[derive(PartialEq)] +#[cfg_attr(feature = "std", derive(Debug))] +pub enum AddressType { + /// The code stored at the address is less than 5 bytes, but not well known. + Unknown, + /// No code is stored at the address, therefore is EOA. + EOA, + /// The 5-byte magic constant for a precompile is stored at the address. + Precompile, + /// The code is greater than 5-bytes, potentially a Smart Contract. + Contract, +} + +/// Retrieves the type of address demarcated by `AddressType`. +pub fn get_address_type(address: H160) -> AddressType { + let code_len = pallet_evm::AccountCodes::::decode_len(address).unwrap_or(0); + + // 0 => either EOA or precompile without dummy code + if code_len == 0 { + return AddressType::EOA; + } + + // dummy code is 5 bytes long, so any other len means it is a contract. + if code_len != 5 { + return AddressType::Contract; + } + + // check code matches dummy code + let code = pallet_evm::AccountCodes::::get(address); + if &code == &[0x60, 0x00, 0x60, 0x00, 0xfd] { + return AddressType::Precompile; + } + + AddressType::Unknown +} + +fn is_address_eoa_or_precompile(address: H160) -> bool { + match get_address_type::(address) { + AddressType::EOA | AddressType::Precompile => true, + _ => false, + } +} + +/// Common checks for precompile and precompile sets. +/// Don't contain recursion check as precompile sets have recursion check for each member. +fn common_checks( + handle: &mut impl PrecompileHandle, +) -> EvmResult<()> { + let code_address = handle.code_address(); + let caller = handle.context().caller; + + // Check DELEGATECALL config. + let accept_delegate_call = C::accept_delegate_call().unwrap_or(false); + if !accept_delegate_call && code_address != handle.context().address { + return Err(revert("Cannot be called with DELEGATECALL or CALLCODE")); + } + + // Extract which selector is called. + let selector = handle.input().get(0..4).map(|bytes| { + let mut buffer = [0u8; 4]; + buffer.copy_from_slice(bytes); + u32::from_be_bytes(buffer) + }); + + // Is this selector callable from a smart contract? + let callable_by_smart_contract = + C::callable_by_smart_contract(caller, selector).unwrap_or(false); + if !callable_by_smart_contract { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + if !is_address_eoa_or_precompile::(caller) { + return Err(revert("Function not callable by smart contracts")); + } + } + + // Is this selector callable from a precompile? + let callable_by_precompile = C::callable_by_precompile(caller, selector).unwrap_or(false); + if !callable_by_precompile && is_precompile_or_fail::(caller, handle.remaining_gas())? { + return Err(revert("Function not callable by precompiles")); + } + + Ok(()) +} + +pub fn is_precompile_or_fail(address: H160, gas: u64) -> EvmResult { + match ::PrecompilesValue::get().is_precompile(address, gas) { + IsPrecompileResult::Answer { is_precompile, .. } => Ok(is_precompile), + IsPrecompileResult::OutOfGas => Err(PrecompileFailure::Error { + exit_status: ExitError::OutOfGas, + }), } } @@ -99,6 +400,80 @@ impl Get for AddressU64 { } } +pub struct RestrictiveHandle<'a, H> { + handle: &'a mut H, + allow_subcalls: bool, +} + +impl<'a, H: PrecompileHandle> PrecompileHandle for RestrictiveHandle<'a, H> { + fn call( + &mut self, + address: H160, + transfer: Option, + input: Vec, + target_gas: Option, + is_static: bool, + context: &evm::Context, + ) -> (evm::ExitReason, Vec) { + if !self.allow_subcalls { + return ( + evm::ExitReason::Revert(evm::ExitRevert::Reverted), + crate::solidity::revert::revert_as_bytes("subcalls disabled for this precompile"), + ); + } + + self.handle + .call(address, transfer, input, target_gas, is_static, context) + } + + fn record_cost(&mut self, cost: u64) -> Result<(), evm::ExitError> { + self.handle.record_cost(cost) + } + + fn remaining_gas(&self) -> u64 { + self.handle.remaining_gas() + } + + fn log( + &mut self, + address: H160, + topics: Vec, + data: Vec, + ) -> Result<(), evm::ExitError> { + self.handle.log(address, topics, data) + } + + fn code_address(&self) -> H160 { + self.handle.code_address() + } + + fn input(&self) -> &[u8] { + self.handle.input() + } + + fn context(&self) -> &evm::Context { + self.handle.context() + } + + fn is_static(&self) -> bool { + self.handle.is_static() + } + + fn gas_limit(&self) -> Option { + self.handle.gas_limit() + } +} + +/// Allows to know if a precompile is active or not. +/// This allows to detect deactivated precompile, that are still considered precompiles by +/// the EVM but that will always revert when called. +pub trait IsActivePrecompile { + /// Is the provided address an active precompile, a precompile that has + /// not be deactivated. Note that a deactivated precompile is still considered a precompile + /// for the EVM, but it will always revert when called. + fn is_active_precompile(&self, address: H160, gas: u64) -> IsPrecompileResult; +} + // INDIVIDUAL PRECOMPILE(SET) /// A fragment of a PrecompileSet. Should be implemented as is it @@ -109,13 +484,19 @@ pub trait PrecompileSetFragment { fn new() -> Self; /// Execute the fragment. - fn execute(&self, handle: &mut impl PrecompileHandle) -> Option; + fn execute( + &self, + handle: &mut impl PrecompileHandle, + ) -> Option; /// Is the provided address a precompile in this fragment? - fn is_precompile(&self, address: H160) -> bool; + fn is_precompile(&self, address: H160, gas: u64) -> IsPrecompileResult; /// Return the list of addresses covered by this fragment. fn used_addresses(&self) -> Vec; + + /// Summarize + fn summarize_checks(&self) -> Vec; } /// Wraps a stateless precompile: a type implementing the `Precompile` trait. @@ -123,17 +504,16 @@ pub trait PrecompileSetFragment { /// - A: The address of the precompile /// - R: The recursion limit (defaults to 1) /// - D: If DELEGATECALL is supported (default to no) -pub struct PrecompileAt { +pub struct PrecompileAt { current_recursion_level: RefCell, - _phantom: PhantomData<(A, P, R, D)>, + _phantom: PhantomData<(A, P, C)>, } -impl PrecompileSetFragment for PrecompileAt +impl PrecompileSetFragment for PrecompileAt where A: Get, P: Precompile, - R: RecursionLimit, - D: DelegateCallSupport, + C: PrecompileChecks, { #[inline(always)] fn new() -> Self { @@ -144,7 +524,10 @@ where } #[inline(always)] - fn execute(&self, handle: &mut impl PrecompileHandle) -> Option { + fn execute( + &self, + handle: &mut impl PrecompileHandle, + ) -> Option { let code_address = handle.code_address(); // Check if this is the address of the precompile. @@ -152,15 +535,14 @@ where return None; } - // Check DELEGATECALL config. - if !D::allow_delegate_call() && code_address != handle.context().address { - return Some(Err(revert( - "Cannot be called with DELEGATECALL or CALLCODE", - ))); + // Perform common checks. + if let Err(err) = common_checks::(handle) { + return Some(Err(err)); } // Check and increase recursion level if needed. - if let Some(max_recursion_level) = R::recursion_limit() { + let recursion_limit = C::recursion_limit().unwrap_or(Some(0)); + if let Some(max_recursion_level) = recursion_limit { match self.current_recursion_level.try_borrow_mut() { Ok(mut recursion_level) => { if *recursion_level > max_recursion_level { @@ -177,10 +559,17 @@ where } } - let res = P::execute(handle); + // Subcall protection. + let allow_subcalls = C::allow_subcalls().unwrap_or(false); + let mut handle = RestrictiveHandle { + handle, + allow_subcalls, + }; + + let res = P::execute(&mut handle); // Decrease recursion level if needed. - if R::recursion_limit().is_some() { + if recursion_limit.is_some() { match self.current_recursion_level.try_borrow_mut() { Ok(mut recursion_level) => { *recursion_level -= 1; @@ -195,103 +584,42 @@ where } #[inline(always)] - fn is_precompile(&self, address: H160) -> bool { - address == A::get() + fn is_precompile(&self, address: H160, _gas: u64) -> IsPrecompileResult { + IsPrecompileResult::Answer { + is_precompile: address == A::get(), + extra_cost: 0, + } } #[inline(always)] fn used_addresses(&self) -> Vec { vec![A::get()] } -} -/// Wraps a stateful precompile: a type implementing the `StatefulPrecompile` trait. -/// Type parameters allow to define: -/// - A: The address of the precompile -/// - R: The recursion limit (defaults to 1) -/// - D: If DELEGATECALL is supported (default to no) -pub struct StatefulPrecompileAt { - precompile: P, - current_recursion_level: RefCell, - _phantom: PhantomData<(A, R, D)>, + fn summarize_checks(&self) -> Vec { + vec![PrecompileCheckSummary { + name: None, + precompile_kind: PrecompileKind::Single(A::get()), + recursion_limit: C::recursion_limit().unwrap_or(Some(0)), + accept_delegate_call: C::accept_delegate_call().unwrap_or(false), + callable_by_smart_contract: C::callable_by_smart_contract_summary() + .unwrap_or_else(|| "Not callable".into()), + callable_by_precompile: C::callable_by_precompile_summary() + .unwrap_or_else(|| "Not callable".into()), + }] + } } -impl PrecompileSetFragment for StatefulPrecompileAt +impl IsActivePrecompile for PrecompileAt where A: Get, - P: StatefulPrecompile, - R: RecursionLimit, - D: DelegateCallSupport, { #[inline(always)] - fn new() -> Self { - Self { - precompile: P::new(), - current_recursion_level: RefCell::new(0), - _phantom: PhantomData, - } - } - - #[inline(always)] - fn execute(&self, handle: &mut impl PrecompileHandle) -> Option { - let code_address = handle.code_address(); - - // Check if this is the address of the precompile. - if A::get() != code_address { - return None; - } - - // Check DELEGATECALL config. - if !D::allow_delegate_call() && code_address != handle.context().address { - return Some(Err(revert( - "Cannot be called with DELEGATECALL or CALLCODE", - ) - .into())); - } - - // Check and increase recursion level if needed. - if let Some(max_recursion_level) = R::recursion_limit() { - match self.current_recursion_level.try_borrow_mut() { - Ok(mut recursion_level) => { - if *recursion_level > max_recursion_level { - return Some(Err( - revert("Precompile is called with too high nesting").into() - )); - } - - *recursion_level += 1; - } - // We don't hold the borrow and are in single-threaded code, thus we should - // not be able to fail borrowing in nested calls. - Err(_) => return Some(Err(revert("Couldn't check precompile nesting").into())), - } - } - - let res = self.precompile.execute(handle); - - // Decrease recursion level if needed. - if R::recursion_limit().is_some() { - match self.current_recursion_level.try_borrow_mut() { - Ok(mut recursion_level) => { - *recursion_level -= 1; - } - // We don't hold the borrow and are in single-threaded code, thus we should - // not be able to fail borrowing in nested calls. - Err(_) => return Some(Err(revert("Couldn't check precompile nesting"))), - } + fn is_active_precompile(&self, address: H160, _gas: u64) -> IsPrecompileResult { + IsPrecompileResult::Answer { + is_precompile: address == A::get(), + extra_cost: 0, } - - Some(res) - } - - #[inline(always)] - fn is_precompile(&self, address: H160) -> bool { - address == A::get() - } - - #[inline(always)] - fn used_addresses(&self) -> Vec { - vec![A::get()] } } @@ -300,18 +628,17 @@ where /// Type parameters allow to define: /// - A: The common prefix /// - D: If DELEGATECALL is supported (default to no) -pub struct PrecompileSetStartingWith { +pub struct PrecompileSetStartingWith { precompile_set: P, current_recursion_level: RefCell>, - _phantom: PhantomData<(A, R, D)>, + _phantom: PhantomData<(A, C)>, } -impl PrecompileSetFragment for PrecompileSetStartingWith +impl PrecompileSetFragment for PrecompileSetStartingWith where A: Get<&'static [u8]>, P: PrecompileSet + Default, - R: RecursionLimit, - D: DelegateCallSupport, + C: PrecompileChecks, { #[inline(always)] fn new() -> Self { @@ -323,22 +650,22 @@ where } #[inline(always)] - fn execute(&self, handle: &mut impl PrecompileHandle) -> Option { + fn execute( + &self, + handle: &mut impl PrecompileHandle, + ) -> Option { let code_address = handle.code_address(); - - if !self.is_precompile(code_address) { + if !is_precompile_or_fail::(code_address, handle.remaining_gas()).ok()? { return None; } - - // Check DELEGATECALL config. - if !D::allow_delegate_call() && code_address != handle.context().address { - return Some(Err(revert( - "Cannot be called with DELEGATECALL or CALLCODE", - ))); + // Perform common checks. + if let Err(err) = common_checks::(handle) { + return Some(Err(err)); } // Check and increase recursion level if needed. - if let Some(max_recursion_level) = R::recursion_limit() { + let recursion_limit = C::recursion_limit().unwrap_or(Some(0)); + if let Some(max_recursion_level) = recursion_limit { match self.current_recursion_level.try_borrow_mut() { Ok(mut recursion_level_map) => { let recursion_level = recursion_level_map.entry(code_address).or_insert(0); @@ -355,10 +682,17 @@ where } } - let res = self.precompile_set.execute(handle); + // Subcall protection. + let allow_subcalls = C::allow_subcalls().unwrap_or(false); + let mut handle = RestrictiveHandle { + handle, + allow_subcalls, + }; + + let res = self.precompile_set.execute(&mut handle); // Decrease recursion level if needed. - if R::recursion_limit().is_some() { + if recursion_limit.is_some() { match self.current_recursion_level.try_borrow_mut() { Ok(mut recursion_level_map) => { let recursion_level = match recursion_level_map.get_mut(&code_address) { @@ -378,8 +712,14 @@ where } #[inline(always)] - fn is_precompile(&self, address: H160) -> bool { - address.as_bytes().starts_with(A::get()) && self.precompile_set.is_precompile(address) + fn is_precompile(&self, address: H160, gas: u64) -> IsPrecompileResult { + if address.as_bytes().starts_with(A::get()) { + return self.precompile_set.is_precompile(address, gas); + } + IsPrecompileResult::Answer { + is_precompile: false, + extra_cost: 0, + } } #[inline(always)] @@ -387,6 +727,31 @@ where // TODO: We currently can't get the list of used addresses. vec![] } + + fn summarize_checks(&self) -> Vec { + let prefix = A::get(); + + vec![PrecompileCheckSummary { + name: None, + precompile_kind: PrecompileKind::Prefixed(prefix.to_vec()), + recursion_limit: C::recursion_limit().unwrap_or(Some(0)), + accept_delegate_call: C::accept_delegate_call().unwrap_or(false), + callable_by_smart_contract: C::callable_by_smart_contract_summary() + .unwrap_or_else(|| "Not callable".into()), + callable_by_precompile: C::callable_by_precompile_summary() + .unwrap_or_else(|| "Not callable".into()), + }] + } +} + +impl IsActivePrecompile for PrecompileSetStartingWith +where + Self: PrecompileSetFragment, +{ + #[inline(always)] + fn is_active_precompile(&self, address: H160, gas: u64) -> IsPrecompileResult { + self.is_precompile(address, gas) + } } /// Make a precompile that always revert. @@ -403,7 +768,10 @@ where } #[inline(always)] - fn execute(&self, handle: &mut impl PrecompileHandle) -> Option { + fn execute( + &self, + handle: &mut impl PrecompileHandle, + ) -> Option { if A::get() == handle.code_address() { Some(Err(revert("revert"))) } else { @@ -412,14 +780,97 @@ where } #[inline(always)] - fn is_precompile(&self, address: H160) -> bool { - address == A::get() + fn is_precompile(&self, address: H160, _gas: u64) -> IsPrecompileResult { + IsPrecompileResult::Answer { + is_precompile: address == A::get(), + extra_cost: 0, + } + } + + #[inline(always)] + fn used_addresses(&self) -> Vec { + vec![A::get()] + } + + fn summarize_checks(&self) -> Vec { + vec![PrecompileCheckSummary { + name: None, + precompile_kind: PrecompileKind::Single(A::get()), + recursion_limit: Some(0), + accept_delegate_call: true, + callable_by_smart_contract: "Reverts in all cases".into(), + callable_by_precompile: "Reverts in all cases".into(), + }] + } +} + +impl IsActivePrecompile for RevertPrecompile { + #[inline(always)] + fn is_active_precompile(&self, _address: H160, _gas: u64) -> IsPrecompileResult { + IsPrecompileResult::Answer { + is_precompile: true, + extra_cost: 0, + } + } +} + +/// A precompile that was removed from a precompile set. +/// Still considered a precompile but is inactive and always revert. +pub struct RemovedPrecompileAt(PhantomData); +impl PrecompileSetFragment for RemovedPrecompileAt +where + A: Get, +{ + #[inline(always)] + fn new() -> Self { + Self(PhantomData) + } + + #[inline(always)] + fn execute( + &self, + handle: &mut impl PrecompileHandle, + ) -> Option { + if A::get() == handle.code_address() { + Some(Err(revert("Removed precompile"))) + } else { + None + } + } + + #[inline(always)] + fn is_precompile(&self, address: H160, _gas: u64) -> IsPrecompileResult { + IsPrecompileResult::Answer { + is_precompile: address == A::get(), + extra_cost: 0, + } } #[inline(always)] fn used_addresses(&self) -> Vec { vec![A::get()] } + + fn summarize_checks(&self) -> Vec { + vec![PrecompileCheckSummary { + name: None, + precompile_kind: PrecompileKind::Single(A::get()), + recursion_limit: Some(0), + accept_delegate_call: true, + callable_by_smart_contract: "Reverts in all cases".into(), + callable_by_precompile: "Reverts in all cases".into(), + }] + } +} + +impl IsActivePrecompile for RemovedPrecompileAt { + #[inline(always)] + fn is_active_precompile(&self, _address: H160, _gas: u64) -> IsPrecompileResult { + IsPrecompileResult::Answer { + is_precompile: false, + extra_cost: 0, + } + } } // COMPOSITION OF PARTS @@ -433,9 +884,12 @@ impl PrecompileSetFragment for Tuple { } #[inline(always)] - fn execute(&self, handle: &mut impl PrecompileHandle) -> Option { + fn execute( + &self, + handle: &mut impl PrecompileHandle, + ) -> Option { for_tuples!(#( - if let Some(res) = self.Tuple.execute(handle) { + if let Some(res) = self.Tuple.execute::(handle) { return Some(res); } )*); @@ -444,14 +898,23 @@ impl PrecompileSetFragment for Tuple { } #[inline(always)] - fn is_precompile(&self, address: H160) -> bool { + fn is_precompile(&self, address: H160, gas: u64) -> IsPrecompileResult { for_tuples!(#( - if self.Tuple.is_precompile(address) { - return true; - } + match self.Tuple.is_precompile(address, gas) { + IsPrecompileResult::Answer { + is_precompile: true, + .. + } => return IsPrecompileResult::Answer { + is_precompile: true, + extra_cost: 0, + }, + _ => {} + }; )*); - - false + IsPrecompileResult::Answer { + is_precompile: false, + extra_cost: 0, + } } #[inline(always)] @@ -465,6 +928,40 @@ impl PrecompileSetFragment for Tuple { used_addresses } + + fn summarize_checks(&self) -> Vec { + let mut checks = Vec::new(); + + for_tuples!(#( + let mut inner = self.Tuple.summarize_checks(); + checks.append(&mut inner); + )*); + + checks + } +} + +#[impl_for_tuples(1, 100)] +impl IsActivePrecompile for Tuple { + #[inline(always)] + fn is_active_precompile(&self, address: H160, gas: u64) -> IsPrecompileResult { + for_tuples!(#( + match self.Tuple.is_active_precompile(address, gas) { + IsPrecompileResult::Answer { + is_precompile: true, + .. + } => return IsPrecompileResult::Answer { + is_precompile: true, + extra_cost: 0, + }, + _ => {} + }; + )*); + IsPrecompileResult::Answer { + is_precompile: false, + extra_cost: 0, + } + } } /// Wraps a precompileset fragment into a range, and will skip processing it if the address @@ -489,27 +986,50 @@ where } } - fn execute(&self, handle: &mut impl PrecompileHandle) -> Option { + fn execute( + &self, + handle: &mut impl PrecompileHandle, + ) -> Option { if self.range.contains(&handle.code_address()) { - self.inner.execute(handle) + self.inner.execute::(handle) } else { None } } - fn is_precompile(&self, address: H160) -> bool { + fn is_precompile(&self, address: H160, gas: u64) -> IsPrecompileResult { if self.range.contains(&address) { - self.inner.is_precompile(address) + self.inner.is_precompile(address, gas) } else { - false + IsPrecompileResult::Answer { + is_precompile: false, + extra_cost: 0, + } } } fn used_addresses(&self) -> Vec { - let start = self.range.start().to_low_u64_be(); - let end = self.range.end().to_low_u64_be(); + self.inner.used_addresses() + } - { start..=end }.map(H160::from_low_u64_be).collect() + fn summarize_checks(&self) -> Vec { + self.inner.summarize_checks() + } +} + +impl IsActivePrecompile for PrecompilesInRangeInclusive<(S, E), P> +where + P: IsActivePrecompile, +{ + fn is_active_precompile(&self, address: H160, gas: u64) -> IsPrecompileResult { + if self.range.contains(&address) { + self.inner.is_active_precompile(address, gas) + } else { + IsPrecompileResult::Answer { + is_precompile: false, + extra_cost: 0, + } + } } } @@ -519,13 +1039,19 @@ pub struct PrecompileSetBuilder { _phantom: PhantomData, } -impl PrecompileSet for PrecompileSetBuilder { +impl PrecompileSet for PrecompileSetBuilder { fn execute(&self, handle: &mut impl PrecompileHandle) -> Option { - self.inner.execute(handle) + self.inner.execute::(handle) } - fn is_precompile(&self, address: H160) -> bool { - self.inner.is_precompile(address) + fn is_precompile(&self, address: H160, gas: u64) -> IsPrecompileResult { + self.inner.is_precompile(address, gas) + } +} + +impl IsActivePrecompile for PrecompileSetBuilder { + fn is_active_precompile(&self, address: H160, gas: u64) -> IsPrecompileResult { + self.inner.is_active_precompile(address, gas) } } @@ -539,7 +1065,15 @@ impl PrecompileSetBuilder } /// Return the list of addresses contained in this PrecompileSet. - pub fn used_addresses() -> impl Iterator { - Self::new().inner.used_addresses().into_iter() + pub fn used_addresses() -> impl Iterator { + Self::new() + .inner + .used_addresses() + .into_iter() + .map(|x| R::AddressMapping::into_account_id(x)) + } + + pub fn summarize_checks(&self) -> Vec { + self.inner.summarize_checks() } } diff --git a/precompiles/utils/src/data/bytes.rs b/precompiles/utils/src/solidity/codec/bytes.rs similarity index 86% rename from precompiles/utils/src/data/bytes.rs rename to precompiles/utils/src/solidity/codec/bytes.rs index 802dd410..c3c72b8f 100644 --- a/precompiles/utils/src/data/bytes.rs +++ b/precompiles/utils/src/solidity/codec/bytes.rs @@ -1,19 +1,22 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use super::*; +use alloc::borrow::ToOwned; +use sp_core::{ConstU32, Get}; type ConstU32Max = ConstU32<{ u32::MAX }>; @@ -24,14 +27,14 @@ pub type UnboundedString = BoundedBytesString; pub type BoundedString = BoundedBytesString; trait Kind { - fn solidity_type() -> String; + fn signature() -> String; } #[derive(Clone, Debug, Eq, PartialEq)] pub struct BytesKind; impl Kind for BytesKind { - fn solidity_type() -> String { + fn signature() -> String { String::from("bytes") } } @@ -40,7 +43,7 @@ impl Kind for BytesKind { pub struct StringKind; impl Kind for StringKind { - fn solidity_type() -> String { + fn signature() -> String { String::from("string") } } @@ -81,8 +84,8 @@ impl> BoundedBytesString { } } -impl> EvmData for BoundedBytesString { - fn read(reader: &mut EvmDataReader) -> MayRevert { +impl> Codec for BoundedBytesString { + fn read(reader: &mut Reader) -> MayRevert { let mut inner_reader = reader.read_pointer()?; // Read bytes/string size. @@ -102,7 +105,7 @@ impl> EvmData for BoundedBytesString { let data = inner_reader .input .get(range) - .ok_or_else(|| RevertReason::read_out_of_bounds(K::solidity_type()))?; + .ok_or_else(|| RevertReason::read_out_of_bounds(K::signature()))?; let bytes = Self { data: data.to_owned(), @@ -112,7 +115,7 @@ impl> EvmData for BoundedBytesString { Ok(bytes) } - fn write(writer: &mut EvmDataWriter, value: Self) { + fn write(writer: &mut Writer, value: Self) { let value: Vec<_> = value.into(); let length = value.len(); @@ -129,7 +132,7 @@ impl> EvmData for BoundedBytesString { value.resize(padded_size, 0); writer.write_pointer( - EvmDataWriter::new() + Writer::new() .write(U256::from(length)) .write_raw_bytes(&value) .build(), @@ -140,8 +143,8 @@ impl> EvmData for BoundedBytesString { false } - fn solidity_type() -> String { - K::solidity_type() + fn signature() -> String { + K::signature() } } diff --git a/precompiles/utils/src/data/mod.rs b/precompiles/utils/src/solidity/codec/mod.rs similarity index 53% rename from precompiles/utils/src/data/mod.rs rename to precompiles/utils/src/solidity/codec/mod.rs index 69464b09..ea27fb63 100644 --- a/precompiles/utils/src/data/mod.rs +++ b/precompiles/utils/src/solidity/codec/mod.rs @@ -1,96 +1,128 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2023 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + +//! Solidity encoding following the +//! [Contract ABI Specification](https://docs.soliditylang.org/en/v0.8.19/abi-spec.html#abi) + pub mod bytes; pub mod native; + +#[cfg(any(feature = "codec-xcm", test))] pub mod xcm; -pub use affix::paste; +use crate::solidity::revert::{MayRevert, RevertReason}; +use core::{marker::PhantomData, ops::Range}; +use sp_core::{H256, U256}; +use sp_std::{convert::TryInto, vec, vec::Vec}; + pub use alloc::string::String; -pub use bytes::*; -pub use native::*; - -use { - crate::revert::{InjectBacktrace, MayRevert, RevertReason}, - alloc::borrow::ToOwned, - core::{any::type_name, marker::PhantomData, ops::Range}, - frame_support::traits::{ConstU32, Get}, - impl_trait_for_tuples::impl_for_tuples, - sp_core::{H160, H256, U256}, - sp_std::{convert::TryInto, vec, vec::Vec}, -}; - -/// Data that can be converted from and to EVM data types. -pub trait EvmData: Sized { - fn read(reader: &mut EvmDataReader) -> MayRevert; - fn write(writer: &mut EvmDataWriter, value: Self); +pub use bytes::{BoundedBytes, BoundedString, UnboundedBytes, UnboundedString}; +pub use native::{Address, BoundedVec}; + +// derive macro +pub use precompile_utils_macro::Codec; + +/// Data that can be encoded/encoded followiong the Solidity ABI Specification. +pub trait Codec: Sized { + fn read(reader: &mut Reader) -> MayRevert; + fn write(writer: &mut Writer, value: Self); fn has_static_size() -> bool; - fn solidity_type() -> String; + fn signature() -> String; + fn is_explicit_tuple() -> bool { + false + } } -/// Wrapper around an EVM input slice, helping to parse it. -/// Provide functions to parse common types. -#[derive(Clone, Copy, Debug)] -pub struct EvmDataReader<'a> { - input: &'a [u8], - cursor: usize, +/// Encode the value into its Solidity ABI format. +/// If `T` is a tuple it is encoded as a Solidity tuple with dynamic-size offset. +fn encode(value: T) -> Vec { + Writer::new().write(value).build() } -impl<'a> EvmDataReader<'a> { - /// Create a new input parser. - pub fn new(input: &'a [u8]) -> Self { - Self { input, cursor: 0 } +/// Encode the value into its Solidity ABI format. +/// If `T` is a tuple every element is encoded without a prefixed offset. +/// It matches the encoding of Solidity function arguments and return value, or event data. +pub fn encode_arguments(value: T) -> Vec { + let output = encode(value); + if T::is_explicit_tuple() && !T::has_static_size() { + output[32..].to_vec() + } else { + output } +} - /// Create a new input parser from a selector-initial input. - pub fn read_selector(input: &'a [u8]) -> MayRevert - where - T: num_enum::TryFromPrimitive, - { - if input.len() < 4 { - return Err(RevertReason::read_out_of_bounds("selector").into()); - } +pub use self::encode_arguments as encode_return_value; +pub use self::encode_arguments as encode_event_data; - let mut buffer = [0u8; 4]; - buffer.copy_from_slice(&input[0..4]); - let selector = T::try_from_primitive(u32::from_be_bytes(buffer)).map_err(|_| { - log::trace!( - target: "precompile-utils", - "Failed to match function selector for {}", - type_name::() - ); - RevertReason::UnknownSelector - })?; - - Ok(selector) +/// Encode the value as the arguments of a Solidity function with given selector. +/// If `T` is a tuple each member represents an argument of the function. +pub fn encode_with_selector(selector: u32, value: T) -> Vec { + Writer::new_with_selector(selector) + .write_raw_bytes(&encode_arguments(value)) + .build() +} + +/// Decode the value from its Solidity ABI format. +/// If `T` is a tuple it is decoded as a Solidity tuple with dynamic-size offset. +fn decode(input: &[u8]) -> MayRevert { + Reader::new(input).read() +} + +/// Decode the value from its Solidity ABI format. +/// If `T` is a tuple every element is decoded without a prefixed offset. +/// It matches the encoding of Solidity function arguments and return value, or event data. +pub fn decode_arguments(input: &[u8]) -> MayRevert { + if T::is_explicit_tuple() && !T::has_static_size() { + let writer = Writer::new(); + let mut writer = writer.write(U256::from(32)); + writer.write_pointer(input.to_vec()); + let input = writer.build(); + decode(&input) + } else { + decode(&input) } +} - /// Read selector as u32 - pub fn read_u32_selector(input: &'a [u8]) -> MayRevert { - if input.len() < 4 { - return Err(RevertReason::read_out_of_bounds("selector").into()); - } +pub use self::decode_arguments as decode_return_value; +pub use self::decode_arguments as decode_event_data; +/// Extracts the selector from the start of the input, or returns `None` if the input is too short. +pub fn selector(input: &[u8]) -> Option { + input.get(0..4).map(|s| { let mut buffer = [0u8; 4]; - buffer.copy_from_slice(&input[0..4]); + buffer.copy_from_slice(s); + u32::from_be_bytes(buffer) + }) +} + +/// Wrapper around an EVM input slice. +#[derive(Clone, Copy, Debug)] +pub struct Reader<'inner> { + input: &'inner [u8], + cursor: usize, +} - Ok(u32::from_be_bytes(buffer)) +impl<'inner> Reader<'inner> { + /// Create a Reader. + pub fn new(input: &'inner [u8]) -> Self { + Self { input, cursor: 0 } } - /// Create a new input parser from a selector-initial input. - pub fn new_skip_selector(input: &'a [u8]) -> MayRevert { + /// Create a Reader while skipping an initial selector. + pub fn new_skip_selector(input: &'inner [u8]) -> MayRevert { if input.len() < 4 { return Err(RevertReason::read_out_of_bounds("selector").into()); } @@ -99,7 +131,7 @@ impl<'a> EvmDataReader<'a> { } /// Check the input has at least the correct amount of arguments before the end (32 bytes values). - pub fn expect_arguments(&self, args: usize) -> MayRevert<()> { + pub fn expect_arguments(&self, args: usize) -> MayRevert { if self.input.len() >= self.cursor + args * 32 { Ok(()) } else { @@ -108,7 +140,7 @@ impl<'a> EvmDataReader<'a> { } /// Read data from the input. - pub fn read(&mut self) -> MayRevert { + pub fn read(&mut self) -> MayRevert { T::read(self) } @@ -175,18 +207,18 @@ impl<'a> EvmDataReader<'a> { /// Help build an EVM input/output data. /// /// Functions takes `self` to allow chaining all calls like -/// `EvmDataWriter::new().write(...).write(...).build()`. +/// `Writer::new().write(...).write(...).build()`. /// While it could be more ergonomic to take &mut self, this would /// prevent to have a `build` function that don't clone the output. #[derive(Clone, Debug)] -pub struct EvmDataWriter { +pub struct Writer { pub(crate) data: Vec, - offset_data: Vec, + offset_data: Vec, selector: Option, } #[derive(Clone, Debug)] -struct OffsetDatum { +struct OffsetChunk { // Offset location in the container data. offset_position: usize, // Data pointed by the offset that must be inserted at the end of container data. @@ -196,7 +228,7 @@ struct OffsetDatum { offset_shift: usize, } -impl EvmDataWriter { +impl Writer { /// Creates a new empty output builder (without selector). pub fn new() -> Self { Self { @@ -217,7 +249,7 @@ impl EvmDataWriter { } } - /// Return the built data. + // Return the built data. pub fn build(mut self) -> Vec { Self::bake_offsets(&mut self.data, self.offset_data); @@ -231,9 +263,9 @@ impl EvmDataWriter { } /// Add offseted data at the end of this writer's data, updating the offsets. - fn bake_offsets(output: &mut Vec, offsets: Vec) { - for mut offset_datum in offsets { - let offset_position = offset_datum.offset_position; + fn bake_offsets(output: &mut Vec, offsets: Vec) { + for mut offset_chunk in offsets { + let offset_position = offset_chunk.offset_position; let offset_position_end = offset_position + 32; // The offset is the distance between the start of the data and the @@ -241,14 +273,14 @@ impl EvmDataWriter { // Offsets in inner data are relative to the start of their respective "container". // However in arrays the "container" is actually the item itself instead of the whole // array, which is corrected by `offset_shift`. - let free_space_offset = output.len() - offset_datum.offset_shift; + let free_space_offset = output.len() - offset_chunk.offset_shift; // Override dummy offset to the offset it will be in the final output. U256::from(free_space_offset) .to_big_endian(&mut output[offset_position..offset_position_end]); // Append this data at the end of the current output. - output.append(&mut offset_datum.data); + output.append(&mut offset_chunk.data); } } @@ -260,7 +292,7 @@ impl EvmDataWriter { } /// Write data of requested type. - pub fn write(mut self, value: T) -> Self { + pub fn write(mut self, value: T) -> Self { T::write(&mut self, value); self } @@ -270,12 +302,12 @@ impl EvmDataWriter { /// Initially write a dummy value as offset in this writer's data, which will be replaced by /// the correct offset once the pointed data is appended. /// - /// Takes `&mut self` since its goal is to be used inside `EvmData` impl and not in chains. + /// Takes `&mut self` since its goal is to be used inside `solidity::Codec` impl and not in chains. pub fn write_pointer(&mut self, data: Vec) { let offset_position = self.data.len(); H256::write(self, H256::repeat_byte(0xff)); - self.offset_data.push(OffsetDatum { + self.offset_data.push(OffsetChunk { offset_position, data, offset_shift: 0, @@ -283,22 +315,16 @@ impl EvmDataWriter { } } -impl Default for EvmDataWriter { - fn default() -> Self { - Self::new() - } -} - /// Adapter to parse data as a first type then convert it to another one. /// Useful for old precompiles in which Solidity arguments where set larger than /// the needed Rust type. #[derive(Clone, Copy, Debug)] -pub struct SolidityConvert { +pub struct Convert { inner: C, _phantom: PhantomData

, } -impl From for SolidityConvert { +impl From for Convert { fn from(value: C) -> Self { Self { inner: value, @@ -307,21 +333,21 @@ impl From for SolidityConvert { } } -impl SolidityConvert { +impl Convert { pub fn converted(self) -> C { self.inner } } -impl EvmData for SolidityConvert +impl Codec for Convert where - P: EvmData + TryInto, - C: EvmData + Into

, + P: Codec + TryInto, + C: Codec + Into

, { - fn read(reader: &mut EvmDataReader) -> MayRevert { + fn read(reader: &mut Reader) -> MayRevert { let c = P::read(reader)? .try_into() - .map_err(|_| RevertReason::value_is_too_large(C::solidity_type()))?; + .map_err(|_| RevertReason::value_is_too_large(C::signature()))?; Ok(Self { inner: c, @@ -329,7 +355,7 @@ where }) } - fn write(writer: &mut EvmDataWriter, value: Self) { + fn write(writer: &mut Writer, value: Self) { P::write(writer, value.inner.into()) } @@ -337,69 +363,7 @@ where P::has_static_size() } - fn solidity_type() -> String { - P::solidity_type() + fn signature() -> String { + P::signature() } } - -/// Helper to write `EvmData` impl for Solidity structs. -/// Identifiers used should match Solidity ones. -/// Types are infered from context, which should always be -/// possible when parsing input to build a Rust struct. -/// -/// ```rust,ignore -/// impl EvmData for Currency { -/// fn read(reader: &mut EvmDataReader) -> MayRevert { -/// read_struct!(reader, (address, amount)); -/// Ok(Currency { address, amount }) -/// } -/// -/// fn write(writer: &mut EvmDataWriter, value: Self) { -/// EvmData::write(writer, (value.address, value.amount)); -/// } -/// -/// fn has_static_size() -> bool { -/// <(Address, U256)>::has_static_size() -/// } -/// } -/// ``` -#[macro_export] -macro_rules! read_struct { - ($reader:ident, {$($field:ident: $type:ty),+}) => { - use $crate::revert::BacktraceExt as _; - let ($($field),*): ($($type),*) = $reader - .read() - .map_in_tuple_to_field(&[$(stringify!($field)),*])?; - }; -} - -/// Helper to read arguments of a Solidity function. -/// Arguments are read in the provided order using the provided types. -/// Those types should match the ones in the Solidity file, -/// and identifiers used should match Solidity ones. -/// -/// Identifiers written in Rust in snake_case are converted to -/// camelCase to match Solidity conventions. -/// -/// ```rust,ignore -/// // Reading Solidity function `f(address ownner, uint256 accountIndex)`. -/// read_args!(handle, {owner: Address, account_index: U256}); -/// let owner: H160 = owner.into(); -/// -/// ``` -#[macro_export] -macro_rules! read_args { - (@count) => (0usize); - (@count $x:ident $($xs:ident)* ) => (1usize + read_args!(@count $($xs)*)); - ($handle:ident, {$($field:ident: $type:ty),*}) => { - $crate::data::paste! { - let mut input = $handle.read_after_selector()?; - input.expect_arguments(read_args!(@count $($field)*))?; - $( - let $field: $type = input.read().in_field( - stringify!([<$field:camel>]) - )?; - )* - } - }; -} diff --git a/precompiles/utils/src/data/native.rs b/precompiles/utils/src/solidity/codec/native.rs similarity index 72% rename from precompiles/utils/src/data/native.rs rename to precompiles/utils/src/solidity/codec/native.rs index bff79614..1ad1d1eb 100644 --- a/precompiles/utils/src/data/native.rs +++ b/precompiles/utils/src/solidity/codec/native.rs @@ -1,45 +1,48 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use super::*; +use crate::solidity::revert::InjectBacktrace; +use impl_trait_for_tuples::impl_for_tuples; +use sp_core::{ConstU32, Get, H160}; -impl EvmData for () { - fn read(_reader: &mut EvmDataReader) -> MayRevert { +impl Codec for () { + fn read(_reader: &mut Reader) -> MayRevert { Ok(()) } - fn write(_writer: &mut EvmDataWriter, _value: Self) {} + fn write(_writer: &mut Writer, _value: Self) {} fn has_static_size() -> bool { true } - fn solidity_type() -> String { + fn signature() -> String { String::from("()") } } #[impl_for_tuples(1, 18)] -impl EvmData for Tuple { +impl Codec for Tuple { fn has_static_size() -> bool { for_tuples!(#( Tuple::has_static_size() )&*) } - fn read(reader: &mut EvmDataReader) -> MayRevert { - if !Self::has_static_size() { - let reader = &mut reader.read_pointer()?; + fn read(reader: &mut Reader) -> MayRevert { + if Self::has_static_size() { let mut index = 0; Ok(for_tuples!( ( #( { let elem = reader.read::().in_tuple(index)?; @@ -47,6 +50,7 @@ impl EvmData for Tuple { elem } ),* ) )) } else { + let reader = &mut reader.read_pointer()?; let mut index = 0; Ok(for_tuples!( ( #( { let elem = reader.read::().in_tuple(index)?; @@ -56,25 +60,29 @@ impl EvmData for Tuple { } } - fn write(writer: &mut EvmDataWriter, value: Self) { - if !Self::has_static_size() { - let mut inner_writer = EvmDataWriter::new(); + fn write(writer: &mut Writer, value: Self) { + if Self::has_static_size() { + for_tuples!( #( Tuple::write(writer, value.Tuple); )* ); + } else { + let mut inner_writer = Writer::new(); for_tuples!( #( Tuple::write(&mut inner_writer, value.Tuple); )* ); writer.write_pointer(inner_writer.build()); - } else { - for_tuples!( #( Tuple::write(writer, value.Tuple); )* ); } } - fn solidity_type() -> String { + fn signature() -> String { let mut subtypes = Vec::new(); - for_tuples!( #( subtypes.push(Tuple::solidity_type()); )* ); + for_tuples!( #( subtypes.push(Tuple::signature()); )* ); alloc::format!("({})", subtypes.join(",")) } + + fn is_explicit_tuple() -> bool { + true + } } -impl EvmData for H256 { - fn read(reader: &mut EvmDataReader) -> MayRevert { +impl Codec for H256 { + fn read(reader: &mut Reader) -> MayRevert { let range = reader.move_cursor(32)?; let data = reader @@ -85,7 +93,7 @@ impl EvmData for H256 { Ok(H256::from_slice(data)) } - fn write(writer: &mut EvmDataWriter, value: Self) { + fn write(writer: &mut Writer, value: Self) { writer.data.extend_from_slice(value.as_bytes()); } @@ -93,7 +101,7 @@ impl EvmData for H256 { true } - fn solidity_type() -> String { + fn signature() -> String { String::from("bytes32") } } @@ -101,7 +109,7 @@ impl EvmData for H256 { /// The `address` type of Solidity. /// H160 could represent 2 types of data (bytes20 and address) that are not encoded the same way. /// To avoid issues writing H160 is thus not supported. -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] pub struct Address(pub H160); impl From for Address { @@ -127,8 +135,8 @@ impl Address { } } -impl EvmData for Address { - fn read(reader: &mut EvmDataReader) -> MayRevert { +impl Codec for Address { + fn read(reader: &mut Reader) -> MayRevert { let range = reader.move_cursor(32)?; let data = reader @@ -139,7 +147,7 @@ impl EvmData for Address { Ok(H160::from_slice(&data[12..32]).into()) } - fn write(writer: &mut EvmDataWriter, value: Self) { + fn write(writer: &mut Writer, value: Self) { H256::write(writer, value.0.into()); } @@ -147,13 +155,13 @@ impl EvmData for Address { true } - fn solidity_type() -> String { + fn signature() -> String { String::from("address") } } -impl EvmData for U256 { - fn read(reader: &mut EvmDataReader) -> MayRevert { +impl Codec for U256 { + fn read(reader: &mut Reader) -> MayRevert { let range = reader.move_cursor(32)?; let data = reader @@ -164,7 +172,7 @@ impl EvmData for U256 { Ok(U256::from_big_endian(data)) } - fn write(writer: &mut EvmDataWriter, value: Self) { + fn write(writer: &mut Writer, value: Self) { let mut buffer = [0u8; 32]; value.to_big_endian(&mut buffer); writer.data.extend_from_slice(&buffer); @@ -174,7 +182,7 @@ impl EvmData for U256 { true } - fn solidity_type() -> String { + fn signature() -> String { String::from("uint256") } } @@ -182,21 +190,21 @@ impl EvmData for U256 { macro_rules! impl_evmdata_for_uints { ($($uint:ty, )*) => { $( - impl EvmData for $uint { - fn read(reader: &mut EvmDataReader) -> MayRevert { + impl Codec for $uint { + fn read(reader: &mut Reader) -> MayRevert { let value256: U256 = reader.read() .map_err(|_| RevertReason::read_out_of_bounds( - Self::solidity_type() + Self::signature() ))?; value256 .try_into() .map_err(|_| RevertReason::value_is_too_large( - Self::solidity_type() + Self::signature() ).into()) } - fn write(writer: &mut EvmDataWriter, value: Self) { + fn write(writer: &mut Writer, value: Self) { U256::write(writer, value.into()); } @@ -204,7 +212,7 @@ macro_rules! impl_evmdata_for_uints { true } - fn solidity_type() -> String { + fn signature() -> String { alloc::format!("uint{}", core::mem::size_of::() * 8) } } @@ -214,14 +222,14 @@ macro_rules! impl_evmdata_for_uints { impl_evmdata_for_uints!(u8, u16, u32, u64, u128,); -impl EvmData for bool { - fn read(reader: &mut EvmDataReader) -> MayRevert { +impl Codec for bool { + fn read(reader: &mut Reader) -> MayRevert { let h256 = H256::read(reader).map_err(|_| RevertReason::read_out_of_bounds("bool"))?; Ok(!h256.is_zero()) } - fn write(writer: &mut EvmDataWriter, value: Self) { + fn write(writer: &mut Writer, value: Self) { let mut buffer = [0u8; 32]; if value { buffer[31] = 1; @@ -234,19 +242,19 @@ impl EvmData for bool { true } - fn solidity_type() -> String { + fn signature() -> String { String::from("bool") } } type ConstU32Max = ConstU32<{ u32::MAX }>; -impl EvmData for Vec { - fn read(reader: &mut EvmDataReader) -> MayRevert { +impl Codec for Vec { + fn read(reader: &mut Reader) -> MayRevert { BoundedVec::::read(reader).map(|x| x.into()) } - fn write(writer: &mut EvmDataWriter, value: Self) { + fn write(writer: &mut Writer, value: Self) { BoundedVec::::write( writer, BoundedVec { @@ -260,8 +268,8 @@ impl EvmData for Vec { false } - fn solidity_type() -> String { - alloc::format!("{}[]", T::solidity_type()) + fn signature() -> String { + alloc::format!("{}[]", T::signature()) } } @@ -272,8 +280,8 @@ pub struct BoundedVec { _phantom: PhantomData, } -impl> EvmData for BoundedVec { - fn read(reader: &mut EvmDataReader) -> MayRevert { +impl> Codec for BoundedVec { + fn read(reader: &mut Reader) -> MayRevert { let mut inner_reader = reader.read_pointer()?; let array_size: usize = inner_reader @@ -288,7 +296,7 @@ impl> EvmData for BoundedVec { let mut array = vec![]; - let mut item_reader = EvmDataReader { + let mut item_reader = Reader { input: inner_reader .input .get(32..) @@ -306,9 +314,9 @@ impl> EvmData for BoundedVec { }) } - fn write(writer: &mut EvmDataWriter, value: Self) { + fn write(writer: &mut Writer, value: Self) { let value: Vec<_> = value.into(); - let mut inner_writer = EvmDataWriter::new().write(U256::from(value.len())); + let mut inner_writer = Writer::new().write(U256::from(value.len())); for inner in value { // Any offset in items are relative to the start of the item instead of the @@ -316,7 +324,7 @@ impl> EvmData for BoundedVec { // all items (offsets) are written. We thus need to rely on `compute_offsets` to do // that, and must store a "shift" to correct the offsets. let shift = inner_writer.data.len(); - let item_writer = EvmDataWriter::new().write(inner); + let item_writer = Writer::new().write(inner); inner_writer = inner_writer.write_raw_bytes(&item_writer.data); for mut offset_datum in item_writer.offset_data { @@ -333,8 +341,8 @@ impl> EvmData for BoundedVec { false } - fn solidity_type() -> String { - alloc::format!("{}[]", T::solidity_type()) + fn signature() -> String { + alloc::format!("{}[]", T::signature()) } } diff --git a/precompiles/utils/src/data/xcm.rs b/precompiles/utils/src/solidity/codec/xcm.rs similarity index 86% rename from precompiles/utils/src/data/xcm.rs rename to precompiles/utils/src/solidity/codec/xcm.rs index 1edc04a5..e1c7a058 100644 --- a/precompiles/utils/src/data/xcm.rs +++ b/precompiles/utils/src/solidity/codec/xcm.rs @@ -17,12 +17,13 @@ //! Encoding of XCM types for solidity use { - crate::{ - data::{BoundedBytes, EvmData, EvmDataReader, EvmDataWriter, UnboundedBytes}, - revert::{InjectBacktrace, MayRevert, RevertReason}, + crate::solidity::{ + codec::{bytes::*, Codec, Reader, Writer}, + revert::{BacktraceExt, InjectBacktrace, MayRevert, RevertReason}, }, alloc::string::String, frame_support::{ensure, traits::ConstU32}, + sp_core::H256, sp_std::vec::Vec, xcm::latest::{Junction, Junctions, MultiLocation, NetworkId}, }; @@ -30,7 +31,7 @@ use { pub const JUNCTION_SIZE_LIMIT: u32 = 2u32.pow(16); // Function to convert network id to bytes -// We don't implement EVMData here as these bytes will be appended only +// We don't implement solidity::Codec here as these bytes will be appended only // to certain Junction variants // Each NetworkId variant is represented as bytes // The first byte represents the enum variant to be used. @@ -113,7 +114,7 @@ pub(crate) fn network_id_from_bytes(encoded_bytes: Vec) -> MayRevert 0, RevertReason::custom("Junctions cannot be empty") ); - let mut encoded_network_id = EvmDataReader::new(&encoded_bytes); + let mut encoded_network_id = Reader::new(&encoded_bytes); let network_selector = encoded_network_id .read_raw_bytes(1) @@ -160,8 +161,8 @@ pub(crate) fn network_id_from_bytes(encoded_bytes: Vec) -> MayRevert MayRevert { +impl Codec for Junction { + fn read(reader: &mut Reader) -> MayRevert { let junction = reader.read::>>()?; let junction_bytes: Vec<_> = junction.into(); @@ -171,7 +172,7 @@ impl EvmData for Junction { ); // For simplicity we use an EvmReader here - let mut encoded_junction = EvmDataReader::new(&junction_bytes); + let mut encoded_junction = Reader::new(&junction_bytes); // We take the first byte let enum_selector = encoded_junction @@ -230,20 +231,13 @@ impl EvmData for Junction { Ok(Junction::GeneralIndex(u128::from_be_bytes(general_index))) } 6 => { - let mut length: [u8; 1] = Default::default(); - length.copy_from_slice( - encoded_junction - .read_raw_bytes(1) - .map_err(|_| RevertReason::read_out_of_bounds("General Key length"))?, - ); - - let mut data: [u8; 32] = Default::default(); - data.copy_from_slice(&encoded_junction.read_till_end()?); - - Ok(Junction::GeneralKey { - length: u8::from_be_bytes(length), - data, - }) + let length = encoded_junction + .read_raw_bytes(1) + .map_err(|_| RevertReason::read_out_of_bounds("General Key length"))?[0]; + + let data = encoded_junction.read::().in_field("data")?.into(); + + Ok(Junction::GeneralKey { length, data }) } 7 => Ok(Junction::OnlyChild), 8 => Err(RevertReason::custom("Junction::Plurality not supported yet").into()), @@ -259,7 +253,7 @@ impl EvmData for Junction { } } - fn write(writer: &mut EvmDataWriter, value: Self) { + fn write(writer: &mut Writer, value: Self) { let mut encoded: Vec = Vec::new(); let encoded_bytes: UnboundedBytes = match value { Junction::Parachain(para_id) => { @@ -314,20 +308,20 @@ impl EvmData for Junction { // type that we need to evaluate how to support _ => unreachable!("Junction::Plurality not supported yet"), }; - EvmData::write(writer, encoded_bytes); + Codec::write(writer, encoded_bytes); } fn has_static_size() -> bool { false } - fn solidity_type() -> String { - UnboundedBytes::solidity_type() + fn signature() -> String { + UnboundedBytes::signature() } } -impl EvmData for Junctions { - fn read(reader: &mut EvmDataReader) -> MayRevert { +impl Codec for Junctions { + fn read(reader: &mut Reader) -> MayRevert { let junctions_bytes: Vec = reader.read()?; let mut junctions = Junctions::Here; for item in junctions_bytes { @@ -339,39 +333,38 @@ impl EvmData for Junctions { Ok(junctions) } - fn write(writer: &mut EvmDataWriter, value: Self) { + fn write(writer: &mut Writer, value: Self) { let encoded: Vec = value.iter().map(|junction| junction.clone()).collect(); - EvmData::write(writer, encoded); + Codec::write(writer, encoded); } fn has_static_size() -> bool { false } - fn solidity_type() -> String { - Vec::::solidity_type() + fn signature() -> String { + Vec::::signature() } } // Cannot used derive macro since it is a foreign struct. -impl EvmData for MultiLocation { - fn read(reader: &mut EvmDataReader) -> MayRevert { - use crate::revert::BacktraceExt; +impl Codec for MultiLocation { + fn read(reader: &mut Reader) -> MayRevert { let (parents, interior) = reader .read() .map_in_tuple_to_field(&["parents", "interior"])?; Ok(MultiLocation { parents, interior }) } - fn write(writer: &mut EvmDataWriter, value: Self) { - EvmData::write(writer, (value.parents, value.interior)); + fn write(writer: &mut Writer, value: Self) { + Codec::write(writer, (value.parents, value.interior)); } fn has_static_size() -> bool { <(u8, Junctions)>::has_static_size() } - fn solidity_type() -> String { - <(u8, Junctions)>::solidity_type() + fn signature() -> String { + <(u8, Junctions)>::signature() } -} \ No newline at end of file +} diff --git a/precompiles/utils/src/solidity/mod.rs b/precompiles/utils/src/solidity/mod.rs new file mode 100644 index 00000000..13d6d656 --- /dev/null +++ b/precompiles/utils/src/solidity/mod.rs @@ -0,0 +1,26 @@ +// Copyright 2019-2023 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! Provides utilities for compatibility with Solidity tooling. + +pub mod codec; +pub mod modifier; +pub mod revert; + +pub use codec::{ + decode_arguments, decode_event_data, decode_return_value, encode_arguments, encode_event_data, + encode_return_value, encode_with_selector, Codec, +}; diff --git a/precompiles/utils/src/modifier.rs b/precompiles/utils/src/solidity/modifier.rs similarity index 81% rename from precompiles/utils/src/modifier.rs rename to precompiles/utils/src/solidity/modifier.rs index c0d19e26..80e4d33e 100644 --- a/precompiles/utils/src/modifier.rs +++ b/precompiles/utils/src/solidity/modifier.rs @@ -1,22 +1,23 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + //! Provide checks related to function modifiers (view/payable). use { - crate::revert::{MayRevert, RevertReason}, + crate::solidity::revert::{MayRevert, RevertReason}, fp_evm::Context, sp_core::U256, }; diff --git a/precompiles/utils/src/revert.rs b/precompiles/utils/src/solidity/revert.rs similarity index 89% rename from precompiles/utils/src/revert.rs rename to precompiles/utils/src/solidity/revert.rs index 704ea99c..0b7aa8f5 100644 --- a/precompiles/utils/src/revert.rs +++ b/precompiles/utils/src/solidity/revert.rs @@ -1,22 +1,23 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + //! Utilities to work with revert messages with support for backtraces and //! consistent formatting. -use crate::{data::UnboundedBytes, EvmDataWriter}; +use crate::solidity::{self, codec::bytes::UnboundedBytes}; use alloc::string::{String, ToString}; use fp_evm::{ExitRevert, PrecompileFailure}; use sp_std::vec::Vec; @@ -24,13 +25,21 @@ use sp_std::vec::Vec; /// Represent the result of a computation that can revert. pub type MayRevert = Result; +/// Generate an encoded revert from a simple String. +/// Returns a `PrecompileFailure` that fits in an `EvmResult::Err`. +pub fn revert(msg: impl Into) -> PrecompileFailure { + RevertReason::custom(msg).into() +} + +/// Generate an encoded revert from a simple String. +/// Returns a `Vec` in case `PrecompileFailure` is too high level. +pub fn revert_as_bytes(msg: impl Into) -> Vec { + Revert::new(RevertReason::custom(msg)).to_encoded_bytes() +} + /// Generic error to build abi-encoded revert output. /// See: https://docs.soliditylang.org/en/latest/control-structures.html?highlight=revert#revert -#[precompile_utils_macro::generate_function_selector] -#[derive(Debug, PartialEq)] -pub enum RevertSelector { - Generic = "Error(string)", -} +pub const ERROR_SELECTOR: u32 = 0x08c379a0; #[derive(Clone, PartialEq, Eq)] enum BacktracePart { @@ -165,7 +174,7 @@ impl Revert { /// For all `RevertReason` variants that have a `what` field, change its value. /// Otherwise do nothing. - /// It is useful when writing custom types `EvmData` implementations using + /// It is useful when writing custom types `solidity::Codec` implementations using /// simpler types. pub fn change_what(mut self, what: impl Into) -> Self { let what = what.into(); @@ -180,8 +189,9 @@ impl Revert { } /// Transforms the revert into its bytes representation (from a String). - pub fn to_bytes(self) -> Vec { - self.into() + pub fn to_encoded_bytes(self) -> Vec { + let bytes: Vec = self.into(); + solidity::encode_with_selector(ERROR_SELECTOR, UnboundedBytes::from(bytes)) } } @@ -360,9 +370,7 @@ impl From for PrecompileFailure { fn from(err: Revert) -> Self { PrecompileFailure::Revert { exit_status: ExitRevert::Reverted, - output: EvmDataWriter::new_with_selector(RevertSelector::Generic) - .write::(err.to_string().into()) - .build(), + output: err.to_encoded_bytes(), } } } diff --git a/precompiles/utils/src/substrate.rs b/precompiles/utils/src/substrate.rs index 41d254b5..c0b88bb7 100644 --- a/precompiles/utils/src/substrate.rs +++ b/precompiles/utils/src/substrate.rs @@ -1,24 +1,25 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + //! Utils related to Substrate features: //! - Substrate call dispatch. //! - Substrate DB read and write costs use { - crate::revert, + crate::{evm::handle::using_precompile_handle, solidity::revert::revert}, core::marker::PhantomData, fp_evm::{ExitError, PrecompileFailure, PrecompileHandle}, frame_support::{ @@ -29,6 +30,7 @@ use { pallet_evm::GasWeightMapping, }; +#[derive(Debug)] pub enum TryDispatchError { Evm(ExitError), Substrate(DispatchError), @@ -81,8 +83,7 @@ where // However while Substrate handle checking weight while not making the sender pay for it, // the EVM doesn't. It seems this safer to always record the costs to avoid unmetered // computations. - let post_dispatch_info = call - .dispatch(origin) + let post_dispatch_info = using_precompile_handle(handle, || call.dispatch(origin)) .map_err(|e| TryDispatchError::Substrate(e.error))?; let used_weight = post_dispatch_info.actual_weight; diff --git a/precompiles/utils/src/testing/account.rs b/precompiles/utils/src/testing/account.rs index f1b91dfd..a75886cb 100644 --- a/precompiles/utils/src/testing/account.rs +++ b/precompiles/utils/src/testing/account.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use { pallet_evm::AddressMapping, scale_info::TypeInfo, @@ -115,14 +116,14 @@ macro_rules! mock_account { } } - impl From<$name> for H160 { - fn from(value: $name) -> H160 { + impl From<$name> for sp_core::H160 { + fn from(value: $name) -> sp_core::H160 { MockAccount::from(value).into() } } - impl From<$name> for H256 { - fn from(value: $name) -> H256 { + impl From<$name> for sp_core::H256 { + fn from(value: $name) -> sp_core::H256 { MockAccount::from(value).into() } } diff --git a/precompiles/utils/src/testing/execution.rs b/precompiles/utils/src/testing/execution.rs index eaa58fd5..8e45aaa7 100644 --- a/precompiles/utils/src/testing/execution.rs +++ b/precompiles/utils/src/testing/execution.rs @@ -1,22 +1,23 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use { crate::{ + solidity::codec::Codec, testing::{decode_revert_message, MockHandle, PrettyLog, SubcallHandle, SubcallTrait}, - EvmData, EvmDataWriter, }, fp_evm::{ Context, ExitError, ExitSucceed, Log, PrecompileFailure, PrecompileOutput, @@ -152,7 +153,7 @@ impl<'p, P: PrecompileSet> PrecompilesTester<'p, P> { } /// Execute the precompile set and check it returns provided output. - pub fn execute_returns(mut self, output: Vec) { + pub fn execute_returns_raw(mut self, output: Vec) { let res = self.execute(); match res { @@ -191,8 +192,8 @@ impl<'p, P: PrecompileSet> PrecompilesTester<'p, P> { } /// Execute the precompile set and check it returns provided Solidity encoded output. - pub fn execute_returns_encoded(self, output: impl EvmData) { - self.execute_returns(EvmDataWriter::new().write(output).build()) + pub fn execute_returns(self, output: impl Codec) { + self.execute_returns_raw(crate::solidity::encode_return_value(output)) } /// Execute the precompile set and check if it reverts. diff --git a/precompiles/utils/src/testing/handle.rs b/precompiles/utils/src/testing/handle.rs index 490cee01..d97ce9d1 100644 --- a/precompiles/utils/src/testing/handle.rs +++ b/precompiles/utils/src/testing/handle.rs @@ -1,25 +1,28 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use { crate::testing::PrettyLog, + evm::{ExitRevert, ExitSucceed}, fp_evm::{Context, ExitError, ExitReason, Log, PrecompileHandle, Transfer}, sp_core::{H160, H256}, sp_std::boxed::Box, }; +#[derive(Debug, Clone)] pub struct Subcall { pub address: H160, pub transfer: Option, @@ -29,6 +32,7 @@ pub struct Subcall { pub context: Context, } +#[derive(Debug, Clone)] pub struct SubcallOutput { pub reason: ExitReason, pub output: Vec, @@ -36,6 +40,35 @@ pub struct SubcallOutput { pub logs: Vec, } +impl SubcallOutput { + pub fn revert() -> Self { + Self { + reason: ExitReason::Revert(ExitRevert::Reverted), + output: Vec::new(), + cost: 0, + logs: Vec::new(), + } + } + + pub fn succeed() -> Self { + Self { + reason: ExitReason::Succeed(ExitSucceed::Returned), + output: Vec::new(), + cost: 0, + logs: Vec::new(), + } + } + + pub fn out_of_gas() -> Self { + Self { + reason: ExitReason::Error(ExitError::OutOfGas), + output: Vec::new(), + cost: 0, + logs: Vec::new(), + } + } +} + pub trait SubcallTrait: FnMut(Subcall) -> SubcallOutput + 'static {} impl SubcallOutput + 'static> SubcallTrait for T {} @@ -82,7 +115,7 @@ impl PrecompileHandle for MockHandle { context: &Context, ) -> (ExitReason, Vec) { if self - .record_cost(crate::costs::call_cost( + .record_cost(crate::evm::costs::call_cost( context.apparent_value, &evm::Config::london(), )) diff --git a/precompiles/utils/src/testing/mod.rs b/precompiles/utils/src/testing/mod.rs index 02b0a1fa..89a10b64 100644 --- a/precompiles/utils/src/testing/mod.rs +++ b/precompiles/utils/src/testing/mod.rs @@ -1,25 +1,32 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + pub mod account; pub mod execution; pub mod handle; pub mod modifier; -pub mod solidity; +mod solidity; -pub use {account::*, execution::*, handle::*, modifier::*}; +pub use { + account::*, + execution::*, + handle::*, + modifier::*, + solidity::{check_precompile_implements_solidity_interfaces, compute_selector}, +}; use fp_evm::Log; diff --git a/precompiles/utils/src/testing/modifier.rs b/precompiles/utils/src/testing/modifier.rs index 59b0ce89..41e3c56f 100644 --- a/precompiles/utils/src/testing/modifier.rs +++ b/precompiles/utils/src/testing/modifier.rs @@ -1,22 +1,23 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use { crate::{ + solidity::codec::Writer, testing::{decode_revert_message, MockHandle}, - EvmDataWriter, }, fp_evm::{Context, PrecompileFailure, PrecompileSet}, sp_core::{H160, U256}, @@ -52,7 +53,7 @@ impl PrecompilesModifierTester

{ let handle = &mut self.handle; handle.is_static = true; handle.context.apparent_value = U256::zero(); - handle.input = EvmDataWriter::new_with_selector(selector).build(); + handle.input = Writer::new_with_selector(selector).build(); let res = self.precompiles.execute(handle); @@ -72,7 +73,7 @@ impl PrecompilesModifierTester

{ let handle = &mut self.handle; handle.is_static = false; handle.context.apparent_value = U256::one(); - handle.input = EvmDataWriter::new_with_selector(selector).build(); + handle.input = Writer::new_with_selector(selector).build(); let res = self.precompiles.execute(handle); diff --git a/precompiles/utils/src/testing/solidity.rs b/precompiles/utils/src/testing/solidity.rs index 3e802445..fb3e24dd 100644 --- a/precompiles/utils/src/testing/solidity.rs +++ b/precompiles/utils/src/testing/solidity.rs @@ -1,18 +1,19 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + //! Utility module to interact with solidity file. use sp_io::hashing::keccak_256; @@ -22,6 +23,34 @@ use std::{ io::{BufRead, BufReader, Read}, }; +pub fn check_precompile_implements_solidity_interfaces( + files: &[&'static str], + supports_selector: F, +) where + F: Fn(u32) -> bool, +{ + for file in files { + for solidity_fn in get_selectors(file) { + assert_eq!( + solidity_fn.compute_selector_hex(), + solidity_fn.docs_selector, + "documented selector for '{}' did not match in file '{}'", + solidity_fn.signature(), + file, + ); + + let selector = solidity_fn.compute_selector(); + if !supports_selector(selector) { + panic!( + "precompile don't support selector {selector:x} for function '{}' listed in file\ + {file}", + solidity_fn.signature(), + ) + } + } + } +} + /// Represents a declared custom type struct within a solidity file #[derive(Clone, Default, Debug)] pub struct SolidityStruct { diff --git a/precompiles/utils/src/tests.rs b/precompiles/utils/src/tests.rs index 5956d1da..8f073935 100644 --- a/precompiles/utils/src/tests.rs +++ b/precompiles/utils/src/tests.rs @@ -1,23 +1,30 @@ -// Copyright 2023 Stability Solutions. -// This file is part of Stability. +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. -// Stability is free software: you can redistribute it and/or modify +// Moonbeam is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Stability is distributed in the hope that it will be useful, +// Moonbeam is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Stability. If not, see . +// along with Moonbeam. If not, see . + use { crate::{ - data::xcm::{network_id_from_bytes, network_id_to_bytes}, prelude::*, - revert::Backtrace, + solidity::{ + codec::{ + xcm::{network_id_from_bytes, network_id_to_bytes}, + Reader, Writer, + }, + modifier::{check_function_modifier, FunctionModifier}, + revert::Backtrace, + }, }, frame_support::traits::ConstU32, hex_literal::hex, @@ -46,7 +53,7 @@ fn display_bytes(bytes: &[u8]) { fn write_bool() { let value = true; - let writer_output = EvmDataWriter::new().write(value).build(); + let writer_output = Writer::new().write(value).build(); let mut expected_output = [0u8; 32]; expected_output[31] = 1; @@ -58,9 +65,9 @@ fn write_bool() { fn read_bool() { let value = true; - let writer_output = EvmDataWriter::new().write(value).build(); + let writer_output = Writer::new().write(value).build(); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); let parsed: bool = reader.read().expect("to correctly parse bool"); assert_eq!(value, parsed); @@ -70,7 +77,7 @@ fn read_bool() { fn write_u64() { let value = 42u64; - let writer_output = EvmDataWriter::new().write(value).build(); + let writer_output = Writer::new().write(value).build(); let mut expected_output = [0u8; 32]; expected_output[24..].copy_from_slice(&value.to_be_bytes()); @@ -81,9 +88,9 @@ fn write_u64() { #[test] fn read_u64() { let value = 42u64; - let writer_output = EvmDataWriter::new().write(value).build(); + let writer_output = Writer::new().write(value).build(); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); let parsed: u64 = reader.read().expect("to correctly parse u64"); assert_eq!(value, parsed); @@ -93,7 +100,7 @@ fn read_u64() { fn write_u128() { let value = 42u128; - let writer_output = EvmDataWriter::new().write(value).build(); + let writer_output = Writer::new().write(value).build(); let mut expected_output = [0u8; 32]; expected_output[16..].copy_from_slice(&value.to_be_bytes()); @@ -104,9 +111,9 @@ fn write_u128() { #[test] fn read_u128() { let value = 42u128; - let writer_output = EvmDataWriter::new().write(value).build(); + let writer_output = Writer::new().write(value).build(); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); let parsed: u128 = reader.read().expect("to correctly parse u128"); assert_eq!(value, parsed); @@ -116,7 +123,7 @@ fn read_u128() { fn write_u256() { let value = U256::from(42); - let writer_output = EvmDataWriter::new().write(value).build(); + let writer_output = Writer::new().write(value).build(); let mut expected_output = [0u8; 32]; value.to_big_endian(&mut expected_output); @@ -127,40 +134,21 @@ fn write_u256() { #[test] fn read_u256() { let value = U256::from(42); - let writer_output = EvmDataWriter::new().write(value).build(); + let writer_output = Writer::new().write(value).build(); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); let parsed: U256 = reader.read().expect("to correctly parse U256"); assert_eq!(value, parsed); } -#[test] -fn read_selector() { - use sha3::{Digest, Keccak256}; - - #[precompile_utils_macro::generate_function_selector] - #[derive(Debug, PartialEq)] - enum FakeAction { - Action1 = "action1()", - } - - let selector = &Keccak256::digest(b"action1()")[0..4]; - - let parsed_selector = - EvmDataReader::read_selector::(selector).expect("there is a selector"); - EvmDataReader::new_skip_selector(selector).expect("there is a selector"); - - assert_eq!(parsed_selector, FakeAction::Action1) -} - #[test] #[should_panic(expected = "to correctly parse U256")] fn read_u256_too_short() { let value = U256::from(42); - let writer_output = EvmDataWriter::new().write(value).build(); + let writer_output = Writer::new().write(value).build(); - let mut reader = EvmDataReader::new(&writer_output[0..31]); + let mut reader = Reader::new(&writer_output[0..31]); let _: U256 = reader.read().expect("to correctly parse U256"); } @@ -173,7 +161,7 @@ fn write_h256() { let value = H256::from(raw); - let output = EvmDataWriter::new().write(value).build(); + let output = Writer::new().write(value).build(); assert_eq!(&output, &raw); } @@ -191,9 +179,9 @@ fn read_h256() { raw[12] = 43; raw[31] = 44; let value = H256::from(raw); - let writer_output = EvmDataWriter::new().write(value).build(); + let writer_output = Writer::new().write(value).build(); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); let parsed: H256 = reader.read().expect("to correctly parse H256"); assert_eq!(value, parsed); @@ -207,9 +195,9 @@ fn read_h256_too_short() { raw[12] = 43; raw[31] = 44; let value = H256::from(raw); - let writer_output = EvmDataWriter::new().write(value).build(); + let writer_output = Writer::new().write(value).build(); - let mut reader = EvmDataReader::new(&writer_output[0..31]); + let mut reader = Reader::new(&writer_output[0..31]); let _: H256 = reader.read().expect("to correctly parse H256"); } @@ -217,7 +205,7 @@ fn read_h256_too_short() { fn write_address() { let value = H160::repeat_byte(0xAA); - let output = EvmDataWriter::new().write(Address(value)).build(); + let output = Writer::new().write(Address(value)).build(); assert_eq!(output.len(), 32); assert_eq!(&output[12..32], value.as_bytes()); @@ -226,9 +214,9 @@ fn write_address() { #[test] fn read_address() { let value = H160::repeat_byte(0xAA); - let writer_output = EvmDataWriter::new().write(Address(value)).build(); + let writer_output = Writer::new().write(Address(value)).build(); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); let parsed: Address = reader.read().expect("to correctly parse Address"); assert_eq!(value, parsed.0); @@ -243,11 +231,11 @@ fn write_h256_array() { H256::repeat_byte(0x44), H256::repeat_byte(0x55), ]; - let writer_output = EvmDataWriter::new().write(array.clone()).build(); + let writer_output = Writer::new().write(array.clone()).build(); assert_eq!(writer_output.len(), 0xE0); // We can read this "manualy" using simpler functions since arrays are 32-byte aligned. - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); assert_eq!(reader.read::().expect("read offset"), 32.into()); assert_eq!(reader.read::().expect("read size"), 5.into()); @@ -267,9 +255,9 @@ fn read_h256_array() { H256::repeat_byte(0x44), H256::repeat_byte(0x55), ]; - let writer_output = EvmDataWriter::new().write(array.clone()).build(); + let writer_output = Writer::new().write(array.clone()).build(); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); let parsed: Vec = reader.read().expect("to correctly parse Vec"); assert_eq!(array, parsed); @@ -284,11 +272,11 @@ fn write_u256_array() { u256_repeat_byte(0x44), u256_repeat_byte(0x55), ]; - let writer_output = EvmDataWriter::new().write(array.clone()).build(); + let writer_output = Writer::new().write(array.clone()).build(); assert_eq!(writer_output.len(), 0xE0); // We can read this "manualy" using simpler functions since arrays are 32-byte aligned. - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); assert_eq!(reader.read::().expect("read offset"), 32.into()); assert_eq!(reader.read::().expect("read size"), 5.into()); @@ -308,9 +296,9 @@ fn read_u256_array() { u256_repeat_byte(0x44), u256_repeat_byte(0x55), ]; - let writer_output = EvmDataWriter::new().write(array.clone()).build(); + let writer_output = Writer::new().write(array.clone()).build(); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); let parsed: Vec = reader.read().expect("to correctly parse Vec"); assert_eq!(array, parsed); @@ -325,10 +313,10 @@ fn write_address_array() { Address(H160::repeat_byte(0x44)), Address(H160::repeat_byte(0x55)), ]; - let writer_output = EvmDataWriter::new().write(array.clone()).build(); + let writer_output = Writer::new().write(array.clone()).build(); // We can read this "manualy" using simpler functions since arrays are 32-byte aligned. - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); assert_eq!(reader.read::().expect("read offset"), 32.into()); assert_eq!(reader.read::().expect("read size"), 5.into()); @@ -348,9 +336,9 @@ fn read_address_array() { Address(H160::repeat_byte(0x44)), Address(H160::repeat_byte(0x55)), ]; - let writer_output = EvmDataWriter::new().write(array.clone()).build(); + let writer_output = Writer::new().write(array.clone()).build(); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); let parsed: Vec

= reader.read().expect("to correctly parse Vec"); assert_eq!(array, parsed); @@ -365,11 +353,11 @@ fn read_address_array_size_too_big() { Address(H160::repeat_byte(0x44)), Address(H160::repeat_byte(0x55)), ]; - let mut writer_output = EvmDataWriter::new().write(array).build(); + let mut writer_output = Writer::new().write(array).build(); U256::from(6u32).to_big_endian(&mut writer_output[0x20..0x40]); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); match reader.read::>().in_field("field") { Ok(_) => panic!("should not parse correctly"), @@ -395,11 +383,11 @@ fn write_address_nested_array() { Address(H160::repeat_byte(0x55)), ], ]; - let writer_output = EvmDataWriter::new().write(array.clone()).build(); + let writer_output = Writer::new().write(array.clone()).build(); assert_eq!(writer_output.len(), 0x160); // We can read this "manualy" using simpler functions since arrays are 32-byte aligned. - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); assert_eq!(reader.read::().expect("read offset"), 0x20.into()); // 0x00 assert_eq!(reader.read::().expect("read size"), 2.into()); // 0x20 @@ -427,9 +415,9 @@ fn read_address_nested_array() { Address(H160::repeat_byte(0x55)), ], ]; - let writer_output = EvmDataWriter::new().write(array.clone()).build(); + let writer_output = Writer::new().write(array.clone()).build(); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); let parsed: Vec> = reader.read().expect("to correctly parse Vec>"); assert_eq!(array, parsed); @@ -446,7 +434,7 @@ fn write_multiple_arrays() { let array2 = vec![H256::repeat_byte(0x44), H256::repeat_byte(0x55)]; - let writer_output = EvmDataWriter::new() + let writer_output = Writer::new() .write(array1.clone()) .write(array2.clone()) .build(); @@ -454,7 +442,7 @@ fn write_multiple_arrays() { assert_eq!(writer_output.len(), 0x120); // We can read this "manualy" using simpler functions since arrays are 32-byte aligned. - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); assert_eq!(reader.read::().expect("read 1st offset"), 0x40.into()); // 0x00 assert_eq!(reader.read::().expect("read 2nd offset"), 0xc0.into()); // 0x20 @@ -477,7 +465,7 @@ fn read_multiple_arrays() { let array2 = vec![H256::repeat_byte(0x44), H256::repeat_byte(0x55)]; - let writer_output = EvmDataWriter::new() + let writer_output = Writer::new() .write(array1.clone()) .write(array2.clone()) .build(); @@ -490,7 +478,7 @@ fn read_multiple_arrays() { // 2 H256 0x120 assert_eq!(writer_output.len(), 0x120); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); let parsed: Vec
= reader.read().expect("to correctly parse Vec
"); assert_eq!(array1, parsed); @@ -503,11 +491,9 @@ fn read_multiple_arrays() { fn read_bytes() { let data = b"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\ tempor incididunt ut labore et dolore magna aliqua."; - let writer_output = EvmDataWriter::new() - .write(UnboundedBytes::from(&data[..])) - .build(); + let writer_output = Writer::new().write(UnboundedBytes::from(&data[..])).build(); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); let parsed: UnboundedBytes = reader.read().expect("to correctly parse Bytes"); assert_eq!(data, parsed.as_bytes()); @@ -518,12 +504,10 @@ fn write_bytes() { let data = b"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\ tempor incididunt ut labore et dolore magna aliqua."; - let writer_output = EvmDataWriter::new() - .write(UnboundedBytes::from(&data[..])) - .build(); + let writer_output = Writer::new().write(UnboundedBytes::from(&data[..])).build(); // We can read this "manualy" using simpler functions. - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); // We pad data to a multiple of 32 bytes. let mut padded = data.to_vec(); @@ -543,11 +527,9 @@ fn write_bytes() { fn read_string() { let data = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\ tempor incididunt ut labore et dolore magna aliqua."; - let writer_output = EvmDataWriter::new() - .write(UnboundedBytes::from(data)) - .build(); + let writer_output = Writer::new().write(UnboundedBytes::from(data)).build(); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); let parsed: UnboundedBytes = reader.read().expect("to correctly parse Bytes"); assert_eq!(data, parsed.as_str().expect("valid utf8")); @@ -558,12 +540,10 @@ fn write_string() { let data = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\ tempor incididunt ut labore et dolore magna aliqua."; - let writer_output = EvmDataWriter::new() - .write(UnboundedBytes::from(data)) - .build(); + let writer_output = Writer::new().write(UnboundedBytes::from(data)).build(); // We can read this "manualy" using simpler functions. - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); // We pad data to next multiple of 32 bytes. let mut padded = data.as_bytes().to_vec(); @@ -584,7 +564,7 @@ fn write_vec_bytes() { let data = b"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\ tempor incididunt ut labore et dolore magna aliqua."; - let writer_output = EvmDataWriter::new() + let writer_output = Writer::new() .write(vec![ UnboundedBytes::from(&data[..]), UnboundedBytes::from(&data[..]), @@ -601,7 +581,7 @@ fn write_vec_bytes() { assert!(data.len() < 0x80); padded.resize(0x80, 0); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); // Offset of vec assert_eq!(reader.read::().expect("read offset"), 32.into()); @@ -640,7 +620,7 @@ fn read_vec_of_bytes() { let data = b"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\ tempor incididunt ut labore et dolore magna aliqua."; - let writer_output = EvmDataWriter::new() + let writer_output = Writer::new() .write(vec![ UnboundedBytes::from(&data[..]), UnboundedBytes::from(&data[..]), @@ -652,7 +632,7 @@ fn read_vec_of_bytes() { .map(|chunk| H256::from_slice(chunk)) .for_each(|hash| println!("{:?}", hash)); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); let parsed: Vec = reader.read().expect("to correctly parse Vec"); assert_eq!( @@ -666,9 +646,9 @@ fn read_vec_of_bytes() { // The following test parses input data generated by web3 from a Solidity contract. // This is important to test on external data since all the above tests can only test consistency -// between `EvmDataReader` and `EvmDataWriter`. +// between `Reader` and `Writer`. // -// It also provides an example on how to impl `EvmData` for Solidity structs. +// It also provides an example on how to impl `solidity::Codec` for Solidity structs. // // struct MultiLocation { // uint8 parents; @@ -682,43 +662,16 @@ fn read_vec_of_bytes() { // uint64 weight // ) external; -#[derive(Clone, Debug, Eq, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq, solidity::Codec)] struct MultiLocation { parents: u8, interior: Vec, } -impl EvmData for MultiLocation { - fn read(reader: &mut EvmDataReader) -> MayRevert { - let mut inner_reader = reader.read_pointer()?; - let parents = inner_reader.read().in_field("parents")?; - let interior = inner_reader.read().in_field("interior")?; - - Ok(MultiLocation { parents, interior }) - } - - fn write(writer: &mut EvmDataWriter, value: Self) { - EvmData::write(writer, (value.parents, value.interior)); - } - - fn has_static_size() -> bool { - <(u8, Vec)>::has_static_size() - } - - fn solidity_type() -> String { - <(u8, Vec)>::solidity_type() - } -} - -#[generate_function_selector] -#[derive(Debug, PartialEq)] -pub enum Action { - TransferMultiAsset = "transfer_multiasset((uint8,bytes[]),uint256,(uint8,bytes[]),uint64)", -} - #[test] fn read_complex_solidity_function() { // Function call data generated by web3. + // transfer_multiasset((uint8,bytes[]),uint256,(uint8,bytes[]),uint64) let data = hex!( "b38c60fa 0000000000000000000000000000000000000000000000000000000000000080 @@ -743,10 +696,10 @@ fn read_complex_solidity_function() { 0100000000000000000000000000000000000000000000000000000000000000" ); - let selector = EvmDataReader::read_selector::(&data).expect("to read selector"); - let mut reader = EvmDataReader::new_skip_selector(&data).expect("to read selector"); + let selector = solidity::codec::selector(&data); + let mut reader = Reader::new_skip_selector(&data).expect("to read selector"); - assert_eq!(selector, Action::TransferMultiAsset); + assert_eq!(selector, Some(0xb38c60fa)); // asset assert_eq!( reader.read::().unwrap(), @@ -779,22 +732,22 @@ fn read_complex_solidity_function() { #[test] fn junctions_decoder_works() { - let writer_output = EvmDataWriter::new() + let writer_output = Writer::new() .write(Junctions::X1(Junction::OnlyChild)) .build(); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); let parsed: Junctions = reader .read::() .expect("to correctly parse Junctions"); assert_eq!(parsed, Junctions::X1(Junction::OnlyChild)); - let writer_output = EvmDataWriter::new() + let writer_output = Writer::new() .write(Junctions::X2(Junction::OnlyChild, Junction::OnlyChild)) .build(); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); let parsed: Junctions = reader .read::() .expect("to correctly parse Junctions"); @@ -804,7 +757,7 @@ fn junctions_decoder_works() { Junctions::X2(Junction::OnlyChild, Junction::OnlyChild) ); - let writer_output = EvmDataWriter::new() + let writer_output = Writer::new() .write(Junctions::X3( Junction::OnlyChild, Junction::OnlyChild, @@ -812,7 +765,7 @@ fn junctions_decoder_works() { )) .build(); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); let parsed: Junctions = reader .read::() .expect("to correctly parse Junctions"); @@ -829,23 +782,23 @@ fn junctions_decoder_works() { #[test] fn junction_decoder_works() { - let writer_output = EvmDataWriter::new().write(Junction::Parachain(0)).build(); + let writer_output = Writer::new().write(Junction::Parachain(0)).build(); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); let parsed: Junction = reader .read::() .expect("to correctly parse Junctions"); assert_eq!(parsed, Junction::Parachain(0)); - let writer_output = EvmDataWriter::new() + let writer_output = Writer::new() .write(Junction::AccountId32 { network: None, id: [1u8; 32], }) .build(); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); let parsed: Junction = reader .read::() .expect("to correctly parse Junctions"); @@ -853,19 +806,19 @@ fn junction_decoder_works() { assert_eq!( parsed, Junction::AccountId32 { - network:None, + network: None, id: [1u8; 32], } ); - let writer_output = EvmDataWriter::new() + let writer_output = Writer::new() .write(Junction::AccountIndex64 { network: None, index: u64::from_be_bytes([1u8; 8]), }) .build(); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); let parsed: Junction = reader .read::() .expect("to correctly parse Junctions"); @@ -878,14 +831,14 @@ fn junction_decoder_works() { } ); - let writer_output = EvmDataWriter::new() + let writer_output = Writer::new() .write(Junction::AccountKey20 { network: None, key: H160::repeat_byte(0xAA).as_bytes().try_into().unwrap(), }) .build(); - let mut reader = EvmDataReader::new(&writer_output); + let mut reader = Reader::new(&writer_output); let parsed: Junction = reader .read::() .expect("to correctly parse Junctions"); @@ -893,7 +846,7 @@ fn junction_decoder_works() { assert_eq!( parsed, Junction::AccountKey20 { - network:None, + network: None, key: H160::repeat_byte(0xAA).as_bytes().try_into().unwrap(), } ); @@ -903,18 +856,16 @@ fn junction_decoder_works() { fn network_id_decoder_works() { assert_eq!(network_id_from_bytes(network_id_to_bytes(None)), Ok(None)); - let mut name = [0u8; 32]; name[0..6].copy_from_slice(b"myname"); - assert_eq!( network_id_from_bytes(network_id_to_bytes(Some(NetworkId::ByGenesis(name)))), - Ok(Some(NetworkId::ByGenesis(name))) + Ok(Some(NetworkId::ByGenesis(name))) ); assert_eq!( network_id_from_bytes(network_id_to_bytes(Some(NetworkId::Kusama))), - Ok(Some(NetworkId::Kusama)) + Ok(Some(NetworkId::Kusama)) ); assert_eq!( @@ -1004,7 +955,7 @@ fn read_static_size_tuple() { 0000000000000000000000000000000000000000000000000000000000000001" ); - let mut reader = EvmDataReader::new(&data); + let mut reader = Reader::new(&data); assert_eq!( reader.read::<(Address, U256)>().unwrap(), @@ -1025,7 +976,7 @@ fn read_dynamic_size_tuple() { 0100000000000000000000000000000000000000000000000000000000000000" ); - let mut reader = EvmDataReader::new(&data); + let mut reader = Reader::new(&data); assert_eq!( reader.read::<(u8, Vec)>().unwrap(), @@ -1035,7 +986,7 @@ fn read_dynamic_size_tuple() { #[test] fn write_static_size_tuple() { - let output = EvmDataWriter::new() + let output = Writer::new() .write((Address(H160::repeat_byte(0x11)), U256::from(1u8))) .build(); @@ -1050,7 +1001,7 @@ fn write_static_size_tuple() { #[test] fn write_dynamic_size_tuple() { - let output = EvmDataWriter::new() + let output = Writer::new() .write((1u8, vec![UnboundedBytes::from(vec![0x01])])) .build(); @@ -1068,6 +1019,36 @@ fn write_dynamic_size_tuple() { assert_eq!(output, data); } +#[test] +fn write_static_size_tuple_in_return_position() { + let output = solidity::encode_return_value((Address(H160::repeat_byte(0x11)), U256::from(1u8))); + + // (address, uint256) encoded by web3 + let data = hex!( + "0000000000000000000000001111111111111111111111111111111111111111 + 0000000000000000000000000000000000000000000000000000000000000001" + ); + + assert_eq!(output, data); +} + +#[test] +fn write_dynamic_size_tuple_in_return_position() { + let output = solidity::encode_return_value((1u8, vec![UnboundedBytes::from(vec![0x01])])); + + // (uint8, bytes[]) encoded by web3 + let data = hex!( + "0000000000000000000000000000000000000000000000000000000000000001 + 0000000000000000000000000000000000000000000000000000000000000040 + 0000000000000000000000000000000000000000000000000000000000000001 + 0000000000000000000000000000000000000000000000000000000000000020 + 0000000000000000000000000000000000000000000000000000000000000001 + 0100000000000000000000000000000000000000000000000000000000000000" + ); + + assert_eq!(output, data); +} + #[test] fn error_location_formatting() { assert_eq!( @@ -1098,42 +1079,43 @@ fn error_formatting() { #[test] fn evm_data_solidity_types() { + use crate::solidity::Codec; // Simple types - assert_eq!(bool::solidity_type(), "bool"); - assert_eq!(u8::solidity_type(), "uint8"); - assert_eq!(u16::solidity_type(), "uint16"); - assert_eq!(u32::solidity_type(), "uint32"); - assert_eq!(u64::solidity_type(), "uint64"); - assert_eq!(u128::solidity_type(), "uint128"); - assert_eq!(U256::solidity_type(), "uint256"); - assert_eq!(H256::solidity_type(), "bytes32"); - assert_eq!(Address::solidity_type(), "address"); - assert_eq!(UnboundedBytes::solidity_type(), "bytes"); - assert_eq!(BoundedBytes::>::solidity_type(), "bytes"); + assert_eq!(bool::signature(), "bool"); + assert_eq!(u8::signature(), "uint8"); + assert_eq!(u16::signature(), "uint16"); + assert_eq!(u32::signature(), "uint32"); + assert_eq!(u64::signature(), "uint64"); + assert_eq!(u128::signature(), "uint128"); + assert_eq!(U256::signature(), "uint256"); + assert_eq!(H256::signature(), "bytes32"); + assert_eq!(Address::signature(), "address"); + assert_eq!(UnboundedBytes::signature(), "bytes"); + assert_eq!(BoundedBytes::>::signature(), "bytes"); // Arrays - assert_eq!(Vec::::solidity_type(), "bool[]"); - assert_eq!(Vec::::solidity_type(), "uint8[]"); - assert_eq!(Vec::::solidity_type(), "uint16[]"); - assert_eq!(Vec::::solidity_type(), "uint32[]"); - assert_eq!(Vec::::solidity_type(), "uint64[]"); - assert_eq!(Vec::::solidity_type(), "uint128[]"); - assert_eq!(Vec::::solidity_type(), "uint256[]"); - assert_eq!(Vec::::solidity_type(), "bytes32[]"); - assert_eq!(Vec::
::solidity_type(), "address[]"); - assert_eq!(Vec::::solidity_type(), "bytes[]"); - assert_eq!(Vec::>>::solidity_type(), "bytes[]"); + assert_eq!(Vec::::signature(), "bool[]"); + assert_eq!(Vec::::signature(), "uint8[]"); + assert_eq!(Vec::::signature(), "uint16[]"); + assert_eq!(Vec::::signature(), "uint32[]"); + assert_eq!(Vec::::signature(), "uint64[]"); + assert_eq!(Vec::::signature(), "uint128[]"); + assert_eq!(Vec::::signature(), "uint256[]"); + assert_eq!(Vec::::signature(), "bytes32[]"); + assert_eq!(Vec::
::signature(), "address[]"); + assert_eq!(Vec::::signature(), "bytes[]"); + assert_eq!(Vec::>>::signature(), "bytes[]"); // Few tuples mixed with arrays - assert_eq!(<(bool, Address)>::solidity_type(), "(bool,address)"); - assert_eq!(<(Vec, Address)>::solidity_type(), "(bool[],address)"); - assert_eq!(<(bool, Vec
)>::solidity_type(), "(bool,address[])"); - assert_eq!(Vec::<(bool, Address)>::solidity_type(), "(bool,address)[]"); + assert_eq!(<(bool, Address)>::signature(), "(bool,address)"); + assert_eq!(<(Vec, Address)>::signature(), "(bool[],address)"); + assert_eq!(<(bool, Vec
)>::signature(), "(bool,address[])"); + assert_eq!(Vec::<(bool, Address)>::signature(), "(bool,address)[]"); assert_eq!( - Vec::<(bool, Vec
)>::solidity_type(), + Vec::<(bool, Vec
)>::signature(), "(bool,address[])[]" ); // Struct encode like tuples - assert_eq!(MultiLocation::solidity_type(), "(uint8,bytes[])"); + assert_eq!(MultiLocation::signature(), "(uint8,bytes[])"); } diff --git a/precompiles/utils/tests-external/Cargo.toml b/precompiles/utils/tests-external/Cargo.toml new file mode 100644 index 00000000..c02f04d5 --- /dev/null +++ b/precompiles/utils/tests-external/Cargo.toml @@ -0,0 +1,30 @@ +[package] +name = "precompile-utils-tests-external" +authors = { workspace = true } +edition = "2021" +version = "0.1.0" + +[lib] +path = "./lib.rs" + +[dependencies] +derive_more = { workspace = true } +hex-literal = { workspace = true } +precompile-utils = { workspace = true, features = [ "testing" ] } +serde = { workspace = true } +sha3 = { workspace = true } + +frame-support = { workspace = true } +frame-system = { workspace = true } +pallet-balances = { workspace = true } +pallet-timestamp = { workspace = true } +parity-scale-codec = { workspace = true, features = [ "max-encoded-len" ] } +scale-info = { workspace = true, features = [ "derive" ] } +sp-core = { workspace = true } +sp-io = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } + +evm = { workspace = true, features = [ "with-codec" ] } +fp-evm = { workspace = true } +pallet-evm = { workspace = true, features = [ "forbid-evm-reentrancy" ] } diff --git a/precompiles/utils/tests-external/lib.rs b/precompiles/utils/tests-external/lib.rs new file mode 100644 index 00000000..30d34135 --- /dev/null +++ b/precompiles/utils/tests-external/lib.rs @@ -0,0 +1,361 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +#[cfg(test)] +mod tests { + use std::cell::RefCell; + use std::rc::Rc; + + use evm::Context; + use fp_evm::{ExitReason, ExitRevert, PrecompileFailure, PrecompileHandle}; + use frame_support::traits::Everything; + use frame_support::{construct_runtime, parameter_types, weights::Weight}; + use pallet_evm::{EnsureAddressNever, EnsureAddressRoot}; + use precompile_utils::{ + precompile_set::*, + solidity::{codec::Writer, revert::revert}, + testing::*, + EvmResult, + }; + use sp_core::H160; + use sp_core::{H256, U256}; + use sp_runtime::{ + traits::{BlakeTwo256, IdentityLookup}, + Perbill, + }; + + pub type AccountId = MockAccount; + pub type Balance = u128; + pub type BlockNumber = u32; + + type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; + type Block = frame_system::mocking::MockBlock; + + construct_runtime!( + pub enum Runtime where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + Balances: pallet_balances::{Pallet, Call, Storage, Event}, + Evm: pallet_evm::{Pallet, Call, Storage, Event}, + Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, + } + ); + + parameter_types! { + pub const BlockHashCount: u32 = 250; + pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 1); + pub const MaximumBlockLength: u32 = 2 * 1024; + pub const AvailableBlockRatio: Perbill = Perbill::one(); + pub const SS58Prefix: u8 = 42; + } + + impl frame_system::Config for Runtime { + type BaseCallFilter = Everything; + type DbWeight = (); + type RuntimeOrigin = RuntimeOrigin; + type Index = u64; + type BlockNumber = BlockNumber; + type RuntimeCall = RuntimeCall; + type Hash = H256; + type Hashing = BlakeTwo256; + type AccountId = AccountId; + type Lookup = IdentityLookup; + type Header = sp_runtime::generic::Header; + type RuntimeEvent = RuntimeEvent; + type BlockHashCount = BlockHashCount; + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = pallet_balances::AccountData; + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type BlockWeights = (); + type BlockLength = (); + type SS58Prefix = SS58Prefix; + type OnSetCode = (); + type MaxConsumers = frame_support::traits::ConstU32<16>; + } + parameter_types! { + pub const ExistentialDeposit: u128 = 1; + } + impl pallet_balances::Config for Runtime { + type MaxReserves = (); + type ReserveIdentifier = [u8; 4]; + type MaxLocks = (); + type Balance = Balance; + type RuntimeEvent = RuntimeEvent; + type DustRemoval = (); + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; + type WeightInfo = (); + } + + #[derive(Debug, Clone)] + pub struct MockPrecompile; + + #[precompile_utils::precompile] + impl MockPrecompile { + // a3cab0dd + #[precompile::public("subcall()")] + fn subcall(handle: &mut impl PrecompileHandle) -> EvmResult { + match handle.call( + handle.code_address(), + None, + // calls subcallLayer2() + Writer::new_with_selector(0x0b93381bu32).build(), + None, + false, + &Context { + caller: handle.code_address(), + address: handle.code_address(), + apparent_value: 0.into(), + }, + ) { + (ExitReason::Succeed(_), _) => Ok(()), + (ExitReason::Revert(_), v) => Err(PrecompileFailure::Revert { + exit_status: ExitRevert::Reverted, + output: v, + }), + _ => Err(revert("unexpected error")), + } + } + + // 0b93381b + #[precompile::public("success()")] + fn success(_: &mut impl PrecompileHandle) -> EvmResult { + Ok(()) + } + } + + pub type Precompiles = PrecompileSetBuilder< + R, + ( + PrecompileAt, MockPrecompile>, + PrecompileAt, MockPrecompile, CallableByContract>, + PrecompileAt, MockPrecompile, CallableByPrecompile>, + PrecompileAt, MockPrecompile, SubcallWithMaxNesting<1>>, + ), + >; + + pub type PCall = MockPrecompileCall; + + parameter_types! { + pub BlockGasLimit: U256 = U256::max_value(); + pub PrecompilesValue: Precompiles = Precompiles::new(); + pub const WeightPerGas: Weight = Weight::from_parts(1, 0); + } + + impl pallet_evm::Config for Runtime { + type FeeCalculator = (); + type GasWeightMapping = pallet_evm::FixedGasWeightMapping; + type WeightPerGas = WeightPerGas; + type CallOrigin = EnsureAddressRoot; + type WithdrawOrigin = EnsureAddressNever; + type AddressMapping = AccountId; + type Currency = Balances; + type RuntimeEvent = RuntimeEvent; + type Runner = pallet_evm::runner::stack::Runner; + type PrecompilesType = Precompiles; + type PrecompilesValue = PrecompilesValue; + type ChainId = (); + type OnChargeTransaction = (); + type BlockGasLimit = BlockGasLimit; + type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; + type FindAuthor = (); + type OnCreate = (); + } + + parameter_types! { + pub const MinimumPeriod: u64 = 5; + } + impl pallet_timestamp::Config for Runtime { + type Moment = u64; + type OnTimestampSet = (); + type MinimumPeriod = MinimumPeriod; + type WeightInfo = (); + } + + struct ExtBuilder; + + impl Default for ExtBuilder { + fn default() -> ExtBuilder { + ExtBuilder + } + } + + impl ExtBuilder { + #[cfg(test)] + fn build(self) -> sp_io::TestExternalities { + let t = frame_system::GenesisConfig::default() + .build_storage::() + .expect("Frame system builds valid default genesis config"); + + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| { + System::set_block_number(1); + }); + ext + } + } + + #[cfg(test)] + fn precompiles() -> Precompiles { + PrecompilesValue::get() + } + + #[test] + fn default_checks_succeed_when_called_by_eoa() { + ExtBuilder::default().build().execute_with(|| { + precompiles() + .prepare_test(Alice, H160::from_low_u64_be(1), PCall::success {}) + .with_subcall_handle(|Subcall { .. }| panic!("there should be no subcall")) + .execute_returns(()) + }) + } + + #[test] + fn default_checks_revert_when_called_by_precompile() { + ExtBuilder::default().build().execute_with(|| { + precompiles() + .prepare_test( + H160::from_low_u64_be(1), + H160::from_low_u64_be(1), + PCall::success {}, + ) + .with_subcall_handle(|Subcall { .. }| panic!("there should be no subcall")) + .execute_reverts(|r| r == b"Function not callable by precompiles") + }) + } + + #[test] + fn default_checks_revert_when_called_by_contract() { + ExtBuilder::default().build().execute_with(|| { + pallet_evm::Pallet::::create_account( + Alice.into(), + hex_literal::hex!("1460006000fd").to_vec(), + ); + + precompiles() + .prepare_test(Alice, H160::from_low_u64_be(1), PCall::success {}) + .with_subcall_handle(|Subcall { .. }| panic!("there should be no subcall")) + .execute_reverts(|r| r == b"Function not callable by smart contracts") + }) + } + + #[test] + fn default_checks_revert_when_doing_subcall() { + ExtBuilder::default().build().execute_with(|| { + precompiles() + .prepare_test(Alice, H160::from_low_u64_be(1), PCall::subcall {}) + .with_subcall_handle(|Subcall { .. }| panic!("there should be no subcall")) + .execute_reverts(|r| r == b"subcalls disabled for this precompile") + }) + } + + #[test] + fn callable_by_contract_works() { + ExtBuilder::default().build().execute_with(|| { + pallet_evm::Pallet::::create_account( + Alice.into(), + hex_literal::hex!("1460006000fd").to_vec(), + ); + + precompiles() + .prepare_test(Alice, H160::from_low_u64_be(2), PCall::success {}) + .with_subcall_handle(|Subcall { .. }| panic!("there should be no subcall")) + .execute_returns(()) + }) + } + + #[test] + fn callable_by_precompile_works() { + ExtBuilder::default().build().execute_with(|| { + precompiles() + .prepare_test( + H160::from_low_u64_be(3), + H160::from_low_u64_be(3), + PCall::success {}, + ) + .with_subcall_handle(|Subcall { .. }| panic!("there should be no subcall")) + .execute_returns(()) + }) + } + + #[test] + fn subcalls_works_when_allowed() { + ExtBuilder::default().build().execute_with(|| { + let subcall_occured = Rc::new(RefCell::new(false)); + { + let subcall_occured = Rc::clone(&subcall_occured); + precompiles() + .prepare_test(Alice, H160::from_low_u64_be(4), PCall::subcall {}) + .with_subcall_handle(move |Subcall { .. }| { + *subcall_occured.borrow_mut() = true; + SubcallOutput::succeed() + }) + .execute_returns(()); + } + assert!(*subcall_occured.borrow()); + }) + } + + #[test] + fn get_address_type_works_for_eoa() { + ExtBuilder::default().build().execute_with(|| { + let addr = H160::repeat_byte(0x1d); + assert_eq!(AddressType::EOA, get_address_type::(addr)); + }) + } + + #[test] + fn get_address_type_works_for_precompile() { + ExtBuilder::default().build().execute_with(|| { + let addr = H160::repeat_byte(0x1d); + pallet_evm::AccountCodes::::insert(addr, vec![0x60, 0x00, 0x60, 0x00, 0xfd]); + assert_eq!(AddressType::Precompile, get_address_type::(addr)); + }) + } + + #[test] + fn get_address_type_works_for_smart_contract() { + ExtBuilder::default().build().execute_with(|| { + let addr = H160::repeat_byte(0x1d); + + // length > 5 + pallet_evm::AccountCodes::::insert( + addr, + vec![0x60, 0x00, 0x60, 0x00, 0xfd, 0xff, 0xff], + ); + assert_eq!(AddressType::Contract, get_address_type::(addr)); + + // length < 5 + pallet_evm::AccountCodes::::insert(addr, vec![0x60, 0x00, 0x60]); + assert_eq!(AddressType::Contract, get_address_type::(addr)); + }) + } + + #[test] + fn get_address_type_works_for_unknown() { + ExtBuilder::default().build().execute_with(|| { + let addr = H160::repeat_byte(0x1d); + pallet_evm::AccountCodes::::insert(addr, vec![0x11, 0x00, 0x60, 0x00, 0xfd]); + assert_eq!(AddressType::Unknown, get_address_type::(addr)); + }) + } +} diff --git a/precompiles/validator-controller/src/lib.rs b/precompiles/validator-controller/src/lib.rs index 231eb734..2fd80922 100644 --- a/precompiles/validator-controller/src/lib.rs +++ b/precompiles/validator-controller/src/lib.rs @@ -133,9 +133,7 @@ where handle.context().address, SELECTOR_LOG_TRANSFER_OWNER, Into::::into(owner), - EvmDataWriter::new() - .write(Into::::into(target_new_owner)) - .build(), + solidity::encode_event_data(Into::::into(target_new_owner)) ) .record(handle)?; @@ -165,11 +163,8 @@ where log1( handle.context().address, SELECTOR_LOG_NEW_OWNER, - EvmDataWriter::new() - .write(Into::::into(target_new_owner)) - .build(), - ) - .record(handle)?; + solidity::encode_event_data(Into::::into(target_new_owner)) + ).record(handle)?; Ok(()) } @@ -234,9 +229,7 @@ where log1( handle.context().address, SELECTOR_VALIDATOR_ADDED, - EvmDataWriter::new() - .write(Into::::into(origin_id)) - .build(), + solidity::encode_event_data(Into::::into(origin_id)) ) .record(handle)?; @@ -272,9 +265,7 @@ where log1( handle.context().address, SELECTOR_VALIDATOR_REMOVED, - EvmDataWriter::new() - .write(Into::::into(origin_id)) - .build(), + solidity::encode_event_data(Into::::into(origin_id)) ) .record(handle)?; diff --git a/precompiles/validator-controller/src/tests.rs b/precompiles/validator-controller/src/tests.rs index 2c743045..e3efa80c 100644 --- a/precompiles/validator-controller/src/tests.rs +++ b/precompiles/validator-controller/src/tests.rs @@ -45,7 +45,7 @@ fn owner_correctly_init() { ExtBuilder::default().build().execute_with(|| { precompiles() .prepare_test(DefaultOwner::get(), Precompile1, PCall::owner {}) - .execute_returns_encoded(Into::::into(DefaultOwner::get())); + .execute_returns(Into::::into(DefaultOwner::get())); }) } @@ -66,28 +66,28 @@ fn transfer_ownership_set_target_if_owner_twice() { DefaultOwner::get(), Precompile1, PCall::transfer_ownership { - new_owner: precompile_utils::data::Address(new_owner), + new_owner: solidity::codec::Address(new_owner), }, ) .execute_some(); precompiles() .prepare_test(DefaultOwner::get(), Precompile1, PCall::pending_owner {}) - .execute_returns_encoded(Into::::into(new_owner)); + .execute_returns(Into::::into(new_owner)); precompiles() .prepare_test( DefaultOwner::get(), Precompile1, PCall::transfer_ownership { - new_owner: precompile_utils::data::Address(other_owner), + new_owner: solidity::codec::Address(other_owner), }, ) .execute_some(); precompiles() .prepare_test(DefaultOwner::get(), Precompile1, PCall::pending_owner {}) - .execute_returns_encoded(Into::::into(other_owner)); + .execute_returns(Into::::into(other_owner)); }) } @@ -101,7 +101,7 @@ fn fail_transfer_ownership_if_not_owner() { new_owner, Precompile1, PCall::transfer_ownership { - new_owner: precompile_utils::data::Address(new_owner), + new_owner: solidity::codec::Address(new_owner), }, ) .execute_reverts(|x| x.eq_ignore_ascii_case(b"sender is not owner")); @@ -128,7 +128,7 @@ fn claim_ownership_if_claimable() { owner, Precompile1, PCall::transfer_ownership { - new_owner: precompile_utils::data::Address(new_owner), + new_owner: solidity::codec::Address(new_owner), }, ) .execute_some(); @@ -138,15 +138,13 @@ fn claim_ownership_if_claimable() { .expect_log(log1( Precompile1, SELECTOR_LOG_NEW_OWNER, - EvmDataWriter::new() - .write(Into::::into(new_owner)) - .build(), + solidity::encode_event_data(Into::::into(new_owner)) )) .execute_some(); precompiles() .prepare_test(new_owner, Precompile1, PCall::owner {}) - .execute_returns_encoded(Into::::into(new_owner)); + .execute_returns(Into::::into(new_owner)); }); } @@ -166,9 +164,7 @@ fn add_validator() { .expect_log(log1( Precompile1, SELECTOR_VALIDATOR_ADDED, - EvmDataWriter::new() - .write(account_id_to_evm_address(validator.clone())) - .build(), + solidity::encode_event_data(account_id_to_evm_address(validator.clone())) )) .execute_some(); @@ -221,9 +217,7 @@ fn add_validator_if_already_init() { .expect_log(log1( Precompile1, SELECTOR_VALIDATOR_ADDED, - EvmDataWriter::new() - .write(account_id_to_evm_address(validator.clone())) - .build(), + solidity::encode_event_data(account_id_to_evm_address(validator.clone())) )) .execute_some(); @@ -308,9 +302,7 @@ fn remove_validator() { .expect_log(log1( Precompile1, SELECTOR_VALIDATOR_REMOVED, - EvmDataWriter::new() - .write(account_id_to_evm_address(validator.clone())) - .build(), + solidity::encode_event_data(account_id_to_evm_address(validator.clone())) )) .execute_some(); @@ -349,7 +341,7 @@ fn get_default_validator_list() { .execute_with(|| { precompiles() .prepare_test(sender, Precompile1, PCall::get_validator_list {}) - .execute_returns_encoded( + .execute_returns( validators .iter() .map(|v| account_id_to_evm_address(*v)) @@ -369,7 +361,7 @@ fn get_default_active_validator_list() { .execute_with(|| { precompiles() .prepare_test(sender, Precompile1, PCall::get_active_validator_list {}) - .execute_returns_encoded( + .execute_returns( validators .iter() .map(|v| account_id_to_evm_address(*v)) diff --git a/primitives/runner/src/lib.rs b/primitives/runner/src/lib.rs index 1a8da551..f973e3e1 100644 --- a/primitives/runner/src/lib.rs +++ b/primitives/runner/src/lib.rs @@ -7,17 +7,20 @@ use evm::{ executor::stack::{Accessed, StackExecutor, StackState as StackStateT, StackSubstateMetadata}, ExitError, ExitReason, Handler, Transfer, }; -use fp_evm::{CallInfo, CreateInfo, ExecutionInfo, Log, Vicinity}; +use fp_evm::{ + CallInfo, CreateInfo, ExecutionInfo, IsPrecompileResult, Log, PrecompileSet, Vicinity, +}; +use frame_support::traits::{Currency, ExistenceRequirement, Get, Time}; use frame_support::sp_runtime::traits::UniqueSaturatedInto; use frame_support::weights::Weight; use pallet_evm::Pallet; use pallet_evm::{ AccountCodes, AccountStorages, AddressMapping, BalanceOf, BlockHashMapping, Config, Error, - Event, FeeCalculator, PrecompileSet, Runner as RunnerT, RunnerError, OnCreate, + Event, FeeCalculator, Runner as RunnerT, RunnerError, OnCreate, }; use pallet_user_fee_selector::UserFeeTokenController; use precompile_utils::prelude::keccak256; -use sp_core::{Get, H160, H256, U256}; +use sp_core::{H160, H256, U256}; use sp_std::{ boxed::Box, collections::{btree_map::BTreeMap, btree_set::BTreeSet}, @@ -71,6 +74,7 @@ where T::PrecompilesType, >, ) -> (ExitReason, R), + R: Default, { let (base_fee, weight) = T::FeeCalculator::min_gas_price(); @@ -110,7 +114,7 @@ where source: H160, dapp: Option, value: U256, - gas_limit: u64, + mut gas_limit: u64, max_fee_per_gas: Option, max_priority_fee_per_gas: Option, config: &'config evm::Config, @@ -129,7 +133,28 @@ where T::PrecompilesType, >, ) -> (ExitReason, R), + R: Default, { + // The precompile check is only used for transactional invocations. However, here we always + // execute the check, because the check has side effects. + let is_precompile = match precompiles.is_precompile(source, gas_limit) { + IsPrecompileResult::Answer { + is_precompile, + extra_cost, + } => { + gas_limit = gas_limit.saturating_sub(extra_cost); + is_precompile + } + IsPrecompileResult::OutOfGas => { + return Ok(ExecutionInfo { + exit_reason: ExitError::OutOfGas.into(), + value: Default::default(), + used_gas: gas_limit.into(), + logs: Default::default(), + }) + } + }; + // Only check the restrictions of EIP-3607 if the source of the EVM operation is from an external transaction. // If the source of this EVM operation is from an internal call, like from `eth_call` or `eth_estimateGas` RPC, // we will skip the checks for the EIP-3607. @@ -142,7 +167,7 @@ where // projects using Frontier can have stateful precompiles that can manage funds or // which calls other contracts that expects this precompile address to be trustworthy. if is_transactional - && (!>::get(source).is_empty() || precompiles.is_precompile(source)) + && (!>::get(source).is_empty() || is_precompile) { return Err(RunnerError { error: Error::::TransactionMustComeFromEOA, @@ -677,6 +702,10 @@ impl<'vicinity, 'config, T: Config> BackendT for SubstrateStackState<'vicinity, self.vicinity.origin } + fn block_randomness(&self) -> Option { + None + } + fn block_hash(&self, number: U256) -> H256 { if number > U256::from(u32::MAX) { H256::default() @@ -695,7 +724,7 @@ impl<'vicinity, 'config, T: Config> BackendT for SubstrateStackState<'vicinity, } fn block_timestamp(&self) -> U256 { - let now: u128 = pallet_timestamp::Pallet::::get().unique_saturated_into(); + let now: u128 = T::Timestamp::now().unique_saturated_into(); U256::from(now / 1000) } @@ -787,9 +816,10 @@ where self.substate.deleted(address) } - fn inc_nonce(&mut self, address: H160) { + fn inc_nonce(&mut self, address: H160) -> Result<(), ExitError> { let account_id = T::AddressMapping::into_account_id(address); frame_system::Pallet::::inc_account_nonce(&account_id); + Ok(()) } fn set_storage(&mut self, address: H160, index: H256, value: H256) { @@ -881,6 +911,15 @@ where self.substate .recursive_is_cold(&|a: &Accessed| a.accessed_storage.contains(&(address, key))) } + + fn code_size(&self, address: H160) -> U256 { + U256::from(>::account_code_metadata(address).size) + } + + fn code_hash(&self, address: H160) -> H256 { + >::account_code_metadata(address).hash + } + } pub trait OnChargeDecentralizedNativeTokenFee { diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 1a373082..2f35b24b 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -263,22 +263,11 @@ impl pallet_aura::Config for Runtime { impl pallet_grandpa::Config for Runtime { type RuntimeEvent = RuntimeEvent; - - type KeyOwnerProof = - >::Proof; - - type KeyOwnerIdentification = >::IdentificationTuple; - - type KeyOwnerProofSystem = (); - - type HandleEquivocation = (); - type WeightInfo = (); type MaxAuthorities = ConstU32<32>; type MaxSetIdSessionEntries = (); + type KeyOwnerProof = sp_core::Void; + type EquivocationReportSystem = (); } parameter_types! { @@ -491,6 +480,8 @@ impl pallet_evm::Config for Runtime { type OnChargeTransaction = (); type OnCreate = (); type FindAuthor = FindAuthorLinkedOrTruncated; + type Timestamp = Timestamp; + type WeightInfo = pallet_evm::weights::SubstrateWeight; } parameter_types! { @@ -501,6 +492,7 @@ impl pallet_ethereum::Config for Runtime { type RuntimeEvent = RuntimeEvent; type StateRoot = pallet_ethereum::IntermediateStateRoot; type PostLogContent = PostBlockAndTxnHashes; + type ExtraDataLength = ConstU32<30>; } impl pallet_dnt_fee_controller::Config for Runtime { @@ -1039,7 +1031,7 @@ impl_runtime_apis! { } fn account_basic(address: H160) -> EVMAccount { - EVMAccount { nonce: EVM::account_basic(&address).0.nonce, balance: ::User::balance_of(address) } + EVMAccount { nonce: pallet_evm::Pallet::::account_basic(&address).0.nonce, balance: ::User::balance_of(address) } } fn gas_price() -> U256 { @@ -1048,7 +1040,7 @@ impl_runtime_apis! { } fn account_code_at(address: H160) -> Vec { - EVM::account_codes(address) + pallet_evm::AccountCodes::::get(address) } fn author() -> H160 { @@ -1058,7 +1050,7 @@ impl_runtime_apis! { fn storage_at(address: H160, index: U256) -> H256 { let mut tmp = [0u8; 32]; index.to_big_endian(&mut tmp); - EVM::account_storages(address, H256::from_slice(&tmp[..])) + pallet_evm::AccountStorages::::get(address, H256::from_slice(&tmp[..])) } fn call( @@ -1138,15 +1130,15 @@ impl_runtime_apis! { } fn current_transaction_statuses() -> Option> { - Ethereum::current_transaction_statuses() + pallet_ethereum::CurrentTransactionStatuses::::get() } fn current_block() -> Option { - Ethereum::current_block() + pallet_ethereum::CurrentBlock::::get() } fn current_receipts() -> Option> { - Ethereum::current_receipts() + pallet_ethereum::CurrentReceipts::::get() } fn current_all() -> ( @@ -1155,9 +1147,9 @@ impl_runtime_apis! { Option> ) { ( - Ethereum::current_block(), - Ethereum::current_receipts(), - Ethereum::current_transaction_statuses() + pallet_ethereum::CurrentBlock::::get(), + pallet_ethereum::CurrentReceipts::::get(), + pallet_ethereum::CurrentTransactionStatuses::::get() ) } @@ -1171,7 +1163,7 @@ impl_runtime_apis! { } fn elasticity() -> Option { - Some(BaseFee::elasticity()) + Some(pallet_base_fee::Elasticity::::get()) } fn gas_limit_multiplier_support() {} @@ -1277,7 +1269,9 @@ impl_runtime_apis! { let validator_conversion_rate = >::conversion_rate(source_address, validator.into(), source_fee_token); - let custom_fee_info = CustomFeeInfo::new(BaseFee::base_fee_per_gas(), &transaction); + let fee = pallet_base_fee::BaseFeePerGas::::get(); + + let custom_fee_info = CustomFeeInfo::new(fee, &transaction); if !custom_fee_info.match_validator_conversion_rate_limit(validator_conversion_rate) { return false @@ -1299,7 +1293,9 @@ impl_runtime_apis! { let validator_conversion_rate = >::conversion_rate(source_address, validator.into(), source_fee_token); - let custom_fee_info = CustomFeeInfo::new(BaseFee::base_fee_per_gas(), &transaction); + let fee = pallet_base_fee::BaseFeePerGas::::get(); + + let custom_fee_info = CustomFeeInfo::new(fee, &transaction); if !custom_fee_info.match_validator_conversion_rate_limit(validator_conversion_rate) { return false diff --git a/runtime/src/precompiles.rs b/runtime/src/precompiles.rs index 0cd6eae1..0fb4c09f 100644 --- a/runtime/src/precompiles.rs +++ b/runtime/src/precompiles.rs @@ -34,6 +34,8 @@ parameter_types! { pub DefaultToken:H160 = H160::from_str(DEFAULT_FEE_TOKEN).expect("invalid address"); } +type EthereumPrecompilesChecks = (AcceptDelegateCall, CallableByContract, CallableByPrecompile); + // Set of Stability precompiles pub type StabilityPrecompiles = PrecompileSetBuilder< R, @@ -44,15 +46,15 @@ pub type StabilityPrecompiles = PrecompileSetBuilder< ( // Ethereum precompiles: // We allow DELEGATECALL to stay compliant with Ethereum behavior. - PrecompileAt, ECRecover, ForbidRecursion, AllowDelegateCall>, - PrecompileAt, Sha256, ForbidRecursion, AllowDelegateCall>, - PrecompileAt, Ripemd160, ForbidRecursion, AllowDelegateCall>, - PrecompileAt, Identity, ForbidRecursion, AllowDelegateCall>, - PrecompileAt, Modexp, ForbidRecursion, AllowDelegateCall>, - PrecompileAt, Bn128Add, ForbidRecursion, AllowDelegateCall>, - PrecompileAt, Bn128Mul, ForbidRecursion, AllowDelegateCall>, - PrecompileAt, Bn128Pairing, ForbidRecursion, AllowDelegateCall>, - PrecompileAt, Blake2F, ForbidRecursion, AllowDelegateCall>, + PrecompileAt, ECRecover, EthereumPrecompilesChecks>, + PrecompileAt, Sha256, EthereumPrecompilesChecks>, + PrecompileAt, Ripemd160, EthereumPrecompilesChecks>, + PrecompileAt, Identity, EthereumPrecompilesChecks>, + PrecompileAt, Modexp, EthereumPrecompilesChecks>, + PrecompileAt, Bn128Add, EthereumPrecompilesChecks>, + PrecompileAt, Bn128Mul, EthereumPrecompilesChecks>, + PrecompileAt, Bn128Pairing, EthereumPrecompilesChecks>, + PrecompileAt, Blake2F, EthereumPrecompilesChecks>, // Non-Stability specific nor Ethereum precompiles : PrecompileAt, Sha3FIPS256>, PrecompileAt, ECRecoverPublicKey>, diff --git a/test-utils/stability-client/src/client_ext.rs b/test-utils/stability-client/src/client_ext.rs index 7bb3265d..ca30dbde 100644 --- a/test-utils/stability-client/src/client_ext.rs +++ b/test-utils/stability-client/src/client_ext.rs @@ -17,7 +17,6 @@ //! Client extension for tests. -use codec::alloc::collections::hash_map::HashMap; use sc_client_api::{backend::Finalizer, client::BlockBackend}; use sc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy}; use sc_service::client::Client; @@ -100,7 +99,7 @@ where import.body = Some(extrinsics); import.fork_choice = Some(ForkChoiceStrategy::LongestChain); - BlockImport::import_block(self, import, HashMap::new()).await.map(|_| ()) + BlockImport::import_block(self, import).await.map(|_| ()) } async fn import_as_best( @@ -113,7 +112,7 @@ where import.body = Some(extrinsics); import.fork_choice = Some(ForkChoiceStrategy::Custom(true)); - BlockImport::import_block(self, import, HashMap::new()).await.map(|_| ()) + BlockImport::import_block(self, import).await.map(|_| ()) } async fn import_as_final( @@ -127,7 +126,7 @@ where import.finalized = true; import.fork_choice = Some(ForkChoiceStrategy::Custom(true)); - BlockImport::import_block(self, import, HashMap::new()).await.map(|_| ()) + BlockImport::import_block(self, import).await.map(|_| ()) } async fn import_justified( @@ -143,7 +142,7 @@ where import.finalized = true; import.fork_choice = Some(ForkChoiceStrategy::LongestChain); - BlockImport::import_block(self, import, HashMap::new()).await.map(|_| ()) + BlockImport::import_block(self, import).await.map(|_| ()) } } @@ -162,7 +161,7 @@ where import.body = Some(extrinsics); import.fork_choice = Some(ForkChoiceStrategy::LongestChain); - BlockImport::import_block(self, import, HashMap::new()).await.map(|_| ()) + BlockImport::import_block(self, import).await.map(|_| ()) } async fn import_as_best( @@ -175,7 +174,7 @@ where import.body = Some(extrinsics); import.fork_choice = Some(ForkChoiceStrategy::Custom(true)); - BlockImport::import_block(self, import, HashMap::new()).await.map(|_| ()) + BlockImport::import_block(self, import).await.map(|_| ()) } async fn import_as_final( @@ -189,7 +188,7 @@ where import.finalized = true; import.fork_choice = Some(ForkChoiceStrategy::Custom(true)); - BlockImport::import_block(self, import, HashMap::new()).await.map(|_| ()) + BlockImport::import_block(self, import).await.map(|_| ()) } async fn import_justified( @@ -205,6 +204,6 @@ where import.finalized = true; import.fork_choice = Some(ForkChoiceStrategy::LongestChain); - BlockImport::import_block(self, import, HashMap::new()).await.map(|_| ()) + BlockImport::import_block(self, import).await.map(|_| ()) } } diff --git a/test-utils/stability-runtime-client/Cargo.toml b/test-utils/stability-runtime-client/Cargo.toml index 172578f4..f1872629 100644 --- a/test-utils/stability-runtime-client/Cargo.toml +++ b/test-utils/stability-runtime-client/Cargo.toml @@ -13,6 +13,7 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", workspace = true } futures = { workspace = true } sc-block-builder = { workspace = true } +sc-chain-spec = { workspace = true } sc-client-api = { workspace = true } sc-consensus = { workspace = true } sp-api = { workspace = true } diff --git a/test-utils/stability-runtime-client/src/lib.rs b/test-utils/stability-runtime-client/src/lib.rs index d6a4392c..2d272485 100644 --- a/test-utils/stability-runtime-client/src/lib.rs +++ b/test-utils/stability-runtime-client/src/lib.rs @@ -28,6 +28,9 @@ use std::sync::Arc; pub use self::block_builder_ext::BlockBuilderExt; +use sc_chain_spec::construct_genesis_block; +use sp_api::StateVersion; + use sp_core::{sr25519, storage::ChildInfo, Pair}; use sp_runtime::traits::{Block as BlockT, Hash as HashT, Header as HeaderT}; use stability_test_runtime::genesismap::{additional_storage_with_genesis, GenesisConfig}; @@ -116,7 +119,7 @@ impl GenesisParameters { } } -impl stability_test_client::GenesisInit for GenesisParameters { +impl GenesisInit for GenesisParameters { fn genesis_storage(&self) -> Storage { use codec::Encode; @@ -143,7 +146,7 @@ impl stability_test_client::GenesisInit for GenesisParameters { storage.top.clone().into_iter().chain(child_roots).collect(), sp_runtime::StateVersion::V1, ); - let block: runtime::Block = client::genesis::construct_genesis_block(state_root); + let block: runtime::Block = construct_genesis_block(state_root, StateVersion::V1); storage.top.extend(additional_storage_with_genesis(&block)); storage @@ -261,7 +264,7 @@ impl TestClientBuilderExt client::LocalCallExecutor< stability_test_runtime::Block, B, - sc_executor::NativeElseWasmExecutor, + NativeElseWasmExecutor, >, B, > where @@ -292,11 +295,6 @@ pub fn new() -> Client { } /// Create a new native executor. -pub fn new_native_executor() -> sc_executor::NativeElseWasmExecutor { - sc_executor::NativeElseWasmExecutor::new( - sc_executor::WasmExecutionMethod::Interpreted, - None, - 8, - 2, - ) -} +pub fn new_native_executor() -> NativeElseWasmExecutor { + NativeElseWasmExecutor::new(sc_executor::WasmExecutionMethod::Interpreted, None, 8, 2) +} \ No newline at end of file diff --git a/test-utils/stability-runtime/Cargo.toml b/test-utils/stability-runtime/Cargo.toml index b5cecda9..e8b8b50c 100644 --- a/test-utils/stability-runtime/Cargo.toml +++ b/test-utils/stability-runtime/Cargo.toml @@ -12,10 +12,10 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] -beefy-primitives = { workspace = true, package = "sp-beefy" } pallet-beefy-mmr = { workspace = true } sp-application-crypto = { workspace = true } sp-consensus-aura = { workspace = true } +sp-consensus-beefy = { workspace = true } sp-consensus-babe = { workspace = true } sp-block-builder = { workspace = true } codec = { package = "parity-scale-codec", workspace = true, features = ["derive"] } @@ -37,7 +37,7 @@ pallet-babe = { workspace = true } frame-system = { workspace = true } frame-system-rpc-runtime-api = { workspace = true } pallet-timestamp = { workspace = true } -sp-finality-grandpa = { workspace = true } +sp-consensus-grandpa = { workspace = true } sp-trie = { workspace = true } sp-transaction-pool = { workspace = true } trie-db = { workspace = true } @@ -69,11 +69,11 @@ default = [ "std", ] std = [ - "beefy-primitives/std", "pallet-beefy-mmr/std", "sp-application-crypto/std", "sp-consensus-aura/std", "sp-consensus-babe/std", + "sp-consensus-beefy/std", "sp-block-builder/std", "codec/std", "scale-info/std", @@ -100,7 +100,7 @@ std = [ "frame-system/std", "pallet-timestamp/std", "sc-service", - "sp-finality-grandpa/std", + "sp-consensus-grandpa/std", "sp-trie/std", "sp-transaction-pool/std", "trie-db/std", diff --git a/test-utils/stability-runtime/src/genesismap.rs b/test-utils/stability-runtime/src/genesismap.rs index f0f38bd8..ce460a88 100644 --- a/test-utils/stability-runtime/src/genesismap.rs +++ b/test-utils/stability-runtime/src/genesismap.rs @@ -20,10 +20,10 @@ use super::{system, wasm_binary_unwrap, AccountId, AuthorityId, Runtime}; use codec::{Encode, Joiner, KeyedVec}; use frame_support::traits::GenesisBuild; -use sc_service::client::genesis; +use sc_service::construct_genesis_block; use sp_core::{ map, - storage::{well_known_keys, Storage}, + storage::{well_known_keys, StateVersion, Storage}, }; use sp_io::hashing::{blake2_256, twox_128}; use sp_runtime::traits::{Block as BlockT, Hash as HashT, Header as HeaderT}; @@ -106,7 +106,7 @@ pub fn insert_genesis_block(storage: &mut Storage) -> sp_core::hash::H256 { storage.top.clone().into_iter().collect(), sp_runtime::StateVersion::V1, ); - let block: crate::Block = genesis::construct_genesis_block(state_root); + let block: crate::Block = construct_genesis_block(state_root, StateVersion::V1); let genesis_hash = block.header.hash(); storage.top.extend(additional_storage_with_genesis(&block)); genesis_hash diff --git a/test-utils/stability-runtime/src/lib.rs b/test-utils/stability-runtime/src/lib.rs index a25a4da5..200c6aa4 100644 --- a/test-utils/stability-runtime/src/lib.rs +++ b/test-utils/stability-runtime/src/lib.rs @@ -686,20 +686,11 @@ impl pallet_babe::Config for Runtime { type EpochChangeTrigger = pallet_babe::ExternalTrigger; type DisabledValidators = (); - type KeyOwnerProofSystem = (); - - type KeyOwnerProof = - >::Proof; - - type KeyOwnerIdentification = >::IdentificationTuple; - - type HandleEquivocation = (); type WeightInfo = (); type MaxAuthorities = ConstU32<10>; + type KeyOwnerProof = sp_core::Void; + type EquivocationReportSystem = (); } /// Adds one to the given input and returns the final result. @@ -975,64 +966,64 @@ cfg_if! { } } - impl sp_finality_grandpa::GrandpaApi for Runtime { - fn grandpa_authorities() -> sp_finality_grandpa::AuthorityList { + impl sp_consensus_grandpa::GrandpaApi for Runtime { + fn grandpa_authorities() -> sp_consensus_grandpa::AuthorityList { Vec::new() } - fn current_set_id() -> sp_finality_grandpa::SetId { + fn current_set_id() -> sp_consensus_grandpa::SetId { 0 } fn submit_report_equivocation_unsigned_extrinsic( - _equivocation_proof: sp_finality_grandpa::EquivocationProof< + _equivocation_proof: sp_consensus_grandpa::EquivocationProof< ::Hash, NumberFor, >, - _key_owner_proof: sp_finality_grandpa::OpaqueKeyOwnershipProof, + _key_owner_proof: sp_consensus_grandpa::OpaqueKeyOwnershipProof, ) -> Option<()> { None } fn generate_key_ownership_proof( - _set_id: sp_finality_grandpa::SetId, - _authority_id: sp_finality_grandpa::AuthorityId, - ) -> Option { + _set_id: sp_consensus_grandpa::SetId, + _authority_id: sp_consensus_grandpa::AuthorityId, + ) -> Option { None } } - impl beefy_primitives::BeefyApi for Runtime { + impl sp_consensus_beefy::BeefyApi for Runtime { fn beefy_genesis() -> Option { None } - fn validator_set() -> Option> { + fn validator_set() -> Option> { None } fn submit_report_equivocation_unsigned_extrinsic( - _equivocation_proof: beefy_primitives::EquivocationProof< + _equivocation_proof: sp_consensus_beefy::EquivocationProof< NumberFor, - beefy_primitives::crypto::AuthorityId, - beefy_primitives::crypto::Signature + sp_consensus_beefy::crypto::AuthorityId, + sp_consensus_beefy::crypto::Signature >, - _key_owner_proof: beefy_primitives::OpaqueKeyOwnershipProof, + _key_owner_proof: sp_consensus_beefy::OpaqueKeyOwnershipProof, ) -> Option<()> { None } fn generate_key_ownership_proof( - _set_id: beefy_primitives::ValidatorSetId, - _authority_id: beefy_primitives::crypto::AuthorityId, - ) -> Option { None } + _set_id: sp_consensus_beefy::ValidatorSetId, + _authority_id: sp_consensus_beefy::crypto::AuthorityId, + ) -> Option { None } } - impl pallet_beefy_mmr::BeefyMmrApi for Runtime { - fn authority_set_proof() -> beefy_primitives::mmr::BeefyAuthoritySet { + impl pallet_beefy_mmr::BeefyMmrApi for Runtime { + fn authority_set_proof() -> sp_consensus_beefy::mmr::BeefyAuthoritySet { Default::default() } - fn next_authority_set_proof() -> beefy_primitives::mmr::BeefyNextAuthoritySet { + fn next_authority_set_proof() -> sp_consensus_beefy::mmr::BeefyNextAuthoritySet { Default::default() } } From 05b84d105ed0977de7cfd1bb0b5dc45bc3d0e351 Mon Sep 17 00:00:00 2001 From: GabrielMartinezRodriguez Date: Thu, 26 Oct 2023 13:01:35 +0200 Subject: [PATCH 05/37] chore: polkadot v0.9.42 --- Cargo.lock | 971 ++++++++++-------- Cargo.toml | 221 ++-- client/authorship/src/authorship.rs | 32 +- node/Cargo.toml | 28 +- node/src/cli.rs | 8 +- node/src/eth.rs | 15 +- node/src/rpc/eth.rs | 11 +- node/src/service.rs | 19 +- pallets/custom-balances/src/lib.rs | 20 +- pallets/sponsored-transactions/src/lib.rs | 4 + .../validator-fee-selector/src/lib.rs | 2 + pallets/zero-gas-transactions/src/lib.rs | 2 + precompiles/utils/src/evm/handle.rs | 26 + precompiles/utils/src/precompile_set.rs | 46 +- precompiles/utils/src/substrate.rs | 56 +- precompiles/utils/src/testing/handle.rs | 10 + precompiles/utils/tests-external/lib.rs | 96 +- primitives/runner/src/lib.rs | 428 +++++++- primitives/transaction-validator/src/lib.rs | 2 + runtime/src/lib.rs | 112 +- rust-toolchain.toml | 9 +- test-utils/stability-client/src/lib.rs | 12 +- test-utils/stability-runtime/src/lib.rs | 28 +- test-utils/stability-runtime/src/system.rs | 30 +- 24 files changed, 1476 insertions(+), 712 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 88205979..8fed4247 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -238,6 +238,55 @@ dependencies = [ "winapi", ] +[[package]] +name = "anstream" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" + +[[package]] +name = "anstyle-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + [[package]] name = "anyhow" version = "1.0.75" @@ -507,10 +556,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" [[package]] -name = "base58" +name = "base16ct" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" @@ -551,7 +600,7 @@ dependencies = [ [[package]] name = "binary-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "hash-db 0.16.0", "log", @@ -597,9 +646,6 @@ name = "bitflags" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -dependencies = [ - "serde", -] [[package]] name = "bitvec" @@ -1009,40 +1055,45 @@ dependencies = [ [[package]] name = "clap" -version = "4.1.4" +version = "4.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f13b9c79b5d1dd500d20ef541215a6423c75829ef43117e1b4d17fd8af0b5d76" +checksum = "d9394150f5b4273a1763355bd1c2ec54cc5a2593f790587bcd6b2c947cfa9211" dependencies = [ - "bitflags 1.3.2", + "clap_builder", "clap_derive", - "clap_lex", - "is-terminal", "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a78fbdd3cc2914ddf37ba444114bc7765bbdcb55ec9cbe6fa054f0137400717" +dependencies = [ + "anstream", + "anstyle", + "bitflags 1.3.2", + "clap_lex", "strsim", - "termcolor", ] [[package]] name = "clap_derive" -version = "4.1.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "684a277d672e91966334af371f1a7b5833f9aa00b07c84e92fbce95e00208ce8" +checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" dependencies = [ "heck", - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.38", ] [[package]] name = "clap_lex" -version = "0.3.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade" -dependencies = [ - "os_str_bytes", -] +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" [[package]] name = "codespan-reporting" @@ -1054,6 +1105,12 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "comfy-table" version = "6.2.0" @@ -1343,6 +1400,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "crypto-bigint" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" +dependencies = [ + "generic-array 0.14.7", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -1558,7 +1627,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" dependencies = [ "const-oid", - "pem-rfc7468 0.6.0", + "pem-rfc7468", "zeroize", ] @@ -1569,7 +1638,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ "const-oid", - "pem-rfc7468 0.7.0", "zeroize", ] @@ -1828,11 +1896,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" dependencies = [ "der 0.6.1", - "elliptic-curve", - "rfc6979", + "elliptic-curve 0.12.3", + "rfc6979 0.3.1", "signature 1.6.4", ] +[[package]] +name = "ecdsa" +version = "0.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" +dependencies = [ + "der 0.7.8", + "digest 0.10.7", + "elliptic-curve 0.13.6", + "rfc6979 0.4.0", + "signature 2.1.0", + "spki 0.7.2", +] + [[package]] name = "ed25519" version = "1.5.3" @@ -1909,18 +1991,37 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" dependencies = [ - "base16ct", - "crypto-bigint", + "base16ct 0.1.1", + "crypto-bigint 0.4.9", "der 0.6.1", "digest 0.10.7", - "ff", + "ff 0.12.1", "generic-array 0.14.7", - "group", + "group 0.12.1", "hkdf", - "pem-rfc7468 0.6.0", + "pem-rfc7468", "pkcs8 0.9.0", "rand_core 0.6.4", - "sec1", + "sec1 0.3.0", + "subtle", + "zeroize", +] + +[[package]] +name = "elliptic-curve" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d97ca172ae9dc9f9b779a6e3a65d308f2af74e5b8c921299075bdb4a0370e914" +dependencies = [ + "base16ct 0.2.0", + "crypto-bigint 0.5.3", + "digest 0.10.7", + "ff 0.13.0", + "generic-array 0.14.7", + "group 0.13.0", + "pkcs8 0.10.2", + "rand_core 0.6.4", + "sec1 0.7.3", "subtle", "zeroize", ] @@ -1987,17 +2088,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "etcetera" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" -dependencies = [ - "cfg-if", - "home", - "windows-sys 0.48.0", -] - [[package]] name = "ethbloom" version = "0.13.0" @@ -2056,8 +2146,7 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "evm" version = "0.39.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a49a4e11987c51220aa89dbe1a5cc877f5079fa6864c0a5b4533331db44e9365" +source = "git+https://github.com/rust-blockchain/evm?rev=b7b82c7e1fc57b7449d6dfa6826600de37cc1e65#b7b82c7e1fc57b7449d6dfa6826600de37cc1e65" dependencies = [ "auto_impl", "environmental", @@ -2077,8 +2166,7 @@ dependencies = [ [[package]] name = "evm-core" version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f1f13264b044cb66f0602180f0bc781c29accb41ff560669a3ec15858d5b606" +source = "git+https://github.com/rust-blockchain/evm?rev=b7b82c7e1fc57b7449d6dfa6826600de37cc1e65#b7b82c7e1fc57b7449d6dfa6826600de37cc1e65" dependencies = [ "parity-scale-codec", "primitive-types", @@ -2089,8 +2177,7 @@ dependencies = [ [[package]] name = "evm-gasometer" version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d43eadc395bd1a52990787ca1495c26b0248165444912be075c28909a853b8c" +source = "git+https://github.com/rust-blockchain/evm?rev=b7b82c7e1fc57b7449d6dfa6826600de37cc1e65#b7b82c7e1fc57b7449d6dfa6826600de37cc1e65" dependencies = [ "environmental", "evm-core", @@ -2101,8 +2188,7 @@ dependencies = [ [[package]] name = "evm-runtime" version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aa5b32f59ec582a5651978004e5c784920291263b7dcb6de418047438e37f4f" +source = "git+https://github.com/rust-blockchain/evm?rev=b7b82c7e1fc57b7449d6dfa6826600de37cc1e65#b7b82c7e1fc57b7449d6dfa6826600de37cc1e65" dependencies = [ "auto_impl", "environmental", @@ -2169,7 +2255,7 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fc-cli" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "clap", "ethereum-types", @@ -2187,7 +2273,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "async-trait", "fp-consensus", @@ -2203,7 +2289,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "async-trait", "ethereum", @@ -2233,7 +2319,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "fc-db", "fc-storage", @@ -2256,7 +2342,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "ethereum", "ethereum-types", @@ -2289,6 +2375,7 @@ dependencies = [ "sc-transaction-pool", "sc-transaction-pool-api", "sc-utils", + "serde", "sp-api", "sp-block-builder", "sp-blockchain", @@ -2305,7 +2392,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "ethereum", "ethereum-types", @@ -2318,7 +2405,7 @@ dependencies = [ [[package]] name = "fc-storage" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "ethereum", "ethereum-types", @@ -2352,6 +2439,16 @@ dependencies = [ "subtle", ] +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "fiat-crypto" version = "0.2.1" @@ -2396,12 +2493,6 @@ dependencies = [ "scale-info", ] -[[package]] -name = "finl_unicode" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" - [[package]] name = "fixed-hash" version = "0.8.0" @@ -2475,7 +2566,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", ] @@ -2492,7 +2583,7 @@ dependencies = [ [[package]] name = "fp-account" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "hex", "impl-serde", @@ -2504,13 +2595,14 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", + "sp-runtime-interface", "sp-std", ] [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "ethereum", "parity-scale-codec", @@ -2522,13 +2614,13 @@ dependencies = [ [[package]] name = "fp-ethereum" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "ethereum", "ethereum-types", "fp-evm", "frame-support", - "num_enum", + "num_enum 0.6.1", "parity-scale-codec", "sp-std", ] @@ -2536,11 +2628,12 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "evm", "frame-support", "parity-scale-codec", + "scale-info", "serde", "sp-core", "sp-runtime", @@ -2550,7 +2643,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "ethereum", "ethereum-types", @@ -2567,7 +2660,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "frame-support", "parity-scale-codec", @@ -2579,7 +2672,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "parity-scale-codec", "serde", @@ -2594,7 +2687,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-support-procedural", @@ -2619,7 +2712,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "Inflector", "array-bytes", @@ -2666,7 +2759,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -2694,7 +2787,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "bitflags 1.3.2", "environmental", @@ -2727,44 +2820,45 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "Inflector", "cfg-expr", "derive-syn-parse", "frame-support-procedural-tools", "itertools 0.10.5", + "proc-macro-warning", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.38", ] [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.38", ] [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.38", ] [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "log", @@ -2782,7 +2876,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -2797,7 +2891,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "sp-api", @@ -2994,6 +3088,7 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] @@ -3090,7 +3185,18 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" dependencies = [ - "ff", + "ff 0.12.1", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff 0.13.0", "rand_core 0.6.4", "subtle", ] @@ -3222,6 +3328,12 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + [[package]] name = "hkdf" version = "0.12.3" @@ -3781,13 +3893,14 @@ dependencies = [ [[package]] name = "k256" -version = "0.11.6" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" +checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" dependencies = [ "cfg-if", - "ecdsa", - "elliptic-curve", + "ecdsa 0.16.8", + "elliptic-curve 0.13.6", + "once_cell", "sha2 0.10.8", ] @@ -3821,9 +3934,9 @@ dependencies = [ [[package]] name = "kvdb-rocksdb" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2182b8219fee6bd83aacaab7344e840179ae079d5216aa4e249b4d704646a844" +checksum = "fe7a749456510c45f795e8b04a6a3e0976d0139213ecbf465843830ad55e2217" dependencies = [ "kvdb", "num_cpus", @@ -3929,7 +4042,7 @@ dependencies = [ "prost-build", "rand 0.8.5", "rw-stream-sink", - "sec1", + "sec1 0.3.0", "sha2 0.10.8", "smallvec", "thiserror", @@ -4325,9 +4438,9 @@ dependencies = [ [[package]] name = "librocksdb-sys" -version = "0.8.3+7.4.4" +version = "0.10.0+7.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "557b255ff04123fcc176162f56ed0c9cd42d8f357cf55b3fabeb60f7413741b3" +checksum = "0fe4d5874f5ff2bc616e55e8c6086d478fcda13faf9495768a4aa1c22042d30b" dependencies = [ "bindgen", "bzip2-sys", @@ -4534,7 +4647,7 @@ dependencies = [ "serde", "serde_json", "syn 1.0.109", - "toml", + "toml 0.5.11", ] [[package]] @@ -5001,23 +5114,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-bigint-dig" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" -dependencies = [ - "byteorder", - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand 0.8.5", - "smallvec", - "zeroize", -] - [[package]] name = "num-complex" version = "0.4.4" @@ -5077,7 +5173,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", - "libm", ] [[package]] @@ -5096,7 +5191,16 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" dependencies = [ - "num_enum_derive", + "num_enum_derive 0.5.11", +] + +[[package]] +name = "num_enum" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" +dependencies = [ + "num_enum_derive 0.6.1", ] [[package]] @@ -5105,12 +5209,23 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" dependencies = [ - "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "num_enum_derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.38", +] + [[package]] name = "object" version = "0.29.0" @@ -5212,20 +5327,14 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "os_str_bytes" -version = "6.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" - [[package]] name = "p256" version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" dependencies = [ - "ecdsa", - "elliptic-curve", + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", "sha2 0.10.8", ] @@ -5235,15 +5344,15 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" dependencies = [ - "ecdsa", - "elliptic-curve", + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", "sha2 0.10.8", ] [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -5259,7 +5368,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -5273,7 +5382,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5286,7 +5395,7 @@ dependencies = [ "scale-info", "sp-application-crypto", "sp-consensus-babe", - "sp-consensus-vrf", + "sp-core", "sp-io", "sp-runtime", "sp-session", @@ -5297,7 +5406,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5312,7 +5421,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "fp-evm", "frame-support", @@ -5326,7 +5435,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -5345,7 +5454,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", "binary-merkle-tree", @@ -5369,7 +5478,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5456,7 +5565,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "ethereum", "ethereum-types", @@ -5479,7 +5588,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "environmental", "evm", @@ -5489,7 +5598,7 @@ dependencies = [ "frame-support", "frame-system", "hex", - "hex-literal", + "hex-literal 0.4.1", "impl-trait-for-tuples", "log", "parity-scale-codec", @@ -5504,7 +5613,7 @@ dependencies = [ [[package]] name = "pallet-evm-chain-id" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "frame-support", "frame-system", @@ -5515,7 +5624,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-blake2" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "fp-evm", ] @@ -5523,7 +5632,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-bn128" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "fp-evm", "sp-core", @@ -5533,7 +5642,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "fp-evm", "num", @@ -5542,7 +5651,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-sha3fips" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "fp-evm", "tiny-keccak", @@ -5551,7 +5660,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "fp-evm", "ripemd", @@ -5577,7 +5686,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5600,7 +5709,7 @@ dependencies = [ [[package]] name = "pallet-hotfix-sufficients" version = "1.0.0" -source = "git+https://github.com/paritytech/frontier?branch=fpt/polkadot-v0.9.40#bd31ad29a71439c398bd1801696ebd8f2eadfb78" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5616,7 +5725,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5647,7 +5756,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -5698,7 +5807,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -5728,7 +5837,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5746,7 +5855,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -5762,7 +5871,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5778,7 +5887,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -6083,15 +6192,6 @@ dependencies = [ "base64ct", ] -[[package]] -name = "pem-rfc7468" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" -dependencies = [ - "base64ct", -] - [[package]] name = "percent-encoding" version = "2.3.0" @@ -6191,17 +6291,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkcs1" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" -dependencies = [ - "der 0.7.8", - "pkcs8 0.10.2", - "spki 0.7.2", -] - [[package]] name = "pkcs8" version = "0.9.0" @@ -6345,10 +6434,10 @@ dependencies = [ "fp-evm", "frame-support", "frame-system", - "hex-literal", + "hex-literal 0.3.4", "libsecp256k1", "log", - "num_enum", + "num_enum 0.5.11", "pallet-balances", "pallet-erc20-manager", "pallet-evm", @@ -6377,10 +6466,10 @@ dependencies = [ "fp-evm", "frame-support", "frame-system", - "hex-literal", + "hex-literal 0.3.4", "libsecp256k1", "log", - "num_enum", + "num_enum 0.5.11", "pallet-balances", "pallet-evm", "pallet-supported-tokens-manager", @@ -6434,10 +6523,10 @@ dependencies = [ "frame-support", "frame-system", "hex", - "hex-literal", + "hex-literal 0.4.1", "impl-trait-for-tuples", "log", - "num_enum", + "num_enum 0.5.11", "pallet-evm", "parity-scale-codec", "paste", @@ -6460,7 +6549,7 @@ dependencies = [ "fp-evm", "frame-support", "macrotest", - "num_enum", + "num_enum 0.5.11", "precompile-utils", "prettyplease", "proc-macro2", @@ -6506,10 +6595,10 @@ dependencies = [ "fp-evm", "frame-support", "frame-system", - "hex-literal", + "hex-literal 0.3.4", "libsecp256k1", "log", - "num_enum", + "num_enum 0.5.11", "pallet-balances", "pallet-evm", "pallet-session", @@ -6592,7 +6681,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" dependencies = [ "thiserror", - "toml", + "toml 0.5.11", ] [[package]] @@ -6619,6 +6708,17 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-warning" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e99670bafb56b9a106419397343bdbc8b8742c3cc449fec6345f86173f47cd4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + [[package]] name = "proc-macro2" version = "1.0.69" @@ -7111,11 +7211,21 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" dependencies = [ - "crypto-bigint", + "crypto-bigint 0.4.9", "hmac 0.12.1", "zeroize", ] +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac 0.12.1", + "subtle", +] + [[package]] name = "ring" version = "0.16.20" @@ -7178,9 +7288,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.19.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9562ea1d70c0cc63a34a22d977753b50cca91cc6b6527750463bd5dd8697bc" +checksum = "015439787fce1e75d55f279078d33ff14b4af5d93d995e8838ee4631301c8a99" dependencies = [ "libc", "librocksdb-sys", @@ -7197,28 +7307,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "rsa" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ab43bb47d23c1a631b4b680199a45255dce26fa9ab2fa902581f624ff13e6a8" -dependencies = [ - "byteorder", - "const-oid", - "digest 0.10.7", - "num-bigint-dig", - "num-integer", - "num-iter", - "num-traits", - "pkcs1", - "pkcs8 0.10.2", - "rand_core 0.6.4", - "signature 2.1.0", - "spki 0.7.2", - "subtle", - "zeroize", -] - [[package]] name = "rtcp" version = "0.7.2" @@ -7465,7 +7553,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "log", "sp-core", @@ -7476,7 +7564,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -7491,7 +7579,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "memmap2", "sc-chain-spec-derive", @@ -7510,18 +7598,18 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.38", ] [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", "chrono", @@ -7561,7 +7649,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "fnv", "futures", @@ -7587,7 +7675,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "hash-db 0.16.0", "kvdb", @@ -7613,7 +7701,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "futures", @@ -7638,7 +7726,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "futures", @@ -7667,13 +7755,12 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "fork-tree", "futures", "log", - "merlin", "num-bigint", "num-rational", "num-traits", @@ -7686,7 +7773,6 @@ dependencies = [ "sc-keystore", "sc-telemetry", "scale-info", - "schnorrkel", "sp-api", "sp-application-crypto", "sp-block-builder", @@ -7694,7 +7780,6 @@ dependencies = [ "sp-consensus", "sp-consensus-babe", "sp-consensus-slots", - "sp-consensus-vrf", "sp-core", "sp-inherents", "sp-keystore", @@ -7706,7 +7791,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "fork-tree", "parity-scale-codec", @@ -7719,7 +7804,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "ahash 0.8.3", "array-bytes", @@ -7759,7 +7844,7 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "assert_matches", "async-trait", @@ -7793,7 +7878,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "futures", @@ -7816,7 +7901,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "lru", "parity-scale-codec", @@ -7840,7 +7925,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -7853,7 +7938,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "log", "sc-allocator", @@ -7866,7 +7951,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "anyhow", "cfg-if", @@ -7884,7 +7969,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "ansi_term", "futures", @@ -7900,7 +7985,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", "async-trait", @@ -7915,7 +8000,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", "async-channel", @@ -7945,6 +8030,7 @@ dependencies = [ "serde", "serde_json", "smallvec", + "snow", "sp-arithmetic", "sp-blockchain", "sp-consensus", @@ -7959,7 +8045,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "cid", "futures", @@ -7979,7 +8065,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", "async-trait", @@ -8007,7 +8093,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "ahash 0.8.3", "futures", @@ -8026,7 +8112,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", "futures", @@ -8048,7 +8134,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", "async-trait", @@ -8082,7 +8168,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", "futures", @@ -8102,7 +8188,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", "bytes", @@ -8133,7 +8219,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "futures", "libp2p", @@ -8146,7 +8232,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -8155,7 +8241,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "futures", "jsonrpsee", @@ -8185,7 +8271,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -8204,7 +8290,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "http", "jsonrpsee", @@ -8219,7 +8305,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", "futures", @@ -8245,7 +8331,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "directories", @@ -8311,7 +8397,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "log", "parity-scale-codec", @@ -8322,7 +8408,7 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "clap", "fs4", @@ -8338,7 +8424,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "futures", "libc", @@ -8357,7 +8443,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "chrono", "futures", @@ -8376,7 +8462,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "ansi_term", "atty", @@ -8407,18 +8493,18 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.38", ] [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "futures", @@ -8445,7 +8531,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "futures", @@ -8459,7 +8545,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-channel", "futures", @@ -8585,7 +8671,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" dependencies = [ - "base16ct", + "base16ct 0.1.1", "der 0.6.1", "generic-array 0.14.7", "pkcs8 0.9.0", @@ -8593,6 +8679,20 @@ dependencies = [ "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.8", + "generic-array 0.14.7", + "pkcs8 0.10.2", + "subtle", + "zeroize", +] + [[package]] name = "secp256k1" version = "0.24.3" @@ -8698,6 +8798,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -8971,13 +9080,15 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "hash-db 0.16.0", "log", "parity-scale-codec", + "scale-info", "sp-api-proc-macro", "sp-core", + "sp-metadata-ir", "sp-runtime", "sp-state-machine", "sp-std", @@ -8989,7 +9100,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "Inflector", "blake2", @@ -8997,13 +9108,13 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.38", ] [[package]] name = "sp-application-crypto" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "scale-info", @@ -9016,7 +9127,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "integer-sqrt", "num-traits", @@ -9030,7 +9141,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "sp-api", @@ -9042,7 +9153,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "futures", "log", @@ -9060,7 +9171,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "futures", @@ -9075,7 +9186,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "parity-scale-codec", @@ -9093,10 +9204,9 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", - "merlin", "parity-scale-codec", "scale-info", "serde", @@ -9104,7 +9214,6 @@ dependencies = [ "sp-application-crypto", "sp-consensus", "sp-consensus-slots", - "sp-consensus-vrf", "sp-core", "sp-inherents", "sp-keystore", @@ -9116,7 +9225,7 @@ dependencies = [ [[package]] name = "sp-consensus-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "lazy_static", "parity-scale-codec", @@ -9135,7 +9244,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "finality-grandpa", "log", @@ -9153,7 +9262,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "scale-info", @@ -9162,29 +9271,16 @@ dependencies = [ "sp-timestamp", ] -[[package]] -name = "sp-consensus-vrf" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" -dependencies = [ - "parity-scale-codec", - "scale-info", - "schnorrkel", - "sp-core", - "sp-runtime", - "sp-std", -] - [[package]] name = "sp-core" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", - "base58", "bitflags 1.3.2", "blake2", "bounded-collections", + "bs58", "dyn-clonable", "ed25519-zebra", "futures", @@ -9197,6 +9293,7 @@ dependencies = [ "merlin", "parity-scale-codec", "parking_lot 0.12.1", + "paste", "primitive-types", "rand 0.8.5", "regex", @@ -9221,7 +9318,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "blake2b_simd", "byteorder", @@ -9235,18 +9332,18 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "proc-macro2", "quote", "sp-core-hashing", - "syn 1.0.109", + "syn 2.0.38", ] [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -9255,17 +9352,17 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.38", ] [[package]] name = "sp-externalities" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "environmental", "parity-scale-codec", @@ -9276,7 +9373,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -9291,7 +9388,7 @@ dependencies = [ [[package]] name = "sp-io" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "bytes", "ed25519 1.5.3", @@ -9300,6 +9397,7 @@ dependencies = [ "libsecp256k1", "log", "parity-scale-codec", + "rustversion", "secp256k1", "sp-core", "sp-externalities", @@ -9316,7 +9414,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "lazy_static", "sp-core", @@ -9327,14 +9425,11 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ - "async-trait", "futures", - "merlin", "parity-scale-codec", "parking_lot 0.12.1", - "schnorrkel", "serde", "sp-core", "sp-externalities", @@ -9344,16 +9439,27 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "thiserror", - "zstd", + "zstd 0.12.4", +] + +[[package]] +name = "sp-metadata-ir" +version = "0.1.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "frame-metadata", + "parity-scale-codec", + "scale-info", + "sp-std", ] [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -9371,7 +9477,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "sp-api", "sp-core", @@ -9381,7 +9487,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "backtrace", "lazy_static", @@ -9391,7 +9497,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "rustc-hash", "serde", @@ -9401,7 +9507,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "either", "hash256-std-hasher", @@ -9423,7 +9529,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -9441,19 +9547,19 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "Inflector", "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.38", ] [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "scale-info", @@ -9467,10 +9573,11 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "scale-info", + "serde", "sp-core", "sp-runtime", "sp-std", @@ -9479,7 +9586,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "hash-db 0.16.0", "log", @@ -9499,12 +9606,12 @@ dependencies = [ [[package]] name = "sp-std" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" [[package]] name = "sp-storage" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9517,7 +9624,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "futures-timer", @@ -9532,7 +9639,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "sp-std", @@ -9544,7 +9651,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "sp-api", "sp-runtime", @@ -9553,7 +9660,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "log", @@ -9569,11 +9676,11 @@ dependencies = [ [[package]] name = "sp-trie" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "ahash 0.8.3", "hash-db 0.16.0", - "hashbrown 0.12.3", + "hashbrown 0.13.2", "lazy_static", "memory-db", "nohash-hasher", @@ -9592,7 +9699,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9609,18 +9716,18 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.38", ] [[package]] name = "sp-wasm-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -9634,7 +9741,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "scale-info", @@ -9700,8 +9807,6 @@ checksum = "0e50c216e3624ec8e7ecd14c6a6a6370aad6ee5d8cfc3ab30b5162eeeef2ed33" dependencies = [ "sqlx-core", "sqlx-macros", - "sqlx-mysql", - "sqlx-postgres", "sqlx-sqlite", ] @@ -9735,7 +9840,6 @@ dependencies = [ "paste", "percent-encoding", "serde", - "serde_json", "sha2 0.10.8", "smallvec", "sqlformat", @@ -9776,7 +9880,6 @@ dependencies = [ "serde_json", "sha2 0.10.8", "sqlx-core", - "sqlx-mysql", "sqlx-sqlite", "syn 1.0.109", "tempfile", @@ -9784,87 +9887,6 @@ dependencies = [ "url", ] -[[package]] -name = "sqlx-mysql" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864b869fdf56263f4c95c45483191ea0af340f9f3e3e7b4d57a61c7c87a970db" -dependencies = [ - "atoi", - "base64 0.21.4", - "bitflags 2.4.1", - "byteorder", - "bytes", - "crc", - "digest 0.10.7", - "dotenvy", - "either", - "futures-channel", - "futures-core", - "futures-io", - "futures-util", - "generic-array 0.14.7", - "hex", - "hkdf", - "hmac 0.12.1", - "itoa", - "log", - "md-5", - "memchr", - "once_cell", - "percent-encoding", - "rand 0.8.5", - "rsa", - "serde", - "sha1", - "sha2 0.10.8", - "smallvec", - "sqlx-core", - "stringprep", - "thiserror", - "tracing", - "whoami", -] - -[[package]] -name = "sqlx-postgres" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb7ae0e6a97fb3ba33b23ac2671a5ce6e3cabe003f451abd5a56e7951d975624" -dependencies = [ - "atoi", - "base64 0.21.4", - "bitflags 2.4.1", - "byteorder", - "crc", - "dotenvy", - "etcetera", - "futures-channel", - "futures-core", - "futures-io", - "futures-util", - "hex", - "hkdf", - "hmac 0.12.1", - "home", - "itoa", - "log", - "md-5", - "memchr", - "once_cell", - "rand 0.8.5", - "serde", - "serde_json", - "sha1", - "sha2 0.10.8", - "smallvec", - "sqlx-core", - "stringprep", - "thiserror", - "tracing", - "whoami", -] - [[package]] name = "sqlx-sqlite" version = "0.7.2" @@ -9924,7 +9946,7 @@ dependencies = [ "frame-system", "frame-system-rpc-runtime-api", "futures", - "hex-literal", + "hex-literal 0.4.1", "jsonrpsee", "log", "pallet-transaction-payment", @@ -10357,17 +10379,6 @@ dependencies = [ "stbl-tools", ] -[[package]] -name = "stringprep" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" -dependencies = [ - "finl_unicode", - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "strsim" version = "0.10.0" @@ -10444,7 +10455,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "platforms 2.0.0", ] @@ -10452,7 +10463,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -10471,7 +10482,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "hyper", "log", @@ -10483,7 +10494,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", "async-trait", @@ -10509,7 +10520,7 @@ dependencies = [ [[package]] name = "substrate-test-runtime" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "cfg-if", "frame-support", @@ -10552,7 +10563,7 @@ dependencies = [ [[package]] name = "substrate-test-runtime-client" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "futures", "parity-scale-codec", @@ -10572,7 +10583,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "ansi_term", "build-helper", @@ -10581,7 +10592,7 @@ dependencies = [ "sp-maybe-compressed-blob", "strum", "tempfile", - "toml", + "toml 0.7.8", "walkdir", "wasm-opt", ] @@ -10920,6 +10931,40 @@ dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.0.2", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + [[package]] name = "tower" version = "0.4.13" @@ -11308,6 +11353,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "uuid" version = "1.5.0" @@ -11614,9 +11665,9 @@ dependencies = [ "rustix 0.36.16", "serde", "sha2 0.10.8", - "toml", + "toml 0.5.11", "windows-sys 0.42.0", - "zstd", + "zstd 0.11.2+zstd.1.5.2", ] [[package]] @@ -11851,7 +11902,7 @@ dependencies = [ "ccm", "curve25519-dalek 3.2.0", "der-parser 8.2.0", - "elliptic-curve", + "elliptic-curve 0.12.3", "hkdf", "hmac 0.12.1", "log", @@ -11862,7 +11913,7 @@ dependencies = [ "rcgen 0.10.0", "ring 0.16.20", "rustls 0.19.1", - "sec1", + "sec1 0.3.0", "serde", "sha1", "sha2 0.10.8", @@ -12000,12 +12051,6 @@ dependencies = [ "rustix 0.38.19", ] -[[package]] -name = "whoami" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" - [[package]] name = "wide" version = "0.7.13" @@ -12219,6 +12264,15 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "winnow" +version = "0.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.50.0" @@ -12300,8 +12354,8 @@ dependencies = [ [[package]] name = "xcm" -version = "0.9.40" -source = "git+https://github.com/paritytech/polkadot?tag=v0.9.40#a2b62fb872ba22622aaf8e13f9dcd9a4adcc454f" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?tag=v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" dependencies = [ "bounded-collections", "derivative", @@ -12315,13 +12369,13 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "0.9.40" -source = "git+https://github.com/paritytech/polkadot?tag=v0.9.40#a2b62fb872ba22622aaf8e13f9dcd9a4adcc454f" +version = "0.9.42" +source = "git+https://github.com/paritytech/polkadot?tag=v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.38", ] [[package]] @@ -12373,7 +12427,16 @@ version = "0.11.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" dependencies = [ - "zstd-safe", + "zstd-safe 5.0.2+zstd.1.5.2", +] + +[[package]] +name = "zstd" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +dependencies = [ + "zstd-safe 6.0.6", ] [[package]] @@ -12386,6 +12449,16 @@ dependencies = [ "zstd-sys", ] +[[package]] +name = "zstd-safe" +version = "6.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +dependencies = [ + "libc", + "zstd-sys", +] + [[package]] name = "zstd-sys" version = "2.0.9+zstd.1.5.5" diff --git a/Cargo.toml b/Cargo.toml index 03826107..fdf02da0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,6 +50,7 @@ repository = "https://github.com/stabilityprotocol/stability/" [workspace.dependencies] +clap = { version = "4.3", features = ["derive", "deprecated"] } affix = "0.1.2" derive_more = "0.99" impl-trait-for-tuples = "0.2.1" @@ -60,19 +61,19 @@ bn = { package = "substrate-bn", version = "0.6", default-features = false } environmental = { version = "1.1.4", default-features = false } ethereum = { version = "0.14.0", default-features = false } ethereum-types = { version = "0.14.1", default-features = false } -evm = { version = "0.39.0", default-features = false } +evm = { git = "https://github.com/rust-blockchain/evm", rev = "b7b82c7e1fc57b7449d6dfa6826600de37cc1e65", default-features = false } jsonrpsee = "0.16.2" -kvdb-rocksdb = "0.17.0" +kvdb-rocksdb = "0.18.0" libsecp256k1 = { version = "0.7.1", default-features = false } -hex = { version = "0.4.3", default-features = false } -parity-db = "0.4.6" +hex = { version = "0.4.3", default-features = false, features = ["alloc"] } +parity-db = "0.4.8" rlp = { version = "0.5", default-features = false } scale-codec = { package = "parity-scale-codec", version = "3.2.1", default-features = false, features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } serde = { version = "1.0.101", default-features = false } serde_json = "1.0" -futures = "0.3.21" +futures = "0.3.28" futures-timer = "3.0.1" log = "0.4.17" parking_lot = "0.12.1" @@ -83,122 +84,124 @@ cfg-if = "1.0" memory-db = { version = "0.32.0", default-features = false } trie-db = { version = "0.27.0", default-features = false } once_cell = "1.17.1" -hex-literal = "0.3.4" +hex-literal = "0.4.1" syn = "1.0.98" -sqlx = "0.7.0-alpha.3" +sqlx = { version = "0.7.0-alpha.3", default-features = false, features = ["macros"] } +thiserror = "1.0" +tokio = "1.28.2" # Polkadot -xcm = { git = "https://github.com/paritytech/polkadot", tag = "v0.9.40", default-features = false } +xcm = { git = "https://github.com/paritytech/polkadot", tag = "v0.9.42", default-features = false } # Substrate Client -sc-block-builder = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sc-chain-spec = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sc-client-db = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sc-consensus-manual-seal = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sc-consensus-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sc-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sc-network-common = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sc-network-sync = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sc-proposer-metrics = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"} -sc-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-block-builder = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-chain-spec = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-client-db = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-consensus-manual-seal = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-consensus-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-network-common = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-network-sync = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-proposer-metrics = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"} +sc-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } # Substrate Primitive -sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sp-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-consensus-beefy = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-core = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-database = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sp-consensus-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-io = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-keyring = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sp-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-runtime = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-state-machine = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-std = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-storage = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-trie = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-version = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-keystore = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -beefy-primitives = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", package = "sp-beefy", branch = "polkadot-v0.9.40" } -sp-application-crypto = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sp-consensus-babe = { version = "0.10.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sp-externalities = { version = "0.13.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sp-runtime-interface = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-consensus-beefy = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-core = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-database = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-consensus-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-io = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-keyring = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-runtime = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-state-machine = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-std = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-storage = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-trie = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-version = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-keystore = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +beefy-primitives = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", package = "sp-beefy", branch = "polkadot-v0.9.42" } +sp-application-crypto = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-consensus-babe = { version = "0.10.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-externalities = { version = "0.13.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-runtime-interface = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } # Substrate FRAME -frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -frame-executive = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -frame-system-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -frame-system-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -pallet-aura = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -pallet-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -pallet-sudo = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -pallet-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -pallet-transaction-payment = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -pallet-transaction-payment-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -pallet-utility = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -pallet-collective = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -pallet-babe = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -pallet-beefy-mmr = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -pallet-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-executive = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-system-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-system-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +pallet-aura = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +pallet-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +pallet-sudo = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +pallet-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +pallet-transaction-payment = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +pallet-transaction-payment-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +pallet-utility = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +pallet-collective = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +pallet-babe = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +pallet-beefy-mmr = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +pallet-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } # Substrate Utility -frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } -sp-staking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-staking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } # Frontier Client -fc-cli = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40" } -fc-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40" } -fc-db = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40" } -fc-mapping-sync = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40" } -fc-rpc = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40" } -fc-rpc-core = { version = "1.1.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40" } -fc-storage = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40" } +fc-cli = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } +fc-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42" } +fc-db = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } +fc-mapping-sync = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42" } +fc-rpc = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42" } +fc-rpc-core = { version = "1.1.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42" } +fc-storage = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42" } # Frontier Primitive -fp-account = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } -fp-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } -fp-ethereum = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } -fp-evm = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } -fp-rpc = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } -fp-self-contained = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } -fp-storage = { version = "2.0.0", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } +fp-account = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } +fp-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } +fp-ethereum = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } +fp-evm = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } +fp-rpc = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } +fp-self-contained = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } +fp-storage = { version = "2.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } # Frontier FRAME -pallet-base-fee = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } -pallet-ethereum = { version = "4.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } -pallet-evm = { version = "6.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } -pallet-evm-chain-id = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } -pallet-evm-precompile-modexp = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } -pallet-evm-precompile-sha3fips = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } -pallet-evm-precompile-simple = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } -pallet-evm-test-vector-support = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } -pallet-hotfix-sufficients = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } +pallet-base-fee = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } +pallet-ethereum = { version = "4.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } +pallet-evm = { version = "6.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } +pallet-evm-chain-id = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } +pallet-evm-precompile-modexp = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } +pallet-evm-precompile-sha3fips = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } +pallet-evm-precompile-simple = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } +pallet-evm-test-vector-support = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } +pallet-hotfix-sufficients = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } # Stability Client stbl-cli-authorship = { version = "1.0.0", path = './client/authorship' } # Stability -pallet-evm-precompile-blake2 = { git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } -pallet-evm-precompile-bn128 = { git = "https://github.com/paritytech/frontier", branch = "fpt/polkadot-v0.9.40", default-features = false } +pallet-evm-precompile-blake2 = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } +pallet-evm-precompile-bn128 = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } precompile-utils = { path = "./precompiles/utils", default-features = false } precompile-fee-token-selector = { path = "./precompiles/token-fee-controller/fee-token-selector", default-features = false } precompile-validator-fee-selector = { path = "./precompiles/token-fee-controller/validator-fee-selector", default-features = false } diff --git a/client/authorship/src/authorship.rs b/client/authorship/src/authorship.rs index 358876a0..ebd192d8 100644 --- a/client/authorship/src/authorship.rs +++ b/client/authorship/src/authorship.rs @@ -48,7 +48,7 @@ use std::{marker::PhantomData, pin::Pin, sync::Arc, time}; use prometheus_endpoint::Registry as PrometheusRegistry; use sc_proposer_metrics::{EndProposingReason, MetricsLink as PrometheusMetrics}; use sp_core::crypto::KeyTypeId; -use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr}; +use sp_keystore::{Keystore, KeystorePtr}; use stbl_primitives_fee_compatible_api::CompatibleFeeApi; /// Default block size limit in bytes used by [`Proposer`]. @@ -77,7 +77,7 @@ pub struct ProposerFactory { transaction_pool: Arc, /// Reference to Keystore - keystore: SyncCryptoStorePtr, + keystore: KeystorePtr, /// HTTP URL of the private pool from which the node will retrieve zero-gas transactions zero_gas_tx_pool: Option, @@ -113,7 +113,7 @@ impl ProposerFactory { spawn_handle: impl SpawnNamed + 'static, client: Arc, transaction_pool: Arc, - keystore: SyncCryptoStorePtr, + keystore: KeystorePtr, zero_gas_tx_pool: Option, prometheus: Option<&PrometheusRegistry>, telemetry: Option, @@ -145,7 +145,7 @@ impl ProposerFactory { spawn_handle: impl SpawnNamed + 'static, client: Arc, transaction_pool: Arc, - keystore: SyncCryptoStorePtr, + keystore: KeystorePtr, zero_gas_tx_pool: Option, prometheus: Option<&PrometheusRegistry>, telemetry: Option, @@ -282,7 +282,7 @@ pub struct Proposer { parent_hash: Block::Hash, parent_number: <::Header as HeaderT>::Number, transaction_pool: Arc, - keystore: SyncCryptoStorePtr, + keystore: KeystorePtr, zero_gas_tx_pool: Option, now: Box time::Instant + Send + Sync>, metrics: PrometheusMetrics, @@ -510,7 +510,7 @@ where let ethereum_transaction: ethereum::TransactionV2 = ethereum::EnvelopedDecodable::decode(&pending_raw_tx).unwrap(); - let keys = SyncCryptoStore::ecdsa_public_keys( + let keys = Keystore::ecdsa_public_keys( &*self.keystore, KeyTypeId::try_from("aura").unwrap_or_default(), ); @@ -527,7 +527,7 @@ where let eip191_message = stbl_tools::eth::build_eip191_message_hash(message.clone()); - let signed_hash_option = SyncCryptoStore::ecdsa_sign_prehashed( + let signed_hash_option = Keystore::ecdsa_sign_prehashed( &*self.keystore, KeyTypeId::try_from("aura").unwrap_or_default(), &public, @@ -626,7 +626,7 @@ where }; - let keys = SyncCryptoStore::ecdsa_public_keys( + let keys = Keystore::ecdsa_public_keys( &*self.keystore, KeyTypeId::try_from("aura").unwrap_or_default(), ); @@ -892,7 +892,7 @@ mod tests { let keystore_config = sc_service::config::KeystoreConfig::InMemory; let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); - SyncCryptoStore::ecdsa_generate_new( + Keystore::ecdsa_generate_new( &*keystore_container.sync_keystore().clone(), KeyTypeId::try_from("aura").unwrap(), Some("//Alice"), @@ -955,7 +955,7 @@ mod tests { let keystore_config = sc_service::config::KeystoreConfig::InMemory; let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); - SyncCryptoStore::ecdsa_generate_new( + Keystore::ecdsa_generate_new( &*keystore_container.sync_keystore().clone(), KeyTypeId::try_from("aura").unwrap(), Some("//Alice"), @@ -1024,7 +1024,7 @@ mod tests { let keystore_config = sc_service::config::KeystoreConfig::InMemory; let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); - SyncCryptoStore::ecdsa_generate_new( + Keystore::ecdsa_generate_new( &*keystore_container.sync_keystore().clone(), KeyTypeId::try_from("aura").unwrap(), Some("//Alice"), @@ -1111,7 +1111,7 @@ mod tests { let keystore_config = sc_service::config::KeystoreConfig::InMemory; let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); - SyncCryptoStore::ecdsa_generate_new( + Keystore::ecdsa_generate_new( &*keystore_container.sync_keystore().clone(), KeyTypeId::try_from("aura").unwrap(), Some("//Alice"), @@ -1226,7 +1226,7 @@ mod tests { let keystore_config = sc_service::config::KeystoreConfig::InMemory; let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); - SyncCryptoStore::ecdsa_generate_new( + Keystore::ecdsa_generate_new( &*keystore_container.sync_keystore().clone(), KeyTypeId::try_from("aura").unwrap(), Some("//Alice"), @@ -1340,7 +1340,7 @@ mod tests { let keystore_config = sc_service::config::KeystoreConfig::InMemory; let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); - SyncCryptoStore::ecdsa_generate_new( + Keystore::ecdsa_generate_new( &*keystore_container.sync_keystore().clone(), KeyTypeId::try_from("aura").unwrap(), Some("//Alice"), @@ -1425,7 +1425,7 @@ mod tests { let keystore_config = sc_service::config::KeystoreConfig::InMemory; let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); - SyncCryptoStore::ecdsa_generate_new( + Keystore::ecdsa_generate_new( &*keystore_container.sync_keystore().clone(), KeyTypeId::try_from("aura").unwrap(), Some("//Alice"), @@ -1503,7 +1503,7 @@ mod tests { let keystore_config = sc_service::config::KeystoreConfig::InMemory; let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); - SyncCryptoStore::ecdsa_generate_new( + Keystore::ecdsa_generate_new( &*keystore_container.sync_keystore().clone(), KeyTypeId::try_from("aura").unwrap(), Some("//Alice"), diff --git a/node/Cargo.toml b/node/Cargo.toml index 7d8a70fb..426fffcc 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -13,12 +13,12 @@ repository = { workspace = true } targets = ["x86_64-unknown-linux-gnu"] [dependencies] -async-trait = "0.1" -clap = { version = "4.1", features = ["derive", "deprecated"] } -futures = "0.3.25" +async-trait = { workspace = true } +clap = { workspace = true } +futures = { workspace = true } hex-literal = { workspace = true } jsonrpsee = { workspace = true, features = ["server", "macros"] } -log = "0.4.17" +log = { workspace = true } scale-codec = { package = "parity-scale-codec", workspace = true } serde = { workspace = true } @@ -79,7 +79,7 @@ fp-account = { workspace = true } fp-evm = { workspace = true, features = ["default"] } fp-rpc = { workspace = true, features = ["default"] } fc-storage = { workspace = true } -stability-runtime = { path = "./../runtime", features = ["default"] } +stability-runtime = { path = "./../runtime", features = ["std"] } # Stability stbl-cli-authorship = { workspace = true } @@ -95,7 +95,23 @@ stbl-tools = { workspace = true } substrate-build-script-utils = { workspace = true } [features] -default = ["with-rocksdb-weights"] +default = [ + "with-rocksdb-weights", + "rocksdb", + "sql", +] +rocksdb = [ + "sc-cli/rocksdb", + "sc-service/rocksdb", + "fc-cli/rocksdb", + "fc-db/rocksdb", + "fc-mapping-sync/rocksdb", + "fc-rpc/rocksdb", +] +sql = [ + "fc-db/sql", + "fc-mapping-sync/sql", +] with-rocksdb-weights = ["stability-runtime/with-rocksdb-weights"] with-paritydb-weights = ["stability-runtime/with-paritydb-weights"] rpc-binary-search-estimate = ["fc-rpc/rpc-binary-search-estimate"] diff --git a/node/src/cli.rs b/node/src/cli.rs index 9956c702..4c94afed 100644 --- a/node/src/cli.rs +++ b/node/src/cli.rs @@ -2,19 +2,15 @@ use crate::service::EthConfiguration; use crate::stability::StabilityConfiguration; /// Available Sealing methods. -#[derive(Debug, Copy, Clone, clap::ValueEnum)] +#[derive(Copy, Clone, Debug, Default, clap::ValueEnum)] pub enum Sealing { // Seal using rpc method. + #[default] Manual, // Seal when transaction is executed. Instant, } -impl Default for Sealing { - fn default() -> Sealing { - Sealing::Manual - } -} #[derive(Debug, clap::Parser)] pub struct Cli { diff --git a/node/src/eth.rs b/node/src/eth.rs index 16630ce6..afd192a8 100644 --- a/node/src/eth.rs +++ b/node/src/eth.rs @@ -38,20 +38,15 @@ pub fn db_config_dir(config: &Configuration) -> PathBuf { } /// Avalailable frontier backend types. -#[derive(Debug, Copy, Clone, clap::ValueEnum)] +#[derive(Debug, Copy, Clone, Default, clap::ValueEnum)] pub enum BackendType { /// Either RocksDb or ParityDb as per inherited from the global backend settings. + #[default] KeyValue, /// Sql database with custom log indexing. Sql, } -impl Default for BackendType { - fn default() -> BackendType { - BackendType::KeyValue - } -} - /// The ethereum-compatibility configuration used to run a node. #[derive(Clone, Debug, clap::Parser)] pub struct EthConfiguration { @@ -121,8 +116,8 @@ pub fn new_frontier_partial( /// A set of APIs that ethereum-compatible runtimes must implement. pub trait EthCompatRuntimeApiCollection: sp_api::ApiExt - + fp_rpc::EthereumRuntimeRPCApi + fp_rpc::ConvertTransactionRuntimeApi + + fp_rpc::EthereumRuntimeRPCApi where >::StateBackend: sp_api::StateBackend, { @@ -131,8 +126,8 @@ where impl EthCompatRuntimeApiCollection for Api where Api: sp_api::ApiExt - + fp_rpc::EthereumRuntimeRPCApi - + fp_rpc::ConvertTransactionRuntimeApi, + + fp_rpc::ConvertTransactionRuntimeApi + + fp_rpc::EthereumRuntimeRPCApi, >::StateBackend: sp_api::StateBackend, { } diff --git a/node/src/rpc/eth.rs b/node/src/rpc/eth.rs index c14ddd25..5264cc62 100644 --- a/node/src/rpc/eth.rs +++ b/node/src/rpc/eth.rs @@ -18,7 +18,7 @@ use sp_core::H256; use sp_runtime::traits::Block as BlockT; // Frontier use fc_db::Backend as FrontierBackend; -pub use fc_rpc::{EthBlockDataCacheTask, EthConfig, OverrideHandle, StorageOverride}; +pub use fc_rpc::{EthBlockDataCacheTask, EthConfig, OverrideHandle, StorageOverride, TxPool}; pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool}; pub use fc_storage::overrides_handle; use fp_rpc::{ConvertTransaction, ConvertTransactionRuntimeApi, EthereumRuntimeRPCApi}; @@ -100,7 +100,7 @@ pub fn create_eth>( where B: BlockT, C: CallApiAt + ProvideRuntimeApi, - C::Api: BlockBuilderApi + EthereumRuntimeRPCApi + ConvertTransactionRuntimeApi, + C::Api: BlockBuilderApi + ConvertTransactionRuntimeApi + EthereumRuntimeRPCApi, C: BlockchainEvents + 'static, C: HeaderBackend + HeaderMetadata + StorageProvider, BE: Backend + 'static, @@ -110,7 +110,7 @@ where { use fc_rpc::{ Eth, EthApiServer, EthDevSigner, EthFilter, EthFilterApiServer, EthPubSub, - EthPubSubApiServer, EthSigner, Net, NetApiServer, Web3, Web3ApiServer, + EthPubSubApiServer, EthSigner, Net, NetApiServer, TxPoolApiServer, Web3, Web3ApiServer, }; let EthDeps { @@ -142,7 +142,7 @@ where Eth::new( client.clone(), pool.clone(), - graph, + graph.clone(), converter, sync.clone(), signers, @@ -159,11 +159,13 @@ where .into_rpc(), )?; + let tx_pool = TxPool::new(client.clone(), graph); if let Some(filter_pool) = filter_pool { io.merge( EthFilter::new( client.clone(), frontier_backend, + tx_pool.clone(), filter_pool, 500_usize, // max stored filters max_past_logs, @@ -196,6 +198,7 @@ where )?; io.merge(Web3::new(client).into_rpc())?; + io.merge(tx_pool.into_rpc())?; Ok(io) } diff --git a/node/src/service.rs b/node/src/service.rs index 70c06888..7d3d26a4 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -7,7 +7,7 @@ use futures::{channel::mpsc, prelude::*}; use prometheus_endpoint::Registry; use sc_client_api::{BlockBackend, StateBackendFor}; use sc_consensus::BasicQueue; -use sc_executor::{NativeElseWasmExecutor, NativeExecutionDispatch}; +use sc_executor::NativeExecutionDispatch; use sc_network_common::sync::warp::WarpSyncParams; use sc_service::{error::Error as ServiceError, Configuration, PartialComponents, TaskManager}; use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker}; @@ -96,12 +96,7 @@ where }) .transpose()?; - let executor = NativeElseWasmExecutor::::new( - config.wasm_method, - config.default_heap_pages, - config.max_runtime_instances, - config.runtime_cache_size, - ); + let executor = sc_service::new_native_or_wasm_executor(config); let (client, backend, keystore_container, task_manager) = sc_service::new_full_parts::( @@ -443,7 +438,7 @@ where client: client.clone(), backend: backend.clone(), task_manager: &mut task_manager, - keystore: keystore_container.sync_keystore(), + keystore: keystore_container.keystore(), transaction_pool: transaction_pool.clone(), rpc_builder, network: network.clone(), @@ -493,7 +488,7 @@ where task_manager.spawn_handle(), client.clone(), transaction_pool, - keystore_container.sync_keystore(), + keystore_container.keystore(), stability_config.zero_gas_tx_pool.clone(), prometheus_registry.as_ref(), telemetry.as_ref().map(|x| x.handle()), @@ -532,7 +527,7 @@ where create_inherent_data_providers, force_authoring, backoff_authoring_blocks: Option::<()>::None, - keystore: keystore_container.sync_keystore(), + keystore: keystore_container.keystore(), block_proposal_slot_portion: sc_consensus_aura::SlotProportion::new(2f32 / 3f32), max_block_proposal_slot_portion: None, telemetry: telemetry.as_ref().map(|x| x.handle()), @@ -549,7 +544,7 @@ where // if the node isn't actively participating in consensus then it doesn't // need a keystore, regardless of which protocol we use below. let keystore = if role.is_authority() { - Some(keystore_container.sync_keystore()) + Some(keystore_container.keystore()) } else { None }; @@ -619,7 +614,7 @@ where task_manager.spawn_handle(), client.clone(), transaction_pool.clone(), - keystore.sync_keystore(), + keystore.keystore(), stability_config.zero_gas_tx_pool.clone(), prometheus_registry, telemetry.as_ref().map(|x| x.handle()), diff --git a/pallets/custom-balances/src/lib.rs b/pallets/custom-balances/src/lib.rs index 5f9fbeba..ed240283 100644 --- a/pallets/custom-balances/src/lib.rs +++ b/pallets/custom-balances/src/lib.rs @@ -13,7 +13,7 @@ pub mod pallet { use core::marker::PhantomData; use codec::MaxEncodedLen; - use frame_support::traits::tokens::{DepositConsequence, WithdrawConsequence}; + use frame_support::traits::tokens::{DepositConsequence, WithdrawConsequence, Preservation, Provenance, Fortitude}; use frame_support::traits::{Imbalance, SameOrOther, TryDrop}; use frame_support::RuntimeDebug; use frame_support::{ @@ -158,7 +158,7 @@ pub mod pallet { } fn free_balance(account: &T::AccountId) -> Self::Balance { - Self::total_balance(account) + >::total_balance(account) } fn ensure_can_withdraw( @@ -167,7 +167,7 @@ pub mod pallet { _reasons: frame_support::traits::WithdrawReasons, _new_balance: Self::Balance, ) -> Result<(), sp_runtime::DispatchError> { - if Self::total_balance(who) >= amount { + if >::total_balance(who) >= amount { Ok(()) } else { Err(DispatchError::Other("Not enough balance")) @@ -261,6 +261,10 @@ pub mod pallet { >::total_issuance() } + fn total_balance(who: &T::AccountId) -> Self::Balance { + >::total_balance(who) + } + /// The minimum balance any single account may have. fn minimum_balance() -> Self::Balance { >::minimum_balance() @@ -268,12 +272,12 @@ pub mod pallet { /// Get the balance of `who`. fn balance(who: &T::AccountId) -> Self::Balance { - Self::total_balance(who) + >::total_balance(who) } /// Get the maximum amount that `who` can withdraw/transfer successfully. - fn reducible_balance(who: &T::AccountId, _keep_alive: bool) -> Self::Balance { - Self::total_balance(who) + fn reducible_balance(who: &T::AccountId, preservation: Preservation, force: Fortitude) -> Self::Balance { + >::total_balance(who) } /// Returns `true` if the balance of `who` may be increased by `amount`. @@ -284,7 +288,7 @@ pub mod pallet { fn can_deposit( _who: &T::AccountId, _amount: Self::Balance, - _mint: bool, + provenance: Provenance, ) -> DepositConsequence { DepositConsequence::UnknownAsset } @@ -297,7 +301,7 @@ pub mod pallet { ) -> WithdrawConsequence { Self::ensure_can_withdraw(_who, _amount, WithdrawReasons::all(), 0u128) .map(|_| WithdrawConsequence::Success) - .unwrap_or(WithdrawConsequence::NoFunds) + .unwrap_or(WithdrawConsequence::BalanceLow) } } } diff --git a/pallets/sponsored-transactions/src/lib.rs b/pallets/sponsored-transactions/src/lib.rs index e5bf15d7..6518f4a7 100644 --- a/pallets/sponsored-transactions/src/lib.rs +++ b/pallets/sponsored-transactions/src/lib.rs @@ -218,6 +218,8 @@ pub mod pallet { is_transactional: true, }, transaction_data.into(), + None, + None ) .validate_in_block_for(&who) .and_then(|v| v.with_chain_id()) @@ -245,6 +247,8 @@ pub mod pallet { is_transactional: true, }, transaction_data.into(), + None, + None ) .validate_in_pool_for(&who) .and_then(|v| v.with_chain_id()) diff --git a/pallets/token-fee-controller/validator-fee-selector/src/lib.rs b/pallets/token-fee-controller/validator-fee-selector/src/lib.rs index a23f663d..bc5f0e37 100644 --- a/pallets/token-fee-controller/validator-fee-selector/src/lib.rs +++ b/pallets/token-fee-controller/validator-fee-selector/src/lib.rs @@ -161,6 +161,8 @@ pub mod pallet { Default::default(), false, false, + None, + None, &pallet_evm::EvmConfig::london(), ) .map(|execution_info| { diff --git a/pallets/zero-gas-transactions/src/lib.rs b/pallets/zero-gas-transactions/src/lib.rs index 5527bcbf..0ffceb82 100644 --- a/pallets/zero-gas-transactions/src/lib.rs +++ b/pallets/zero-gas-transactions/src/lib.rs @@ -177,6 +177,8 @@ pub mod pallet { is_transactional: true, }, transaction_data.into(), + None, + None ) .validate_in_pool_for(&who) .and_then(|v| v.with_chain_id()) diff --git a/precompiles/utils/src/evm/handle.rs b/precompiles/utils/src/evm/handle.rs index a468fa9a..0b08e37c 100644 --- a/precompiles/utils/src/evm/handle.rs +++ b/precompiles/utils/src/evm/handle.rs @@ -27,6 +27,13 @@ use { }; pub trait PrecompileHandleExt: PrecompileHandle { + /// Record cost of one DB read manually. + /// The max encoded lenght of the data that will be read should be provided. + #[must_use] + fn record_db_read( + &mut self, + data_max_encoded_len: usize, + ) -> Result<(), evm::ExitError>; /// Record cost of a log manually. /// This can be useful to record log costs early when their content have static size. #[must_use] @@ -51,6 +58,15 @@ pub trait PrecompileHandleExt: PrecompileHandle { } impl PrecompileHandleExt for T { + #[must_use] + fn record_db_read( + &mut self, + data_max_encoded_len: usize, + ) -> Result<(), evm::ExitError> { + self.record_cost(crate::prelude::RuntimeHelper::::db_read_gas_cost())?; + // TODO: record ref time when precompile will be benchmarked + self.record_external_cost(None, Some(data_max_encoded_len as u64)) + } /// Record cost of a log manualy. /// This can be useful to record log costs early when their content have static size. #[must_use] @@ -178,6 +194,16 @@ mod tests { fn gas_limit(&self) -> Option { unimplemented!() } + + fn record_external_cost( + &mut self, + _ref_time: Option, + _proof_size: Option, + ) -> Result<(), fp_evm::ExitError> { + Ok(()) + } + + fn refund_external_cost(&mut self, _ref_time: Option, _proof_size: Option) {} } #[test] diff --git a/precompiles/utils/src/precompile_set.rs b/precompiles/utils/src/precompile_set.rs index f84eb862..758b5ae2 100644 --- a/precompiles/utils/src/precompile_set.rs +++ b/precompiles/utils/src/precompile_set.rs @@ -20,7 +20,7 @@ use crate::{ solidity::{codec::String, revert::revert}, - substrate::RuntimeHelper, + evm::handle::PrecompileHandleExt, EvmResult, }; use fp_evm::{ @@ -314,32 +314,41 @@ pub enum AddressType { } /// Retrieves the type of address demarcated by `AddressType`. -pub fn get_address_type(address: H160) -> AddressType { - let code_len = pallet_evm::AccountCodes::::decode_len(address).unwrap_or(0); +pub fn get_address_type( + handle: &mut impl PrecompileHandle, + address: H160, +) -> Result { + // AccountCodesMetadata: + // Blake2128(16) + H160(20) + CodeMetadata(40) + handle.record_db_read::(76)?; + let code_len = pallet_evm::Pallet::::account_code_metadata(address).size; // 0 => either EOA or precompile without dummy code if code_len == 0 { - return AddressType::EOA; + return Ok(AddressType::EOA); } // dummy code is 5 bytes long, so any other len means it is a contract. if code_len != 5 { - return AddressType::Contract; + return Ok(AddressType::Contract); } // check code matches dummy code let code = pallet_evm::AccountCodes::::get(address); if &code == &[0x60, 0x00, 0x60, 0x00, 0xfd] { - return AddressType::Precompile; + return Ok(AddressType::Precompile); } - AddressType::Unknown + Ok(AddressType::Unknown) } -fn is_address_eoa_or_precompile(address: H160) -> bool { - match get_address_type::(address) { - AddressType::EOA | AddressType::Precompile => true, - _ => false, +fn is_address_eoa_or_precompile( + handle: &mut impl PrecompileHandle, + address: H160, +) -> Result { + match get_address_type::(handle, address)? { + AddressType::EOA | AddressType::Precompile => Ok(true), + _ => Ok(false), } } @@ -368,8 +377,7 @@ fn common_checks( let callable_by_smart_contract = C::callable_by_smart_contract(caller, selector).unwrap_or(false); if !callable_by_smart_contract { - handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; - if !is_address_eoa_or_precompile::(caller) { + if !is_address_eoa_or_precompile::(handle, caller)? { return Err(revert("Function not callable by smart contracts")); } } @@ -462,6 +470,18 @@ impl<'a, H: PrecompileHandle> PrecompileHandle for RestrictiveHandle<'a, H> { fn gas_limit(&self) -> Option { self.handle.gas_limit() } + + fn record_external_cost( + &mut self, + ref_time: Option, + proof_size: Option, + ) -> Result<(), ExitError> { + self.handle.record_external_cost(ref_time, proof_size) + } + + fn refund_external_cost(&mut self, ref_time: Option, proof_size: Option) { + self.handle.refund_external_cost(ref_time, proof_size) + } } /// Allows to know if a precompile is active or not. diff --git a/precompiles/utils/src/substrate.rs b/precompiles/utils/src/substrate.rs index c0b88bb7..889369b7 100644 --- a/precompiles/utils/src/substrate.rs +++ b/precompiles/utils/src/substrate.rs @@ -24,7 +24,7 @@ use { fp_evm::{ExitError, PrecompileFailure, PrecompileHandle}, frame_support::{ dispatch::{Dispatchable, GetDispatchInfo, PostDispatchInfo}, - pallet_prelude::DispatchError, + pallet_prelude::*, traits::Get, }, pallet_evm::GasWeightMapping, @@ -57,6 +57,43 @@ where Runtime: pallet_evm::Config, Runtime::RuntimeCall: Dispatchable + GetDispatchInfo, { + #[inline(always)] + pub fn record_weight_v2_cost( + handle: &mut impl PrecompileHandle, + weight: Weight, + ) -> Result<(), ExitError> { + // Make sure there is enough gas. + let remaining_gas = handle.remaining_gas(); + let required_gas = Runtime::GasWeightMapping::weight_to_gas(weight); + if required_gas > remaining_gas { + return Err(ExitError::OutOfGas); + } + + // Make sure there is enough remaining weight + // TODO: record ref time when precompile will be benchmarked + handle.record_external_cost(None, Some(weight.proof_size())) + } + + #[inline(always)] + pub fn refund_weight_v2_cost( + handle: &mut impl PrecompileHandle, + weight: Weight, + maybe_actual_weight: Option, + ) -> Result { + // Refund weights and compute used weight them record used gas + // TODO: refund ref time when precompile will be benchmarked + let used_weight = if let Some(actual_weight) = maybe_actual_weight { + let refund_weight = weight - actual_weight; + handle.refund_external_cost(None, Some(refund_weight.proof_size())); + actual_weight + } else { + weight + }; + let used_gas = Runtime::GasWeightMapping::weight_to_gas(used_weight); + handle.record_cost(used_gas)?; + Ok(used_gas) + } + /// Try to dispatch a Substrate call. /// Return an error if there are not enough gas, or if the call fails. /// If successful returns the used gas using the Runtime GasWeightMapping. @@ -71,12 +108,9 @@ where let call = Runtime::RuntimeCall::from(call); let dispatch_info = call.get_dispatch_info(); - // Make sure there is enough gas. - let remaining_gas = handle.remaining_gas(); - let required_gas = Runtime::GasWeightMapping::weight_to_gas(dispatch_info.weight); - if required_gas > remaining_gas { - return Err(TryDispatchError::Evm(ExitError::OutOfGas)); - } + Self::record_weight_v2_cost(handle, dispatch_info.weight) + .map_err(|e| TryDispatchError::Evm(e))?; + // Dispatch call. // It may be possible to not record gas cost if the call returns Pays::No. @@ -86,13 +120,7 @@ where let post_dispatch_info = using_precompile_handle(handle, || call.dispatch(origin)) .map_err(|e| TryDispatchError::Substrate(e.error))?; - let used_weight = post_dispatch_info.actual_weight; - - let used_gas = - Runtime::GasWeightMapping::weight_to_gas(used_weight.unwrap_or(dispatch_info.weight)); - - handle - .record_cost(used_gas) + Self::record_weight_v2_cost(handle, dispatch_info.weight) .map_err(|e| TryDispatchError::Evm(e))?; Ok(post_dispatch_info) diff --git a/precompiles/utils/src/testing/handle.rs b/precompiles/utils/src/testing/handle.rs index d97ce9d1..45291410 100644 --- a/precompiles/utils/src/testing/handle.rs +++ b/precompiles/utils/src/testing/handle.rs @@ -202,4 +202,14 @@ impl PrecompileHandle for MockHandle { fn gas_limit(&self) -> Option { Some(self.gas_limit) } + + fn record_external_cost( + &mut self, + _ref_time: Option, + _proof_size: Option, + ) -> Result<(), ExitError> { + Ok(()) + } + + fn refund_external_cost(&mut self, _ref_time: Option, _proof_size: Option) {} } diff --git a/precompiles/utils/tests-external/lib.rs b/precompiles/utils/tests-external/lib.rs index 30d34135..a5b9ed25 100644 --- a/precompiles/utils/tests-external/lib.rs +++ b/precompiles/utils/tests-external/lib.rs @@ -143,6 +143,68 @@ mod tests { } } + struct MockPrecompileHandle; + impl PrecompileHandle for MockPrecompileHandle { + fn call( + &mut self, + _: sp_core::H160, + _: Option, + _: Vec, + _: Option, + _: bool, + _: &evm::Context, + ) -> (evm::ExitReason, Vec) { + unimplemented!() + } + + fn record_cost(&mut self, _: u64) -> Result<(), evm::ExitError> { + Ok(()) + } + + fn remaining_gas(&self) -> u64 { + unimplemented!() + } + + fn log( + &mut self, + _: sp_core::H160, + _: Vec, + _: Vec, + ) -> Result<(), evm::ExitError> { + unimplemented!() + } + + fn code_address(&self) -> sp_core::H160 { + unimplemented!() + } + + fn input(&self) -> &[u8] { + unimplemented!() + } + + fn context(&self) -> &evm::Context { + unimplemented!() + } + + fn is_static(&self) -> bool { + true + } + + fn gas_limit(&self) -> Option { + unimplemented!() + } + + fn record_external_cost( + &mut self, + _ref_time: Option, + _proof_size: Option, + ) -> Result<(), fp_evm::ExitError> { + Ok(()) + } + + fn refund_external_cost(&mut self, _ref_time: Option, _proof_size: Option) {} + } + pub type Precompiles = PrecompileSetBuilder< R, ( @@ -155,10 +217,16 @@ mod tests { pub type PCall = MockPrecompileCall; + const MAX_POV_SIZE: u64 = 5 * 1024 * 1024; + parameter_types! { pub BlockGasLimit: U256 = U256::max_value(); pub PrecompilesValue: Precompiles = Precompiles::new(); pub const WeightPerGas: Weight = Weight::from_parts(1, 0); + pub GasLimitPovSizeRatio: u64 = { + let block_gas_limit = BlockGasLimit::get().min(u64::MAX.into()).low_u64(); + block_gas_limit.saturating_div(MAX_POV_SIZE) + }; } impl pallet_evm::Config for Runtime { @@ -179,6 +247,9 @@ mod tests { type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); type OnCreate = (); + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; + type Timestamp = Timestamp; + type WeightInfo = pallet_evm::weights::SubstrateWeight; } parameter_types! { @@ -319,7 +390,10 @@ mod tests { fn get_address_type_works_for_eoa() { ExtBuilder::default().build().execute_with(|| { let addr = H160::repeat_byte(0x1d); - assert_eq!(AddressType::EOA, get_address_type::(addr)); + assert_eq!( + AddressType::EOA, + get_address_type::(&mut MockPrecompileHandle, addr).expect("OOG") + ); }) } @@ -328,7 +402,10 @@ mod tests { ExtBuilder::default().build().execute_with(|| { let addr = H160::repeat_byte(0x1d); pallet_evm::AccountCodes::::insert(addr, vec![0x60, 0x00, 0x60, 0x00, 0xfd]); - assert_eq!(AddressType::Precompile, get_address_type::(addr)); + assert_eq!( + AddressType::Precompile, + get_address_type::(&mut MockPrecompileHandle, addr).expect("OOG") + ); }) } @@ -342,11 +419,17 @@ mod tests { addr, vec![0x60, 0x00, 0x60, 0x00, 0xfd, 0xff, 0xff], ); - assert_eq!(AddressType::Contract, get_address_type::(addr)); + assert_eq!( + AddressType::Contract, + get_address_type::(&mut MockPrecompileHandle, addr).expect("OOG") + ); // length < 5 pallet_evm::AccountCodes::::insert(addr, vec![0x60, 0x00, 0x60]); - assert_eq!(AddressType::Contract, get_address_type::(addr)); + assert_eq!( + AddressType::Contract, + get_address_type::(&mut MockPrecompileHandle, addr).expect("OOG") + ); }) } @@ -355,7 +438,10 @@ mod tests { ExtBuilder::default().build().execute_with(|| { let addr = H160::repeat_byte(0x1d); pallet_evm::AccountCodes::::insert(addr, vec![0x11, 0x00, 0x60, 0x00, 0xfd]); - assert_eq!(AddressType::Unknown, get_address_type::(addr)); + assert_eq!( + AddressType::Unknown, + get_address_type::(&mut MockPrecompileHandle, addr).expect("OOG") + ); }) } } diff --git a/primitives/runner/src/lib.rs b/primitives/runner/src/lib.rs index f973e3e1..27fc8be3 100644 --- a/primitives/runner/src/lib.rs +++ b/primitives/runner/src/lib.rs @@ -5,18 +5,26 @@ use core::marker::PhantomData; use evm::{ backend::Backend as BackendT, executor::stack::{Accessed, StackExecutor, StackState as StackStateT, StackSubstateMetadata}, - ExitError, ExitReason, Handler, Transfer, + gasometer::{GasCost, StorageTarget}, + ExitError, ExitReason, Handler, Transfer, Opcode }; use fp_evm::{ - CallInfo, CreateInfo, ExecutionInfo, IsPrecompileResult, Log, PrecompileSet, Vicinity, + AccessedStorage, CallInfo, CreateInfo, ExecutionInfoV2, IsPrecompileResult, Log, PrecompileSet, + Vicinity, WeightInfo, ACCOUNT_BASIC_PROOF_SIZE, ACCOUNT_CODES_METADATA_PROOF_SIZE, + ACCOUNT_STORAGE_PROOF_SIZE, IS_EMPTY_CHECK_PROOF_SIZE, WRITE_PROOF_SIZE, +}; +use frame_support::{ + traits::{ + tokens::{currency::Currency, ExistenceRequirement}, + Get, Time, + }, + weights::Weight, }; -use frame_support::traits::{Currency, ExistenceRequirement, Get, Time}; use frame_support::sp_runtime::traits::UniqueSaturatedInto; -use frame_support::weights::Weight; use pallet_evm::Pallet; use pallet_evm::{ AccountCodes, AccountStorages, AddressMapping, BalanceOf, BlockHashMapping, Config, Error, - Event, FeeCalculator, Runner as RunnerT, RunnerError, OnCreate, + Event, FeeCalculator, Runner as RunnerT, RunnerError, OnCreate, AccountCodesMetadata }; use pallet_user_fee_selector::UserFeeTokenController; use precompile_utils::prelude::keccak256; @@ -63,8 +71,10 @@ where config: &'config evm::Config, precompiles: &'precompiles T::PrecompilesType, is_transactional: bool, + weight_limit: Option, + proof_size_base_cost: Option, f: F, - ) -> Result, RunnerError>> + ) -> Result, RunnerError>> where F: FnOnce( &mut StackExecutor< @@ -99,6 +109,8 @@ where f, base_fee, weight, + weight_limit, + proof_size_base_cost, ); // Set IN_EVM to false @@ -123,7 +135,9 @@ where f: F, base_fee: U256, weight: Weight, - ) -> Result, RunnerError>> + weight_limit: Option, + proof_size_base_cost: Option, + ) -> Result, RunnerError>> where F: FnOnce( &mut StackExecutor< @@ -135,25 +149,36 @@ where ) -> (ExitReason, R), R: Default, { + + // Used to record the external costs in the evm through the StackState implementation + let maybe_weight_info = + WeightInfo::new_from_weight_limit(weight_limit, proof_size_base_cost).map_err( + |_| RunnerError { + error: Error::::Undefined, + weight, + }, + )?; + // The precompile check is only used for transactional invocations. However, here we always // execute the check, because the check has side effects. - let is_precompile = match precompiles.is_precompile(source, gas_limit) { - IsPrecompileResult::Answer { - is_precompile, - extra_cost, - } => { + match precompiles.is_precompile(source, gas_limit) { + IsPrecompileResult::Answer { extra_cost, .. } => { gas_limit = gas_limit.saturating_sub(extra_cost); - is_precompile } IsPrecompileResult::OutOfGas => { - return Ok(ExecutionInfo { + return Ok(ExecutionInfoV2 { exit_reason: ExitError::OutOfGas.into(), value: Default::default(), - used_gas: gas_limit.into(), + used_gas: fp_evm::UsedGas { + standard: gas_limit.into(), + effective: gas_limit.into(), + }, + weight_info: maybe_weight_info, logs: Default::default(), }) } }; + // Only check the restrictions of EIP-3607 if the source of the EVM operation is from an external transaction. // If the source of this EVM operation is from an internal call, like from `eth_call` or `eth_estimateGas` RPC, @@ -161,13 +186,7 @@ where // // EIP-3607: https://eips.ethereum.org/EIPS/eip-3607 // Do not allow transactions for which `tx.sender` has any code deployed. - // - // We extend the principle of this EIP to also prevent `tx.sender` to be the address - // of a precompile. While mainnet Ethereum currently only has stateless precompiles, - // projects using Frontier can have stateful precompiles that can manage funds or - // which calls other contracts that expects this precompile address to be trustworthy. - if is_transactional - && (!>::get(source).is_empty() || is_precompile) + if is_transactional && !>::get(source).is_empty() { return Err(RunnerError { error: Error::::TransactionMustComeFromEOA, @@ -226,25 +245,38 @@ where }; let metadata = StackSubstateMetadata::new(gas_limit, config); - let state = SubstrateStackState::new(&vicinity, metadata); + let state = SubstrateStackState::new(&vicinity, metadata, maybe_weight_info); let mut executor = StackExecutor::new_with_precompiles(state, config, precompiles); let (reason, retv) = f(&mut executor); // Post execution. - let used_gas = U256::from(executor.used_gas()); - let actual_fee = executor.fee(total_fee_per_gas); + let used_gas = executor.used_gas(); + let effective_gas = match executor.state().weight_info() { + Some(weight_info) => U256::from(sp_std::cmp::max( + used_gas, + weight_info + .proof_size_usage + .unwrap_or_default() + .saturating_mul(T::GasLimitPovSizeRatio::get()), + )), + _ => used_gas.into(), + }; + let actual_fee = effective_gas.saturating_mul(total_fee_per_gas); + let actual_base_fee = effective_gas.saturating_mul(base_fee); log::debug!( target: "evm", - "Execution {:?} [source: {:?}, value: {}, gas_limit: {}, token: {}, validator: {}, actual_fee: {}, is_transactional: {}]", + "Execution {:?} [source: {:?}, value: {}, gas_limit: {}, actual_fee: {}, used_gas: {}, effective_gas: {}, base_fee: {}, total_fee_per_gas: {}, is_transactional: {}]", reason, source, value, gas_limit, - token, - validator, actual_fee, + used_gas, + effective_gas, + base_fee, + total_fee_per_gas, is_transactional ); @@ -288,13 +320,13 @@ where let state = executor.into_state(); - for address in state.substate.deletes { + for address in &state.substate.deletes { log::debug!( target: "evm", "Deleting account at {:?}", address ); - Pallet::::remove_account(&address) + Pallet::::remove_account(address) } for log in &state.substate.logs { @@ -323,10 +355,14 @@ where }; } - Ok(ExecutionInfo { + Ok(ExecutionInfoV2 { value: retv, exit_reason: reason, - used_gas, + used_gas: fp_evm::UsedGas { + standard: used_gas.into(), + effective: effective_gas, + }, + weight_info: state.weight_info(), logs: state.substate.logs, }) } @@ -350,6 +386,8 @@ where nonce: Option, access_list: Vec<(H160, Vec)>, is_transactional: bool, + weight_limit: Option, + proof_size_base_cost: Option, evm_config: &evm::Config, ) -> Result<(), RunnerError> { // we force the value to be zero because we don't support value transfer in EVM @@ -379,6 +417,8 @@ where value, access_list, }, + weight_limit, + proof_size_base_cost, ) .validate_in_block_for(&source_account) .and_then(|v| v.with_base_fee()) @@ -400,6 +440,8 @@ where access_list: Vec<(H160, Vec)>, is_transactional: bool, validate: bool, + weight_limit: Option, + proof_size_base_cost: Option, config: &evm::Config, ) -> Result> { // we force the value to be zero because we don't support value transfer in EVM @@ -416,6 +458,8 @@ where nonce, access_list.clone(), is_transactional, + weight_limit, + proof_size_base_cost, config, )?; } @@ -432,6 +476,8 @@ where config, &precompiles, is_transactional, + weight_limit, + proof_size_base_cost, |executor| { executor.transact_call(source, target, value, input, gas_limit, access_list) }, @@ -458,6 +504,8 @@ where access_list.clone(), is_transactional, validate, + weight_limit, + proof_size_base_cost, config, ) } @@ -474,6 +522,8 @@ where access_list: Vec<(H160, Vec)>, is_transactional: bool, validate: bool, + weight_limit: Option, + proof_size_base_cost: Option, config: &evm::Config, ) -> Result> { // we force the value to be zero because we don't support value transfer in EVM @@ -490,6 +540,8 @@ where nonce, access_list.clone(), is_transactional, + weight_limit, + proof_size_base_cost, config, )?; } @@ -504,6 +556,8 @@ where config, &precompiles, is_transactional, + weight_limit, + proof_size_base_cost, |executor| { let address = executor.create_address(evm::CreateScheme::Legacy { caller: source }); T::OnCreate::on_create(source, address); @@ -526,6 +580,8 @@ where access_list: Vec<(H160, Vec)>, is_transactional: bool, validate: bool, + weight_limit: Option, + proof_size_base_cost: Option, config: &evm::Config, ) -> Result> { // we force the value to be zero because we don't support value transfer in EVM @@ -542,6 +598,8 @@ where nonce, access_list.clone(), is_transactional, + weight_limit, + proof_size_base_cost, config, )?; } @@ -557,6 +615,8 @@ where config, &precompiles, is_transactional, + weight_limit, + proof_size_base_cost, |executor| { let address = executor.create_address(evm::CreateScheme::Create2 { caller: source, @@ -669,17 +729,29 @@ impl<'config> SubstrateStackSubstate<'config> { } } +#[derive(Default, Clone, Eq, PartialEq)] +pub struct Recorded { + account_codes: Vec, + account_storages: BTreeMap<(H160, H256), bool>, +} + /// Substrate backend for EVM. pub struct SubstrateStackState<'vicinity, 'config, T> { vicinity: &'vicinity Vicinity, substate: SubstrateStackSubstate<'config>, original_storage: BTreeMap<(H160, H256), H256>, + recorded: Recorded, + weight_info: Option, _marker: PhantomData, } impl<'vicinity, 'config, T: Config> SubstrateStackState<'vicinity, 'config, T> { /// Create a new backend with given vicinity. - pub fn new(vicinity: &'vicinity Vicinity, metadata: StackSubstateMetadata<'config>) -> Self { + pub fn new( + vicinity: &'vicinity Vicinity, + metadata: StackSubstateMetadata<'config>, + weight_info: Option, + ) -> Self { Self { vicinity, substate: SubstrateStackSubstate { @@ -690,11 +762,28 @@ impl<'vicinity, 'config, T: Config> SubstrateStackState<'vicinity, 'config, T> { }, _marker: PhantomData, original_storage: BTreeMap::new(), + recorded: Default::default(), + weight_info, } } + + pub fn weight_info(&self) -> Option { + self.weight_info + } + + pub fn recorded(&self) -> &Recorded { + &self.recorded + } + + pub fn info_mut(&mut self) -> (&mut Option, &mut Recorded) { + (&mut self.weight_info, &mut self.recorded) + } } -impl<'vicinity, 'config, T: Config> BackendT for SubstrateStackState<'vicinity, 'config, T> { +impl<'vicinity, 'config, T: Config> BackendT for SubstrateStackState<'vicinity, 'config, T> +where + BalanceOf: TryFrom + Into, +{ fn gas_price(&self) -> U256 { self.vicinity.gas_price } @@ -702,10 +791,6 @@ impl<'vicinity, 'config, T: Config> BackendT for SubstrateStackState<'vicinity, self.vicinity.origin } - fn block_randomness(&self) -> Option { - None - } - fn block_hash(&self, number: U256) -> H256 { if number > U256::from(u32::MAX) { H256::default() @@ -714,6 +799,10 @@ impl<'vicinity, 'config, T: Config> BackendT for SubstrateStackState<'vicinity, } } + fn block_randomness(&self) -> Option { + None + } + fn block_number(&self) -> U256 { let number: u128 = frame_system::Pallet::::block_number().unique_saturated_into(); U256::from(number) @@ -736,6 +825,11 @@ impl<'vicinity, 'config, T: Config> BackendT for SubstrateStackState<'vicinity, T::BlockGasLimit::get() } + fn block_base_fee_per_gas(&self) -> U256 { + let (base_fee, _) = T::FeeCalculator::min_gas_price(); + base_fee + } + fn chain_id(&self) -> U256 { U256::from(T::ChainId::get()) } @@ -763,8 +857,6 @@ impl<'vicinity, 'config, T: Config> BackendT for SubstrateStackState<'vicinity, } fn original_storage(&self, address: H160, index: H256) -> Option { - // Not being cached means that it was never changed, which means we - // can fetch it from storage. Some( self.original_storage .get(&(address, index)) @@ -772,11 +864,6 @@ impl<'vicinity, 'config, T: Config> BackendT for SubstrateStackState<'vicinity, .unwrap_or_else(|| self.storage(address, index)), ) } - - fn block_base_fee_per_gas(&self) -> sp_core::U256 { - let (base_fee, _) = T::FeeCalculator::min_gas_price(); - base_fee - } } impl<'vicinity, 'config, T: Config> StackStateT<'config> @@ -920,6 +1007,257 @@ where >::account_code_metadata(address).hash } + fn record_external_operation(&mut self, op: evm::ExternalOperation) -> Result<(), ExitError> { + let size_limit: u64 = self + .metadata() + .gasometer() + .config() + .create_contract_limit + .unwrap_or_default() as u64; + + let (weight_info, recorded) = self.info_mut(); + + if let Some(weight_info) = weight_info { + match op { + evm::ExternalOperation::AccountBasicRead => { + weight_info.try_record_proof_size_or_fail(ACCOUNT_BASIC_PROOF_SIZE)? + } + evm::ExternalOperation::AddressCodeRead(address) => { + let maybe_record = !recorded.account_codes.contains(&address); + // Skip if the address has been already recorded this block + if maybe_record { + // First we record account emptiness check. + // Transfers to EOAs with standard 21_000 gas limit are able to + // pay for this pov size. + weight_info.try_record_proof_size_or_fail(IS_EMPTY_CHECK_PROOF_SIZE)?; + + if >::decode_len(address).unwrap_or(0) == 0 { + return Ok(()); + } + // Try to record fixed sized `AccountCodesMetadata` read + // Tentatively 16 + 20 + 40 + weight_info + .try_record_proof_size_or_fail(ACCOUNT_CODES_METADATA_PROOF_SIZE)?; + if let Some(meta) = >::get(address) { + weight_info.try_record_proof_size_or_fail(meta.size)?; + } else { + // If it does not exist, try to record `create_contract_limit` first. + weight_info.try_record_proof_size_or_fail(size_limit)?; + let meta = Pallet::::account_code_metadata(address); + let actual_size = meta.size; + // Refund if applies + weight_info.refund_proof_size(size_limit.saturating_sub(actual_size)); + } + recorded.account_codes.push(address); + } + } + evm::ExternalOperation::IsEmpty => { + weight_info.try_record_proof_size_or_fail(IS_EMPTY_CHECK_PROOF_SIZE)? + } + evm::ExternalOperation::Write => { + weight_info.try_record_proof_size_or_fail(WRITE_PROOF_SIZE)? + } + }; + } + Ok(()) + } + + fn record_external_dynamic_opcode_cost( + &mut self, + opcode: Opcode, + _gas_cost: GasCost, + target: evm::gasometer::StorageTarget, + ) -> Result<(), ExitError> { + // If account code or storage slot is in the overlay it is already accounted for and early exit + let mut accessed_storage: Option = match target { + StorageTarget::Address(address) => { + if self.recorded().account_codes.contains(&address) { + return Ok(()); + } else { + Some(AccessedStorage::AccountCodes(address)) + } + } + StorageTarget::Slot(address, index) => { + if self + .recorded() + .account_storages + .contains_key(&(address, index)) + { + return Ok(()); + } else { + Some(AccessedStorage::AccountStorages((address, index))) + } + } + _ => None, + }; + + let size_limit: u64 = self + .metadata() + .gasometer() + .config() + .create_contract_limit + .unwrap_or_default() as u64; + + let (weight_info, recorded) = { + let (weight_info, recorded) = self.info_mut(); + if let Some(weight_info) = weight_info { + (weight_info, recorded) + } else { + return Ok(()); + } + }; + + // Record ref_time first + // TODO benchmark opcodes, until this is done we do used_gas to weight conversion for ref_time + + // Record proof_size + // Return if proof size recording is disabled + let proof_size_limit = if let Some(proof_size_limit) = weight_info.proof_size_limit { + proof_size_limit + } else { + return Ok(()); + }; + + let mut maybe_record_and_refund = |with_empty_check: bool| -> Result<(), ExitError> { + let address = if let Some(AccessedStorage::AccountCodes(address)) = accessed_storage { + address + } else { + // This must be unreachable, a valid target must be set. + // TODO decide how do we want to gracefully handle. + return Err(ExitError::OutOfGas); + }; + // First try to record fixed sized `AccountCodesMetadata` read + // Tentatively 20 + 8 + 32 + let mut base_cost = ACCOUNT_CODES_METADATA_PROOF_SIZE; + if with_empty_check { + base_cost = base_cost.saturating_add(IS_EMPTY_CHECK_PROOF_SIZE); + } + weight_info.try_record_proof_size_or_fail(base_cost)?; + if let Some(meta) = >::get(address) { + weight_info.try_record_proof_size_or_fail(meta.size)?; + } else { + // If it does not exist, try to record `create_contract_limit` first. + weight_info.try_record_proof_size_or_fail(size_limit)?; + let meta = Pallet::::account_code_metadata(address); + let actual_size = meta.size; + // Refund if applies + weight_info.refund_proof_size(size_limit.saturating_sub(actual_size)); + } + recorded.account_codes.push(address); + // Already recorded, return + Ok(()) + }; + + // Proof size is fixed length for writes (a 32-byte hash in a merkle trie), and + // the full key/value for reads. For read and writes over the same storage, the full value + // is included. + // For cold reads involving code (call, callcode, staticcall and delegatecall): + // - We depend on https://github.com/paritytech/frontier/pull/893 + // - Try to get the cached size or compute it on the fly + // - We record the actual size after caching, refunding the difference between it and the initially deducted + // contract size limit. + let opcode_proof_size = match opcode { + // Basic account fixed length + Opcode::BALANCE => { + accessed_storage = None; + U256::from(ACCOUNT_BASIC_PROOF_SIZE) + } + Opcode::EXTCODESIZE | Opcode::EXTCODECOPY | Opcode::EXTCODEHASH => { + return maybe_record_and_refund(false) + } + Opcode::CALLCODE | Opcode::CALL | Opcode::DELEGATECALL | Opcode::STATICCALL => { + return maybe_record_and_refund(true) + } + // (H160, H256) double map blake2 128 concat key size (68) + value 32 + Opcode::SLOAD => U256::from(ACCOUNT_STORAGE_PROOF_SIZE), + Opcode::SSTORE => { + let (address, index) = + if let Some(AccessedStorage::AccountStorages((address, index))) = + accessed_storage + { + (address, index) + } else { + // This must be unreachable, a valid target must be set. + // TODO decide how do we want to gracefully handle. + return Err(ExitError::OutOfGas); + }; + let mut cost = WRITE_PROOF_SIZE; + let maybe_record = !recorded.account_storages.contains_key(&(address, index)); + // If the slot is yet to be accessed we charge for it, as the evm reads + // it prior to the opcode execution. + // Skip if the address and index has been already recorded this block. + if maybe_record { + cost = cost.saturating_add(ACCOUNT_STORAGE_PROOF_SIZE); + } + U256::from(cost) + } + // Fixed trie 32 byte hash + Opcode::CREATE | Opcode::CREATE2 => U256::from(WRITE_PROOF_SIZE), + // When calling SUICIDE a target account will receive the self destructing + // address's balance. We need to account for both: + // - Target basic account read + // - 5 bytes of `decode_len` + Opcode::SUICIDE => { + accessed_storage = None; + U256::from(IS_EMPTY_CHECK_PROOF_SIZE) + } + // Rest of dynamic opcodes that do not involve proof size recording, do nothing + _ => return Ok(()), + }; + + if opcode_proof_size > U256::from(u64::MAX) { + weight_info.try_record_proof_size_or_fail(proof_size_limit)?; + return Err(ExitError::OutOfGas); + } + + // Cache the storage access + match accessed_storage { + Some(AccessedStorage::AccountStorages((address, index))) => { + recorded.account_storages.insert((address, index), true); + } + Some(AccessedStorage::AccountCodes(address)) => { + recorded.account_codes.push(address); + } + _ => {} + } + + // Record cost + self.record_external_cost(None, Some(opcode_proof_size.low_u64()))?; + Ok(()) + } + + fn record_external_cost( + &mut self, + ref_time: Option, + proof_size: Option, + ) -> Result<(), ExitError> { + let weight_info = if let (Some(weight_info), _) = self.info_mut() { + weight_info + } else { + return Ok(()); + }; + // Record ref_time first + // TODO benchmark opcodes, until this is done we do used_gas to weight conversion for ref_time + if let Some(amount) = ref_time { + weight_info.try_record_ref_time_or_fail(amount)?; + } + if let Some(amount) = proof_size { + weight_info.try_record_proof_size_or_fail(amount)?; + } + Ok(()) + } + + fn refund_external_cost(&mut self, ref_time: Option, proof_size: Option) { + if let Some(mut weight_info) = self.weight_info { + if let Some(amount) = ref_time { + weight_info.refund_ref_time(amount); + } + if let Some(amount) = proof_size { + weight_info.refund_proof_size(amount); + } + } + } + } pub trait OnChargeDecentralizedNativeTokenFee { diff --git a/primitives/transaction-validator/src/lib.rs b/primitives/transaction-validator/src/lib.rs index 36e12295..d38d3ea5 100644 --- a/primitives/transaction-validator/src/lib.rs +++ b/primitives/transaction-validator/src/lib.rs @@ -80,6 +80,8 @@ where is_transactional: true, }, transaction_data.clone().into(), + None, + None ) .validate_in_pool_for(&account) .map_err(|_| TransactionValidityError::Invalid(InvalidTransaction::Payment))?; diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 2f35b24b..d215e58c 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -64,7 +64,7 @@ use pallet_grandpa::{ use fp_evm::weight_per_gas; use fp_rpc::TransactionStatus; use pallet_ethereum::{Call::transact, PostLogContent, Transaction as EthereumTransaction}; -use pallet_evm::{Account as EVMAccount, FeeCalculator, Runner}; +use pallet_evm::{Account as EVMAccount, FeeCalculator, Runner, GasWeightMapping}; use pallet_sponsored_transactions::Call::send_sponsored_transaction; use pallet_validator_set::SessionBlockManager; // A few exports that help ease life for downstream crates. @@ -72,7 +72,7 @@ pub use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{ConstU32, ConstU8, FindAuthor, KeyOwnerProofSystem, OnTimestampSet, Randomness}, + traits::{ConstU32, ConstU8, FindAuthor, KeyOwnerProofSystem, OnTimestampSet, Randomness, OnFinalize}, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight}, ConstantMultiplier, IdentityFee, Weight, @@ -457,9 +457,12 @@ where } const WEIGHT_PER_GAS: u64 = 20_000; + + parameter_types! { pub PrecompilesValue: StabilityPrecompiles = StabilityPrecompiles::<_, StabilityFeeController>::new(); pub WeightPerGas: Weight = Weight::from_ref_time(WEIGHT_PER_GAS); + pub const GasLimitPovSizeRatio: u64 = 15; } impl pallet_evm::Config for Runtime { @@ -480,6 +483,7 @@ impl pallet_evm::Config for Runtime { type OnChargeTransaction = (); type OnCreate = (); type FindAuthor = FindAuthorLinkedOrTruncated; + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; type Timestamp = Timestamp; type WeightInfo = pallet_evm::weights::SubstrateWeight; } @@ -519,7 +523,6 @@ impl pallet_validator_fee_selector::Config for Runtime { impl pallet_supported_tokens_manager::Config for Runtime {} - parameter_types! { pub DefaultBaseFeePerGas: U256 = U256::from(GAS_BASE_FEE); pub DefaultElasticity: Permill = DEFAULT_ELASTICITY; @@ -554,6 +557,7 @@ parameter_types! { pub const CouncilMotionDuration: BlockNumber = COUNCIL_MOTION_MINUTES_DURATION * MINUTES; pub const CouncilMaxProposals: u32 = COUNCIL_MAX_PROPOSALS; pub const CouncilMaxMembers: u32 = COUNCIL_MAX_MEMBERS; + pub const MaxProposalWeight: Weight = MAXIMUM_BLOCK_WEIGHT; } type TechCommitteeInstance = pallet_collective::Instance1; @@ -568,6 +572,7 @@ impl pallet_collective::Config for Runtime { type DefaultVote = pallet_collective::PrimeDefaultVote; type WeightInfo = pallet_collective::weights::SubstrateWeight; type SetMembersOrigin = EnsureRootOrHalfTechCommittee; + type MaxProposalWeight = MaxProposalWeight; } impl pallet_root_controller::Config for Runtime { @@ -970,6 +975,14 @@ impl_runtime_apis! { fn metadata() -> OpaqueMetadata { OpaqueMetadata::new(Runtime::metadata().into()) } + + fn metadata_at_version(version: u32) -> Option { + Runtime::metadata_at_version(version) + } + + fn metadata_versions() -> Vec { + Runtime::metadata_versions() + } } impl sp_block_builder::BlockBuilder for Runtime { @@ -1076,6 +1089,41 @@ impl_runtime_apis! { let is_transactional = false; let validate = true; let evm_config = config.as_ref().unwrap_or(::config()); + + let mut estimated_transaction_len = data.len() + + 20 + // to + 20 + // from + 32 + // value + 32 + // gas_limit + 32 + // nonce + 1 + // TransactionAction + 8 + // chain id + 65; // signature + + if max_fee_per_gas.is_some() { + estimated_transaction_len += 32; + } + if max_priority_fee_per_gas.is_some() { + estimated_transaction_len += 32; + } + if access_list.is_some() { + estimated_transaction_len += access_list.encoded_size(); + } + + let gas_limit = gas_limit.min(u64::MAX.into()).low_u64(); + let without_base_extrinsic_weight = true; + + let (weight_limit, proof_size_base_cost) = + match ::GasWeightMapping::gas_to_weight( + gas_limit, + without_base_extrinsic_weight + ) { + weight_limit if weight_limit.proof_size() > 0 => { + (Some(weight_limit), Some(estimated_transaction_len as u64)) + } + _ => (None, None), + }; + ::Runner::call( from, to, @@ -1088,6 +1136,8 @@ impl_runtime_apis! { access_list.unwrap_or_default(), is_transactional, validate, + weight_limit, + proof_size_base_cost, evm_config, ).map_err(|err| err.error.into()) } @@ -1114,6 +1164,45 @@ impl_runtime_apis! { let is_transactional = false; let validate = true; let evm_config = config.as_ref().unwrap_or(::config()); + + let mut estimated_transaction_len = data.len() + + 20 + // from + 32 + // value + 32 + // gas_limit + 32 + // nonce + 1 + // TransactionAction + 8 + // chain id + 65; // signature + + if max_fee_per_gas.is_some() { + estimated_transaction_len += 32; + } + if max_priority_fee_per_gas.is_some() { + estimated_transaction_len += 32; + } + if access_list.is_some() { + estimated_transaction_len += access_list.encoded_size(); + } + + let gas_limit = if gas_limit > U256::from(u64::MAX) { + u64::MAX + } else { + gas_limit.low_u64() + }; + let without_base_extrinsic_weight = true; + + let (weight_limit, proof_size_base_cost) = + match ::GasWeightMapping::gas_to_weight( + gas_limit, + without_base_extrinsic_weight + ) { + weight_limit if weight_limit.proof_size() > 0 => { + (Some(weight_limit), Some(estimated_transaction_len as u64)) + } + _ => (None, None), + }; + + ::Runner::create( from, data, @@ -1125,6 +1214,8 @@ impl_runtime_apis! { access_list.unwrap_or_default(), is_transactional, validate, + weight_limit, + proof_size_base_cost, evm_config, ).map_err(|err| err.error.into()) } @@ -1167,6 +1258,21 @@ impl_runtime_apis! { } fn gas_limit_multiplier_support() {} + + fn pending_block( + xts: Vec<::Extrinsic>, + ) -> (Option, Option>) { + for ext in xts.into_iter() { + let _ = Executive::apply_extrinsic(ext); + } + + Ethereum::on_finalize(System::block_number() + 1); + + ( + pallet_ethereum::CurrentBlock::::get(), + pallet_ethereum::CurrentTransactionStatuses::::get() + ) + } } impl stbl_primitives_zero_gas_transactions_api::ZeroGasTransactionApi for Runtime { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index e75c2e20..bdf5e384 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,8 @@ [toolchain] -channel = "nightly-2023-01-01" -components = [ "rustfmt" ] -targets = [ "wasm32-unknown-unknown" ] +# Stable +#channel = "1.68.2" # rustc 1.68.2 (9eb3afe9e 2023-03-27) +# Nightly +channel = "nightly-2022-11-16" # rustc 1.67.0-nightly (a00f8ba7f 2022-11-15) +components = ["rustfmt", "clippy"] +targets = ["wasm32-unknown-unknown"] profile = "minimal" \ No newline at end of file diff --git a/test-utils/stability-client/src/lib.rs b/test-utils/stability-client/src/lib.rs index c2e975c0..4d8bab34 100644 --- a/test-utils/stability-client/src/lib.rs +++ b/test-utils/stability-client/src/lib.rs @@ -27,13 +27,13 @@ pub use sc_client_api::{ BadBlocks, ForkBlocks, }; pub use sc_client_db::{self, Backend, BlocksPruning}; -pub use sc_executor::{self, NativeElseWasmExecutor, WasmExecutionMethod}; +pub use sc_executor::{self, NativeElseWasmExecutor, WasmExecutionMethod, WasmExecutor}; pub use sc_service::{client, RpcHandlers}; pub use sp_consensus; pub use sp_keyring::{ ed25519::Keyring as Ed25519Keyring, sr25519::Keyring as Sr25519Keyring, AccountKeyring, }; -pub use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr}; +pub use sp_keystore::{Keystore, KeystorePtr}; pub use sp_runtime::{Storage, StorageChild}; pub use sp_state_machine::ExecutionStrategy; @@ -70,7 +70,7 @@ pub struct TestClientBuilder, StorageChild>, backend: Arc, _executor: std::marker::PhantomData, - keystore: Option, + keystore: Option, fork_blocks: ForkBlocks, bad_blocks: BadBlocks, enable_offchain_indexing_api: bool, @@ -128,7 +128,7 @@ impl } /// Set the keystore that should be used by the externalities. - pub fn set_keystore(mut self, keystore: SyncCryptoStorePtr) -> Self { + pub fn set_keystore(mut self, keystore: KeystorePtr) -> Self { self.keystore = Some(keystore); self } @@ -290,13 +290,13 @@ impl }); let executor = LocalCallExecutor::new( self.backend.clone(), - executor, - Box::new(sp_core::testing::TaskExecutor::new()), + executor.clone(), Default::default(), ExecutionExtensions::new( self.execution_strategies.clone(), self.keystore.clone(), sc_offchain::OffchainDb::factory_from_backend(&*self.backend), + Arc::new(executor), ), ) .expect("Creates LocalCallExecutor"); diff --git a/test-utils/stability-runtime/src/lib.rs b/test-utils/stability-runtime/src/lib.rs index 200c6aa4..f94deda6 100644 --- a/test-utils/stability-runtime/src/lib.rs +++ b/test-utils/stability-runtime/src/lib.rs @@ -178,13 +178,21 @@ pub enum Extrinsic { OffchainIndexSet(Vec, Vec), OffchainIndexClear(Vec), Store(Vec), + /// Read X times from the state some data and then panic! + /// + /// Returns `Ok` if it didn't read anything. + ReadAndPanic(u32), + /// Read X times from the state some data. + /// + /// Panics if it can not read `X` times. + Read(u32), } #[cfg(feature = "std")] impl serde::Serialize for Extrinsic { fn serialize(&self, seq: S) -> Result where - S: ::serde::Serializer, + S: serde::Serializer, { self.using_encoded(|bytes| seq.serialize_bytes(bytes)) } @@ -230,6 +238,8 @@ impl BlindCheckable for Extrinsic { Extrinsic::OffchainIndexSet(key, value) => Ok(Extrinsic::OffchainIndexSet(key, value)), Extrinsic::OffchainIndexClear(key) => Ok(Extrinsic::OffchainIndexClear(key)), Extrinsic::Store(data) => Ok(Extrinsic::Store(data)), + Extrinsic::ReadAndPanic(i) => Ok(Extrinsic::ReadAndPanic(i)), + Extrinsic::Read(i) => Ok(Extrinsic::Read(i)), } } } @@ -761,6 +771,14 @@ cfg_if! { fn metadata() -> OpaqueMetadata { unimplemented!() } + + fn metadata_at_version(_version: u32) -> Option { + unimplemented!() + } + + fn metadata_versions() -> sp_std::vec::Vec { + unimplemented!() + } } impl sp_transaction_pool::runtime_api::TaggedTransactionQueue for Runtime { @@ -1069,6 +1087,14 @@ cfg_if! { fn metadata() -> OpaqueMetadata { unimplemented!() } + + fn metadata_at_version(_version: u32) -> Option { + unimplemented!() + } + + fn metadata_versions() -> sp_std::vec::Vec { + unimplemented!() + } } impl sp_transaction_pool::runtime_api::TaggedTransactionQueue for Runtime { diff --git a/test-utils/stability-runtime/src/system.rs b/test-utils/stability-runtime/src/system.rs index 7b0255d5..fdad2d52 100644 --- a/test-utils/stability-runtime/src/system.rs +++ b/test-utils/stability-runtime/src/system.rs @@ -302,6 +302,32 @@ fn execute_transaction_backend(utx: &Extrinsic, extrinsic_index: u32) -> ApplyEx Ok(Ok(())) } Extrinsic::Store(data) => execute_store(data.clone()), + Extrinsic::ReadAndPanic(i) => execute_read(*i, true), + Extrinsic::Read(i) => execute_read(*i, false), + } +} + +fn execute_read(read: u32, panic_at_end: bool) -> ApplyExtrinsicResult { + let mut next_key = vec![]; + for _ in 0..(read as usize) { + if let Some(next) = sp_io::storage::next_key(&next_key) { + // Read the value + sp_io::storage::get(&next); + + next_key = next; + } else { + if panic_at_end { + return Ok(Ok(())) + } else { + panic!("Could not read {read} times from the state"); + } + } + } + + if panic_at_end { + panic!("BYE") + } else { + Ok(Ok(())) } } @@ -377,7 +403,7 @@ mod tests { use super::*; use crate::{wasm_binary_unwrap, Header, Transfer}; - use sc_executor::{NativeElseWasmExecutor, WasmExecutionMethod}; + use sc_executor::{NativeElseWasmExecutor, WasmExecutor}; use sp_core::{ map, traits::{CallContext, CodeExecutor, RuntimeCode}, @@ -401,7 +427,7 @@ mod tests { } fn executor() -> NativeElseWasmExecutor { - NativeElseWasmExecutor::new(WasmExecutionMethod::Interpreted, None, 8, 2) + NativeElseWasmExecutor::new_with_wasm_executor(WasmExecutor::builder().build()) } fn new_test_ext() -> TestExternalities { From a4c95e0e0384a0319e83b6c63e8cfcf5355ea83f Mon Sep 17 00:00:00 2001 From: GabrielMartinezRodriguez Date: Fri, 27 Oct 2023 16:00:15 +0200 Subject: [PATCH 06/37] chore: polkadot 0.9.43 --- Cargo.lock | 1069 ++++++------ Cargo.toml | 214 ++- client/authorship/Cargo.toml | 3 +- client/authorship/src/authorship.rs | 786 +-------- node/src/eth.rs | 11 +- node/src/service.rs | 13 +- runtime/src/lib.rs | 11 +- rust-toolchain.toml | 4 +- test-utils/stability-client/Cargo.toml | 32 - test-utils/stability-client/src/client_ext.rs | 209 --- test-utils/stability-client/src/lib.rs | 476 ----- .../stability-runtime-client/Cargo.toml | 25 - .../src/block_builder_ext.rs | 65 - .../stability-runtime-client/src/lib.rs | 300 ---- test-utils/stability-runtime/Cargo.toml | 111 -- test-utils/stability-runtime/build.rs | 42 - .../stability-runtime/src/genesismap.rs | 119 -- test-utils/stability-runtime/src/lib.rs | 1526 ----------------- test-utils/stability-runtime/src/system.rs | 617 ------- 19 files changed, 614 insertions(+), 5019 deletions(-) delete mode 100644 test-utils/stability-client/Cargo.toml delete mode 100644 test-utils/stability-client/src/client_ext.rs delete mode 100644 test-utils/stability-client/src/lib.rs delete mode 100644 test-utils/stability-runtime-client/Cargo.toml delete mode 100644 test-utils/stability-runtime-client/src/block_builder_ext.rs delete mode 100644 test-utils/stability-runtime-client/src/lib.rs delete mode 100644 test-utils/stability-runtime/Cargo.toml delete mode 100644 test-utils/stability-runtime/build.rs delete mode 100644 test-utils/stability-runtime/src/genesismap.rs delete mode 100644 test-utils/stability-runtime/src/lib.rs delete mode 100644 test-utils/stability-runtime/src/system.rs diff --git a/Cargo.lock b/Cargo.lock index 8fed4247..fe7e2c05 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -34,11 +34,11 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ - "gimli 0.26.2", + "gimli 0.27.3", ] [[package]] @@ -314,6 +314,12 @@ version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" +[[package]] +name = "array-bytes" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b1c5a481ec30a5abd8dfbd94ab5cf1bb4e9a66be7f1b3b322f2f1170c200fd" + [[package]] name = "arrayref" version = "0.3.7" @@ -408,12 +414,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "asn1_der" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "155a5a185e42c6b77ac7b88a15143d930a9e9727a5b7b77eed417404ab15c247" - [[package]] name = "assert_matches" version = "1.5.0" @@ -600,7 +600,7 @@ dependencies = [ [[package]] name = "binary-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "hash-db 0.16.0", "log", @@ -617,9 +617,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.64.0" +version = "0.65.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" +checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" dependencies = [ "bitflags 1.3.2", "cexpr", @@ -627,12 +627,13 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", + "prettyplease 0.2.15", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 1.0.109", + "syn 2.0.38", ] [[package]] @@ -934,9 +935,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.10.3" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aacacf4d96c24b2ad6eb8ee6df040e4f27b0d0b39a5710c30091baa830485db" +checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" dependencies = [ "smallvec", ] @@ -1218,28 +1219,27 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc42ba2e232e5b20ff7dc299a812d53337dadce9a7e39a238e6a5cb82d2e57b" +checksum = "1277fbfa94bc82c8ec4af2ded3e639d49ca5f7f3c7eeab2c66accd135ece4e70" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "253531aca9b6f56103c9420369db3263e784df39aa1c90685a1f69cfbba0623e" +checksum = "c6e8c31ad3b2270e9aeec38723888fe1b0ace3bea2b06b3f749ccf46661d3220" dependencies = [ - "arrayvec 0.7.4", "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", "cranelift-isle", - "gimli 0.26.2", - "hashbrown 0.12.3", + "gimli 0.27.3", + "hashbrown 0.13.2", "log", "regalloc2", "smallvec", @@ -1248,33 +1248,33 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72f2154365e2bff1b1b8537a7181591fdff50d8e27fa6e40d5c69c3bad0ca7c8" +checksum = "c8ac5ac30d62b2d66f12651f6b606dbdfd9c2cfd0908de6b387560a277c5c9da" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "687e14e3f5775248930e0d5a84195abef8b829958e9794bf8d525104993612b4" +checksum = "dd82b8b376247834b59ed9bdc0ddeb50f517452827d4a11bccf5937b213748b8" [[package]] name = "cranelift-entity" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f42ea692c7b450ad18b8c9889661505d51c09ec4380cf1c2d278dbb2da22cae1" +checksum = "40099d38061b37e505e63f89bab52199037a72b931ad4868d9089ff7268660b0" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8483c2db6f45fe9ace984e5adc5d058102227e4c62e5aa2054e16b0275fd3a6e" +checksum = "64a25d9d0a0ae3079c463c34115ec59507b4707175454f0eee0891e83e30e82d" dependencies = [ "cranelift-codegen", "log", @@ -1284,15 +1284,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9793158837678902446c411741d87b43f57dadfb944f2440db4287cda8cbd59" +checksum = "80de6a7d0486e4acbd5f9f87ec49912bf4c8fb6aea00087b989685460d4469ba" [[package]] name = "cranelift-native" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72668c7755f2b880665cb422c8ad2d56db58a88b9bebfef0b73edc2277c13c49" +checksum = "bb6b03e0e03801c4b3fd8ce0758a94750c07a44e7944cc0ffbf0d3f2e7c79b00" dependencies = [ "cranelift-codegen", "libc", @@ -1301,9 +1301,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3852ce4b088b44ac4e29459573943009a70d1b192c8d77ef949b4e814f656fc1" +checksum = "ff3220489a3d928ad91e59dd7aeaa8b3de18afb554a6211213673a71c90737ac" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -1942,8 +1942,6 @@ checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ "curve25519-dalek 3.2.0", "ed25519 1.5.3", - "rand 0.7.3", - "serde", "sha2 0.9.9", "zeroize", ] @@ -2255,7 +2253,7 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fc-cli" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "clap", "ethereum-types", @@ -2273,7 +2271,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "async-trait", "fp-consensus", @@ -2289,7 +2287,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "async-trait", "ethereum", @@ -2319,7 +2317,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "fc-db", "fc-storage", @@ -2342,7 +2340,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "ethereum", "ethereum-types", @@ -2360,7 +2358,7 @@ dependencies = [ "jsonrpsee", "libsecp256k1", "log", - "lru", + "lru 0.8.1", "pallet-evm", "parity-scale-codec", "prometheus", @@ -2392,7 +2390,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "ethereum", "ethereum-types", @@ -2405,7 +2403,7 @@ dependencies = [ [[package]] name = "fc-storage" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "ethereum", "ethereum-types", @@ -2566,7 +2564,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "parity-scale-codec", ] @@ -2583,7 +2581,7 @@ dependencies = [ [[package]] name = "fp-account" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "hex", "impl-serde", @@ -2602,7 +2600,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "ethereum", "parity-scale-codec", @@ -2614,7 +2612,7 @@ dependencies = [ [[package]] name = "fp-ethereum" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "ethereum", "ethereum-types", @@ -2628,7 +2626,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "evm", "frame-support", @@ -2643,7 +2641,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "ethereum", "ethereum-types", @@ -2660,7 +2658,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "frame-support", "parity-scale-codec", @@ -2672,7 +2670,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "parity-scale-codec", "serde", @@ -2687,7 +2685,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "frame-support", "frame-support-procedural", @@ -2712,10 +2710,10 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "Inflector", - "array-bytes", + "array-bytes 4.2.0", "chrono", "clap", "comfy-table", @@ -2759,7 +2757,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "frame-support", "frame-system", @@ -2787,7 +2785,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "bitflags 1.3.2", "environmental", @@ -2806,6 +2804,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-core-hashing-proc-macro", + "sp-debug-derive", "sp-inherents", "sp-io", "sp-runtime", @@ -2820,7 +2819,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "Inflector", "cfg-expr", @@ -2836,7 +2835,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2848,7 +2847,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "proc-macro2", "quote", @@ -2858,8 +2857,9 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ + "cfg-if", "frame-support", "log", "parity-scale-codec", @@ -2876,7 +2876,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "frame-benchmarking", "frame-support", @@ -2891,7 +2891,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "parity-scale-codec", "sp-api", @@ -3145,9 +3145,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.26.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" dependencies = [ "fallible-iterator", "indexmap 1.9.3", @@ -3934,9 +3934,9 @@ dependencies = [ [[package]] name = "kvdb-rocksdb" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7a749456510c45f795e8b04a6a3e0976d0139213ecbf465843830ad55e2217" +checksum = "b644c70b92285f66bfc2032922a79000ea30af7bc2ab31902992a5dcb9b434f6" dependencies = [ "kvdb", "num_cpus", @@ -3985,22 +3985,24 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libp2p" -version = "0.50.1" +version = "0.51.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7b0104790be871edcf97db9bd2356604984e623a08d825c3f27852290266b8" +checksum = "f210d259724eae82005b5c48078619b7745edb7b76de370b03f8ba59ea103097" dependencies = [ "bytes", "futures", "futures-timer", "getrandom 0.2.10", "instant", - "libp2p-core 0.38.0", + "libp2p-allow-block-list", + "libp2p-connection-limits", + "libp2p-core", "libp2p-dns", "libp2p-identify", + "libp2p-identity", "libp2p-kad", "libp2p-mdns", "libp2p-metrics", - "libp2p-mplex", "libp2p-noise", "libp2p-ping", "libp2p-quic", @@ -4011,44 +4013,32 @@ dependencies = [ "libp2p-webrtc", "libp2p-websocket", "libp2p-yamux", - "multiaddr 0.16.0", - "parking_lot 0.12.1", + "multiaddr", "pin-project", - "smallvec", ] [[package]] -name = "libp2p-core" -version = "0.38.0" +name = "libp2p-allow-block-list" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a8fcd392ff67af6cc3f03b1426c41f7f26b6b9aff2dc632c1c56dd649e571f" +checksum = "510daa05efbc25184458db837f6f9a5143888f1caa742426d92e1833ddd38a50" dependencies = [ - "asn1_der", - "bs58", - "ed25519-dalek 1.0.1", - "either", - "fnv", - "futures", - "futures-timer", - "instant", - "log", - "multiaddr 0.16.0", - "multihash 0.16.3", - "multistream-select", - "once_cell", - "parking_lot 0.12.1", - "pin-project", - "prost", - "prost-build", - "rand 0.8.5", - "rw-stream-sink", - "sec1 0.3.0", - "sha2 0.10.8", - "smallvec", - "thiserror", - "unsigned-varint", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "void", +] + +[[package]] +name = "libp2p-connection-limits" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4caa33f1d26ed664c4fe2cca81a08c8e07d4c1c04f2f4ac7655c2dd85467fda0" +dependencies = [ + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", "void", - "zeroize", ] [[package]] @@ -4064,7 +4054,7 @@ dependencies = [ "instant", "libp2p-identity", "log", - "multiaddr 0.17.1", + "multiaddr", "multihash 0.17.0", "multistream-select", "once_cell", @@ -4081,12 +4071,12 @@ dependencies = [ [[package]] name = "libp2p-dns" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e42a271c1b49f789b92f7fc87749fa79ce5c7bdc88cbdfacb818a4bca47fec5" +checksum = "146ff7034daae62077c415c2376b8057368042df6ab95f5432ad5e88568b1554" dependencies = [ "futures", - "libp2p-core 0.38.0", + "libp2p-core", "log", "parking_lot 0.12.1", "smallvec", @@ -4095,20 +4085,21 @@ dependencies = [ [[package]] name = "libp2p-identify" -version = "0.41.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c052d0026f4817b44869bfb6810f4e1112f43aec8553f2cb38881c524b563abf" +checksum = "5455f472243e63b9c497ff320ded0314254a9eb751799a39c283c6f20b793f3c" dependencies = [ "asynchronous-codec", + "either", "futures", "futures-timer", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm", "log", - "lru", - "prost", - "prost-build", - "prost-codec", + "lru 0.10.1", + "quick-protobuf", + "quick-protobuf-codec", "smallvec", "thiserror", "void", @@ -4123,7 +4114,7 @@ dependencies = [ "bs58", "ed25519-dalek 2.0.0", "log", - "multiaddr 0.17.1", + "multiaddr", "multihash 0.17.0", "quick-protobuf", "rand 0.8.5", @@ -4134,9 +4125,9 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.42.1" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2766dcd2be8c87d5e1f35487deb22d765f49c6ae1251b3633efe3b25698bd3d2" +checksum = "39d5ef876a2b2323d63c258e63c2f8e36f205fe5a11f0b3095d59635650790ff" dependencies = [ "arrayvec 0.7.4", "asynchronous-codec", @@ -4146,11 +4137,11 @@ dependencies = [ "futures", "futures-timer", "instant", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm", "log", - "prost", - "prost-build", + "quick-protobuf", "rand 0.8.5", "sha2 0.10.8", "smallvec", @@ -4162,14 +4153,15 @@ dependencies = [ [[package]] name = "libp2p-mdns" -version = "0.42.0" +version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f378264aade9872d6ccd315c0accc18be3a35d15fc1b9c36e5b6f983b62b5b" +checksum = "19983e1f949f979a928f2c603de1cf180cc0dc23e4ac93a62651ccb18341460b" dependencies = [ "data-encoding", "futures", "if-watch", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm", "log", "rand 0.8.5", @@ -4182,11 +4174,11 @@ dependencies = [ [[package]] name = "libp2p-metrics" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad8a64f29da86005c86a4d2728b8a0719e9b192f4092b609fd8790acb9dec55" +checksum = "a42ec91e227d7d0dafa4ce88b333cdf5f277253873ab087555c92798db2ddd46" dependencies = [ - "libp2p-core 0.38.0", + "libp2p-core", "libp2p-identify", "libp2p-kad", "libp2p-ping", @@ -4194,38 +4186,20 @@ dependencies = [ "prometheus-client", ] -[[package]] -name = "libp2p-mplex" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03805b44107aa013e7cbbfa5627b31c36cbedfdfb00603c0311998882bc4bace" -dependencies = [ - "asynchronous-codec", - "bytes", - "futures", - "libp2p-core 0.38.0", - "log", - "nohash-hasher", - "parking_lot 0.12.1", - "rand 0.8.5", - "smallvec", - "unsigned-varint", -] - [[package]] name = "libp2p-noise" -version = "0.41.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a978cb57efe82e892ec6f348a536bfbd9fee677adbe5689d7a93ad3a9bffbf2e" +checksum = "9c3673da89d29936bc6435bafc638e2f184180d554ce844db65915113f86ec5e" dependencies = [ "bytes", "curve25519-dalek 3.2.0", "futures", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "log", "once_cell", - "prost", - "prost-build", + "quick-protobuf", "rand 0.8.5", "sha2 0.10.8", "snow", @@ -4237,14 +4211,15 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.41.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "929fcace45a112536e22b3dcfd4db538723ef9c3cb79f672b98be2cc8e25f37f" +checksum = "3e57759c19c28a73ef1eb3585ca410cefb72c1a709fcf6de1612a378e4219202" dependencies = [ + "either", "futures", "futures-timer", "instant", - "libp2p-core 0.38.0", + "libp2p-core", "libp2p-swarm", "log", "rand 0.8.5", @@ -4253,15 +4228,16 @@ dependencies = [ [[package]] name = "libp2p-quic" -version = "0.7.0-alpha" +version = "0.7.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01e7c867e95c8130667b24409d236d37598270e6da69b3baf54213ba31ffca59" +checksum = "c6b26abd81cd2398382a1edfe739b539775be8a90fa6914f39b2ab49571ec735" dependencies = [ "bytes", "futures", "futures-timer", "if-watch", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-tls", "log", "parking_lot 0.12.1", @@ -4274,49 +4250,46 @@ dependencies = [ [[package]] name = "libp2p-request-response" -version = "0.23.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3236168796727bfcf4927f766393415361e2c644b08bedb6a6b13d957c9a4884" +checksum = "7ffdb374267d42dc5ed5bc53f6e601d4a64ac5964779c6e40bb9e4f14c1e30d5" dependencies = [ "async-trait", - "bytes", "futures", "instant", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm", - "log", "rand 0.8.5", "smallvec", - "unsigned-varint", ] [[package]] name = "libp2p-swarm" -version = "0.41.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a35472fe3276b3855c00f1c032ea8413615e030256429ad5349cdf67c6e1a0" +checksum = "903b3d592d7694e56204d211f29d31bc004be99386644ba8731fc3e3ef27b296" dependencies = [ "either", "fnv", "futures", "futures-timer", "instant", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm-derive", "log", - "pin-project", "rand 0.8.5", "smallvec", - "thiserror", "tokio", "void", ] [[package]] name = "libp2p-swarm-derive" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d527d5827582abd44a6d80c07ff8b50b4ee238a8979e05998474179e79dc400" +checksum = "0fba456131824ab6acd4c7bf61e9c0f0a3014b5fc9868ccb8e10d344594cdc4f" dependencies = [ "heck", "quote", @@ -4325,15 +4298,15 @@ dependencies = [ [[package]] name = "libp2p-tcp" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b257baf6df8f2df39678b86c578961d48cc8b68642a12f0f763f56c8e5858d" +checksum = "33d33698596d7722d85d3ab0c86c2c322254fce1241e91208e3679b4eb3026cf" dependencies = [ "futures", "futures-timer", "if-watch", "libc", - "libp2p-core 0.38.0", + "libp2p-core", "log", "socket2 0.4.9", "tokio", @@ -4347,7 +4320,7 @@ checksum = "ff08d13d0dc66e5e9ba6279c1de417b84fa0d0adc3b03e5732928c180ec02781" dependencies = [ "futures", "futures-rustls", - "libp2p-core 0.39.2", + "libp2p-core", "libp2p-identity", "rcgen 0.10.0", "ring 0.16.20", @@ -4360,13 +4333,13 @@ dependencies = [ [[package]] name = "libp2p-wasm-ext" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bb1a35299860e0d4b3c02a3e74e3b293ad35ae0cee8a056363b0c862d082069" +checksum = "77dff9d32353a5887adb86c8afc1de1a94d9e8c3bc6df8b2201d7cdf5c848f43" dependencies = [ "futures", "js-sys", - "libp2p-core 0.38.0", + "libp2p-core", "parity-send-wrapper", "wasm-bindgen", "wasm-bindgen-futures", @@ -4374,9 +4347,9 @@ dependencies = [ [[package]] name = "libp2p-webrtc" -version = "0.4.0-alpha" +version = "0.4.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb6cd86dd68cba72308ea05de1cebf3ba0ae6e187c40548167955d4e3970f6a" +checksum = "dba48592edbc2f60b4bc7c10d65445b0c3964c07df26fdf493b6880d33be36f8" dependencies = [ "async-trait", "asynchronous-codec", @@ -4385,13 +4358,13 @@ dependencies = [ "futures-timer", "hex", "if-watch", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-noise", "log", - "multihash 0.16.3", - "prost", - "prost-build", - "prost-codec", + "multihash 0.17.0", + "quick-protobuf", + "quick-protobuf-codec", "rand 0.8.5", "rcgen 0.9.3", "serde", @@ -4405,14 +4378,14 @@ dependencies = [ [[package]] name = "libp2p-websocket" -version = "0.40.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d705506030d5c0aaf2882437c70dab437605f21c5f9811978f694e6917a3b54" +checksum = "111273f7b3d3510524c752e8b7a5314b7f7a1fee7e68161c01a7d72cbb06db9f" dependencies = [ "either", "futures", "futures-rustls", - "libp2p-core 0.38.0", + "libp2p-core", "log", "parking_lot 0.12.1", "quicksink", @@ -4424,23 +4397,22 @@ dependencies = [ [[package]] name = "libp2p-yamux" -version = "0.42.0" +version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f63594a0aa818642d9d4915c791945053877253f08a3626f13416b5cd928a29" +checksum = "4dcd21d950662700a385d4c6d68e2f5f54d778e97068cdd718522222ef513bda" dependencies = [ "futures", - "libp2p-core 0.38.0", + "libp2p-core", "log", - "parking_lot 0.12.1", "thiserror", "yamux", ] [[package]] name = "librocksdb-sys" -version = "0.10.0+7.9.2" +version = "0.11.0+8.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fe4d5874f5ff2bc616e55e8c6086d478fcda13faf9495768a4aa1c22042d30b" +checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e" dependencies = [ "bindgen", "bzip2-sys", @@ -4597,6 +4569,15 @@ dependencies = [ "hashbrown 0.12.3", ] +[[package]] +name = "lru" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "718e8fae447df0c7e1ba7f5189829e63fd536945c8988d61444c19039f16b670" +dependencies = [ + "hashbrown 0.13.2", +] + [[package]] name = "lru-cache" version = "0.1.2" @@ -4643,7 +4624,7 @@ checksum = "7489ae0986ce45414b7b3122c2e316661343ecf396b206e3e15f07c846616f10" dependencies = [ "diff", "glob", - "prettyplease", + "prettyplease 0.1.25", "serde", "serde_json", "syn 1.0.109", @@ -4724,6 +4705,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + [[package]] name = "memoffset" version = "0.9.0" @@ -4819,24 +4809,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "multiaddr" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aebdb21e90f81d13ed01dc84123320838e53963c2ca94b60b305d3fa64f31e" -dependencies = [ - "arrayref", - "byteorder", - "data-encoding", - "multibase", - "multihash 0.16.3", - "percent-encoding", - "serde", - "static_assertions", - "unsigned-varint", - "url", -] - [[package]] name = "multiaddr" version = "0.17.1" @@ -4891,7 +4863,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" dependencies = [ "core2", + "digest 0.10.7", "multihash-derive", + "sha2 0.10.8", "unsigned-varint", ] @@ -5228,12 +5202,12 @@ dependencies = [ [[package]] name = "object" -version = "0.29.0" +version = "0.30.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" dependencies = [ "crc32fast", - "hashbrown 0.12.3", + "hashbrown 0.13.2", "indexmap 1.9.3", "memchr", ] @@ -5352,7 +5326,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "frame-support", "frame-system", @@ -5368,7 +5342,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "frame-support", "frame-system", @@ -5382,7 +5356,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "frame-benchmarking", "frame-support", @@ -5406,7 +5380,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "frame-benchmarking", "frame-support", @@ -5421,7 +5395,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "fp-evm", "frame-support", @@ -5435,7 +5409,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "frame-support", "frame-system", @@ -5454,9 +5428,9 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "array-bytes", + "array-bytes 4.2.0", "binary-merkle-tree", "frame-support", "frame-system", @@ -5478,7 +5452,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "frame-benchmarking", "frame-support", @@ -5565,7 +5539,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "ethereum", "ethereum-types", @@ -5588,7 +5562,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "environmental", "evm", @@ -5613,7 +5587,7 @@ dependencies = [ [[package]] name = "pallet-evm-chain-id" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "frame-support", "frame-system", @@ -5624,7 +5598,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-blake2" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "fp-evm", ] @@ -5632,7 +5606,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-bn128" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "fp-evm", "sp-core", @@ -5642,7 +5616,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "fp-evm", "num", @@ -5651,7 +5625,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-sha3fips" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "fp-evm", "tiny-keccak", @@ -5660,7 +5634,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "fp-evm", "ripemd", @@ -5686,7 +5660,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "frame-benchmarking", "frame-support", @@ -5709,7 +5683,7 @@ dependencies = [ [[package]] name = "pallet-hotfix-sufficients" version = "1.0.0" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.43#9fd5782120bb808a2fa5b7bf3aaa065396b17b80" dependencies = [ "frame-benchmarking", "frame-support", @@ -5725,7 +5699,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "frame-benchmarking", "frame-support", @@ -5753,10 +5727,25 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-root-testing" +version = "1.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "frame-support", "frame-system", @@ -5807,8 +5796,9 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "parity-scale-codec", @@ -5837,7 +5827,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "frame-benchmarking", "frame-support", @@ -5855,7 +5845,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "frame-support", "frame-system", @@ -5871,7 +5861,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5887,7 +5877,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -6144,6 +6134,12 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "partial_sort" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7924d1d0ad836f665c9065e26d016c673ece3993f30d340068b16f282afc1156" + [[package]] name = "paste" version = "1.0.14" @@ -6551,7 +6547,7 @@ dependencies = [ "macrotest", "num_enum 0.5.11", "precompile-utils", - "prettyplease", + "prettyplease 0.1.25", "proc-macro2", "quote", "sha3 0.10.8", @@ -6660,6 +6656,16 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "prettyplease" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +dependencies = [ + "proc-macro2", + "syn 2.0.38", +] + [[package]] name = "primitive-types" version = "0.12.2" @@ -6744,25 +6750,25 @@ dependencies = [ [[package]] name = "prometheus-client" -version = "0.18.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83cd1b99916654a69008fd66b4f9397fbe08e6e51dfe23d4417acf5d3b8cb87c" +checksum = "5d6fa99d535dd930d1249e6c79cb3c2915f9172a540fe2b02a4c8f9ca954721e" dependencies = [ "dtoa", "itoa", "parking_lot 0.12.1", - "prometheus-client-derive-text-encode", + "prometheus-client-derive-encode", ] [[package]] -name = "prometheus-client-derive-text-encode" -version = "0.3.0" +name = "prometheus-client-derive-encode" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66a455fbcb954c1a7decf3c586e860fd7889cddf4b8e164be736dbac95a953cd" +checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.38", ] [[package]] @@ -6788,7 +6794,7 @@ dependencies = [ "log", "multimap", "petgraph", - "prettyplease", + "prettyplease 0.1.25", "prost", "prost-types", "regex", @@ -6797,19 +6803,6 @@ dependencies = [ "which", ] -[[package]] -name = "prost-codec" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc34979ff898b6e141106178981ce2596c387ea6e62533facfc61a37fc879c0" -dependencies = [ - "asynchronous-codec", - "bytes", - "prost", - "thiserror", - "unsigned-varint", -] - [[package]] name = "prost-derive" version = "0.11.9" @@ -6856,6 +6849,19 @@ dependencies = [ "byteorder", ] +[[package]] +name = "quick-protobuf-codec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1693116345026436eb2f10b677806169c1a1260c1c60eaaffe3fb5a29ae23d8b" +dependencies = [ + "asynchronous-codec", + "bytes", + "quick-protobuf", + "thiserror", + "unsigned-varint", +] + [[package]] name = "quicksink" version = "0.1.2" @@ -7091,9 +7097,9 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300d4fbfb40c1c66a78ba3ddd41c1110247cf52f97b87d0f2fc9209bd49b030c" +checksum = "80535183cae11b149d618fbd3c37e38d7cda589d82d7769e196ca9a9042d7621" dependencies = [ "fxhash", "log", @@ -7145,18 +7151,6 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" -[[package]] -name = "region" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" -dependencies = [ - "bitflags 1.3.2", - "libc", - "mach", - "winapi", -] - [[package]] name = "reqwest" version = "0.11.22" @@ -7288,9 +7282,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "015439787fce1e75d55f279078d33ff14b4af5d93d995e8838ee4631301c8a99" +checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe" dependencies = [ "libc", "librocksdb-sys", @@ -7553,7 +7547,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "log", "sp-core", @@ -7564,7 +7558,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -7579,7 +7573,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "memmap2", "sc-chain-spec-derive", @@ -7598,7 +7592,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -7609,14 +7603,14 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "array-bytes", + "array-bytes 4.2.0", "chrono", "clap", "fdlimit", "futures", - "libp2p", + "libp2p-identity", "log", "names", "parity-scale-codec", @@ -7649,7 +7643,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "fnv", "futures", @@ -7668,6 +7662,7 @@ dependencies = [ "sp-keystore", "sp-runtime", "sp-state-machine", + "sp-statement-store", "sp-storage", "substrate-prometheus-endpoint", ] @@ -7675,7 +7670,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "hash-db 0.16.0", "kvdb", @@ -7701,12 +7696,12 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", "futures", "futures-timer", - "libp2p", + "libp2p-identity", "log", "mockall", "parking_lot 0.12.1", @@ -7726,7 +7721,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", "futures", @@ -7755,7 +7750,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", "fork-tree", @@ -7791,7 +7786,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "fork-tree", "parity-scale-codec", @@ -7804,10 +7799,10 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "ahash 0.8.3", - "array-bytes", + "array-bytes 4.2.0", "async-trait", "dyn-clone", "finality-grandpa", @@ -7844,11 +7839,12 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "assert_matches", "async-trait", "futures", + "futures-timer", "jsonrpsee", "log", "parity-scale-codec", @@ -7878,7 +7874,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", "futures", @@ -7901,13 +7897,12 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "lru", + "lru 0.8.1", "parity-scale-codec", "parking_lot 0.12.1", "sc-executor-common", - "sc-executor-wasmi", "sc-executor-wasmtime", "sp-api", "sp-core", @@ -7919,39 +7914,24 @@ dependencies = [ "sp-version", "sp-wasm-interface", "tracing", - "wasmi", ] [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", "sp-wasm-interface", "thiserror", "wasm-instrument", - "wasmi", -] - -[[package]] -name = "sc-executor-wasmi" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "log", - "sc-allocator", - "sc-executor-common", - "sp-runtime-interface", - "sp-wasm-interface", - "wasmi", ] [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "anyhow", "cfg-if", @@ -7969,7 +7949,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "ansi_term", "futures", @@ -7985,10 +7965,9 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "array-bytes", - "async-trait", + "array-bytes 4.2.0", "parking_lot 0.12.1", "serde_json", "sp-application-crypto", @@ -8000,9 +7979,9 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "array-bytes", + "array-bytes 4.2.0", "async-channel", "async-trait", "asynchronous-codec", @@ -8015,7 +7994,7 @@ dependencies = [ "libp2p", "linked_hash_set", "log", - "lru", + "lru 0.8.1", "mockall", "parity-scale-codec", "parking_lot 0.12.1", @@ -8045,11 +8024,12 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ + "async-channel", "cid", "futures", - "libp2p", + "libp2p-identity", "log", "prost", "prost-build", @@ -8065,15 +8045,15 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "array-bytes", + "array-bytes 4.2.0", "async-trait", "bitflags 1.3.2", "bytes", "futures", "futures-timer", - "libp2p", + "libp2p-identity", "parity-scale-codec", "prost-build", "sc-consensus", @@ -8093,14 +8073,14 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "ahash 0.8.3", "futures", "futures-timer", "libp2p", "log", - "lru", + "lru 0.8.1", "sc-network", "sc-network-common", "sc-peerset", @@ -8112,11 +8092,12 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "array-bytes", + "array-bytes 4.2.0", + "async-channel", "futures", - "libp2p", + "libp2p-identity", "log", "parity-scale-codec", "prost", @@ -8134,16 +8115,17 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "array-bytes", + "array-bytes 4.2.0", + "async-channel", "async-trait", "fork-tree", "futures", "futures-timer", "libp2p", "log", - "lru", + "lru 0.8.1", "mockall", "parity-scale-codec", "prost", @@ -8168,9 +8150,9 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "array-bytes", + "array-bytes 4.2.0", "futures", "libp2p", "log", @@ -8188,9 +8170,9 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "array-bytes", + "array-bytes 4.2.0", "bytes", "fnv", "futures", @@ -8219,20 +8201,23 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "futures", - "libp2p", + "libp2p-identity", "log", + "parking_lot 0.12.1", + "partial_sort", "sc-utils", "serde_json", + "sp-arithmetic", "wasm-timer", ] [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -8241,7 +8226,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "futures", "jsonrpsee", @@ -8264,6 +8249,7 @@ dependencies = [ "sp-rpc", "sp-runtime", "sp-session", + "sp-statement-store", "sp-version", "tokio", ] @@ -8271,7 +8257,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -8290,7 +8276,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "http", "jsonrpsee", @@ -8305,9 +8291,9 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "array-bytes", + "array-bytes 4.2.0", "futures", "futures-util", "hex", @@ -8331,7 +8317,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", "directories", @@ -8397,7 +8383,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "log", "parity-scale-codec", @@ -8408,7 +8394,7 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "clap", "fs4", @@ -8424,7 +8410,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "futures", "libc", @@ -8443,7 +8429,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "chrono", "futures", @@ -8462,7 +8448,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "ansi_term", "atty", @@ -8493,7 +8479,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8504,7 +8490,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", "futures", @@ -8531,7 +8517,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", "futures", @@ -8545,7 +8531,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-channel", "futures", @@ -9080,7 +9066,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "hash-db 0.16.0", "log", @@ -9100,7 +9086,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "Inflector", "blake2", @@ -9114,7 +9100,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "parity-scale-codec", "scale-info", @@ -9127,7 +9113,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "integer-sqrt", "num-traits", @@ -9141,7 +9127,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "parity-scale-codec", "sp-api", @@ -9153,11 +9139,11 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "futures", "log", - "lru", + "lru 0.8.1", "parity-scale-codec", "parking_lot 0.12.1", "sp-api", @@ -9171,7 +9157,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", "futures", @@ -9186,7 +9172,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", "parity-scale-codec", @@ -9204,7 +9190,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", "parity-scale-codec", @@ -9225,7 +9211,7 @@ dependencies = [ [[package]] name = "sp-consensus-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "lazy_static", "parity-scale-codec", @@ -9244,7 +9230,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "finality-grandpa", "log", @@ -9262,7 +9248,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "parity-scale-codec", "scale-info", @@ -9274,9 +9260,9 @@ dependencies = [ [[package]] name = "sp-core" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "array-bytes", + "array-bytes 4.2.0", "bitflags 1.3.2", "blake2", "bounded-collections", @@ -9318,7 +9304,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "blake2b_simd", "byteorder", @@ -9332,7 +9318,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "proc-macro2", "quote", @@ -9343,7 +9329,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -9352,7 +9338,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "proc-macro2", "quote", @@ -9362,7 +9348,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "environmental", "parity-scale-codec", @@ -9373,7 +9359,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -9388,7 +9374,7 @@ dependencies = [ [[package]] name = "sp-io" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "bytes", "ed25519 1.5.3", @@ -9414,7 +9400,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "lazy_static", "sp-core", @@ -9425,7 +9411,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "futures", "parity-scale-codec", @@ -9439,7 +9425,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "thiserror", "zstd 0.12.4", @@ -9448,7 +9434,7 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -9459,7 +9445,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -9477,7 +9463,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "sp-api", "sp-core", @@ -9487,7 +9473,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "backtrace", "lazy_static", @@ -9497,7 +9483,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "rustc-hash", "serde", @@ -9507,7 +9493,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "either", "hash256-std-hasher", @@ -9529,7 +9515,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -9547,7 +9533,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "Inflector", "proc-macro-crate", @@ -9559,7 +9545,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "parity-scale-codec", "scale-info", @@ -9573,7 +9559,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "parity-scale-codec", "scale-info", @@ -9586,7 +9572,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "hash-db 0.16.0", "log", @@ -9603,15 +9589,33 @@ dependencies = [ "tracing", ] +[[package]] +name = "sp-statement-store" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "log", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-externalities", + "sp-runtime", + "sp-runtime-interface", + "sp-std", + "thiserror", +] + [[package]] name = "sp-std" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" [[package]] name = "sp-storage" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9624,7 +9628,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", "futures-timer", @@ -9639,7 +9643,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "parity-scale-codec", "sp-std", @@ -9651,7 +9655,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "sp-api", "sp-runtime", @@ -9660,7 +9664,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", "log", @@ -9676,7 +9680,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "ahash 0.8.3", "hash-db 0.16.0", @@ -9699,7 +9703,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9716,7 +9720,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -9727,7 +9731,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -9741,7 +9745,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "parity-scale-codec", "scale-info", @@ -10125,102 +10129,6 @@ dependencies = [ "substrate-wasm-builder", ] -[[package]] -name = "stability-test-client" -version = "1.0.0" -dependencies = [ - "array-bytes", - "async-trait", - "futures", - "parity-scale-codec", - "sc-client-api", - "sc-client-db", - "sc-consensus", - "sc-executor", - "sc-offchain", - "sc-service", - "serde", - "serde_json", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-keyring", - "sp-keystore", - "sp-runtime", - "sp-state-machine", -] - -[[package]] -name = "stability-test-runtime" -version = "1.0.0" -dependencies = [ - "cfg-if", - "frame-support", - "frame-system", - "frame-system-rpc-runtime-api", - "futures", - "log", - "memory-db", - "pallet-babe", - "pallet-beefy-mmr", - "pallet-ethereum", - "pallet-timestamp", - "pallet-zero-gas-transactions", - "parity-scale-codec", - "sc-block-builder", - "sc-executor", - "sc-service", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto", - "sp-block-builder", - "sp-consensus", - "sp-consensus-aura", - "sp-consensus-babe", - "sp-consensus-beefy", - "sp-consensus-grandpa", - "sp-core", - "sp-externalities", - "sp-inherents", - "sp-io", - "sp-keyring", - "sp-offchain", - "sp-runtime", - "sp-runtime-interface", - "sp-session", - "sp-state-machine", - "sp-std", - "sp-transaction-pool", - "sp-trie", - "sp-version", - "stability-test-runtime-client", - "stbl-core-primitives", - "stbl-primitives-fee-compatible-api", - "stbl-primitives-zero-gas-transactions-api", - "substrate-wasm-builder", - "trie-db", -] - -[[package]] -name = "stability-test-runtime-client" -version = "1.0.0" -dependencies = [ - "futures", - "parity-scale-codec", - "sc-block-builder", - "sc-chain-spec", - "sc-client-api", - "sc-consensus", - "sp-api", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-runtime", - "stability-test-client", - "stability-test-runtime", -] - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -10292,7 +10200,6 @@ dependencies = [ "sp-keystore", "sp-runtime", "stability-runtime", - "stability-test-runtime-client", "stbl-primitives-fee-compatible-api", "stbl-primitives-zero-gas-transactions-api", "stbl-tools", @@ -10455,7 +10362,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "platforms 2.0.0", ] @@ -10463,7 +10370,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -10482,7 +10389,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "hyper", "log", @@ -10494,9 +10401,9 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "array-bytes", + "array-bytes 4.2.0", "async-trait", "futures", "parity-scale-codec", @@ -10520,16 +10427,20 @@ dependencies = [ [[package]] name = "substrate-test-runtime" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "cfg-if", + "array-bytes 6.1.0", + "frame-executive", "frame-support", "frame-system", "frame-system-rpc-runtime-api", "log", "memory-db", "pallet-babe", + "pallet-balances", "pallet-beefy-mmr", + "pallet-root-testing", + "pallet-sudo", "pallet-timestamp", "parity-scale-codec", "sc-service", @@ -10543,6 +10454,7 @@ dependencies = [ "sp-consensus-beefy", "sp-consensus-grandpa", "sp-core", + "sp-debug-derive", "sp-externalities", "sp-inherents", "sp-io", @@ -10563,7 +10475,7 @@ dependencies = [ [[package]] name = "substrate-test-runtime-client" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "futures", "parity-scale-codec", @@ -10583,7 +10495,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "ansi_term", "build-helper", @@ -10978,11 +10890,11 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.3.5" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" +checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", "bytes", "futures-core", "futures-util", @@ -11515,9 +11427,9 @@ dependencies = [ [[package]] name = "wasm-opt" -version = "0.111.0" +version = "0.112.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a303793cbc01fb96551badfc7367db6007396bba6bac97936b3c8b6f7fdb41" +checksum = "87fef6d0d508f08334e0ab0e6877feb4c0ecb3956bcf2cb950699b22fedf3e9c" dependencies = [ "anyhow", "libc", @@ -11531,9 +11443,9 @@ dependencies = [ [[package]] name = "wasm-opt-cxx-sys" -version = "0.111.0" +version = "0.112.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c9deb56f8a9f2ec177b3bd642a8205621835944ed5da55f2388ef216aca5a4" +checksum = "bc816bbc1596c8f2e8127e137a760c798023ef3d378f2ae51f0f1840e2dfa445" dependencies = [ "anyhow", "cxx", @@ -11543,15 +11455,14 @@ dependencies = [ [[package]] name = "wasm-opt-sys" -version = "0.111.0" +version = "0.112.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4432e28b542738a9776cedf92e8a99d8991c7b4667ee2c7ccddfb479dd2856a7" +checksum = "40199e4f68ef1071b3c6d0bd8026a12b481865d4b9e49c156932ea9a6234dd14" dependencies = [ "anyhow", "cc", "cxx", "cxx-build", - "regex", ] [[package]] @@ -11600,14 +11511,13 @@ dependencies = [ "memory_units", "num-rational", "num-traits", - "region", ] [[package]] name = "wasmparser" -version = "0.100.0" +version = "0.102.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64b20236ab624147dfbb62cf12a19aaf66af0e41b8398838b66e997d07d269d4" +checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" dependencies = [ "indexmap 1.9.3", "url", @@ -11615,9 +11525,9 @@ dependencies = [ [[package]] name = "wasmtime" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a222f5fa1e14b2cefc286f1b68494d7a965f4bf57ec04c59bb62673d639af6" +checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" dependencies = [ "anyhow", "bincode", @@ -11625,7 +11535,7 @@ dependencies = [ "indexmap 1.9.3", "libc", "log", - "object 0.29.0", + "object 0.30.4", "once_cell", "paste", "psm", @@ -11638,26 +11548,26 @@ dependencies = [ "wasmtime-environ", "wasmtime-jit", "wasmtime-runtime", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-asm-macros" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4407a7246e7d2f3d8fb1cf0c72fda8dbafdb6dd34d555ae8bea0e5ae031089cc" +checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ceb3adf61d654be0be67fffdce42447b0880481348785be5fe40b5dd7663a4c" +checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" dependencies = [ "anyhow", - "base64 0.13.1", + "base64 0.21.4", "bincode", "directories-next", "file-per-thread-logger", @@ -11666,15 +11576,15 @@ dependencies = [ "serde", "sha2 0.10.8", "toml 0.5.11", - "windows-sys 0.42.0", + "windows-sys 0.45.0", "zstd 0.11.2+zstd.1.5.2", ] [[package]] name = "wasmtime-cranelift" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c366bb8647e01fd08cb5589976284b00abfded5529b33d7e7f3f086c68304a4" +checksum = "b1cefde0cce8cb700b1b21b6298a3837dba46521affd7b8c38a9ee2c869eee04" dependencies = [ "anyhow", "cranelift-codegen", @@ -11682,27 +11592,43 @@ dependencies = [ "cranelift-frontend", "cranelift-native", "cranelift-wasm", - "gimli 0.26.2", + "gimli 0.27.3", "log", - "object 0.29.0", + "object 0.30.4", "target-lexicon", "thiserror", "wasmparser", + "wasmtime-cranelift-shared", + "wasmtime-environ", +] + +[[package]] +name = "wasmtime-cranelift-shared" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd041e382ef5aea1b9fc78442394f1a4f6d676ce457e7076ca4cb3f397882f8b" +dependencies = [ + "anyhow", + "cranelift-codegen", + "cranelift-native", + "gimli 0.27.3", + "object 0.30.4", + "target-lexicon", "wasmtime-environ", ] [[package]] name = "wasmtime-environ" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b8b50962eae38ee319f7b24900b7cf371f03eebdc17400c1dc8575fc10c9a7" +checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" dependencies = [ "anyhow", "cranelift-entity", - "gimli 0.26.2", + "gimli 0.27.3", "indexmap 1.9.3", "log", - "object 0.29.0", + "object 0.30.4", "serde", "target-lexicon", "thiserror", @@ -11712,18 +11638,18 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffaed4f9a234ba5225d8e64eac7b4a5d13b994aeb37353cde2cbeb3febda9eaa" +checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" dependencies = [ - "addr2line 0.17.0", + "addr2line 0.19.0", "anyhow", "bincode", "cfg-if", "cpp_demangle", - "gimli 0.26.2", + "gimli 0.27.3", "log", - "object 0.29.0", + "object 0.30.4", "rustc-demangle", "serde", "target-lexicon", @@ -11731,36 +11657,36 @@ dependencies = [ "wasmtime-jit-debug", "wasmtime-jit-icache-coherence", "wasmtime-runtime", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-jit-debug" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed41cbcbf74ce3ff6f1d07d1b707888166dc408d1a880f651268f4f7c9194b2" +checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" dependencies = [ - "object 0.29.0", + "object 0.30.4", "once_cell", "rustix 0.36.16", ] [[package]] name = "wasmtime-jit-icache-coherence" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a28ae1e648461bfdbb79db3efdaee1bca5b940872e4175390f465593a2e54c" +checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" dependencies = [ "cfg-if", "libc", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-runtime" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e704b126e4252788ccfc3526d4d4511d4b23c521bf123e447ac726c14545217b" +checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" dependencies = [ "anyhow", "cc", @@ -11770,21 +11696,21 @@ dependencies = [ "log", "mach", "memfd", - "memoffset 0.6.5", + "memoffset 0.8.0", "paste", "rand 0.8.5", "rustix 0.36.16", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-types" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83e5572c5727c1ee7e8f28717aaa8400e4d22dcbd714ea5457d85b5005206568" +checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" dependencies = [ "cranelift-entity", "serde", @@ -12117,21 +12043,6 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-sys" version = "0.45.0" @@ -12354,8 +12265,8 @@ dependencies = [ [[package]] name = "xcm" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?tag=v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?tag=v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" dependencies = [ "bounded-collections", "derivative", @@ -12369,8 +12280,8 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "0.9.42" -source = "git+https://github.com/paritytech/polkadot?tag=v0.9.42#9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?tag=v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" dependencies = [ "Inflector", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index fdf02da0..8891475a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,9 +33,6 @@ members = [ 'pallets/root-controller', 'stability-rpc', 'client/authorship', - 'test-utils/stability-client', - 'test-utils/stability-runtime', - 'test-utils/stability-runtime-client', 'primitives/core', 'primitives/account', 'primitives/transaction-validator', @@ -63,7 +60,7 @@ ethereum = { version = "0.14.0", default-features = false } ethereum-types = { version = "0.14.1", default-features = false } evm = { git = "https://github.com/rust-blockchain/evm", rev = "b7b82c7e1fc57b7449d6dfa6826600de37cc1e65", default-features = false } jsonrpsee = "0.16.2" -kvdb-rocksdb = "0.18.0" +kvdb-rocksdb = "0.19.0" libsecp256k1 = { version = "0.7.1", default-features = false } hex = { version = "0.4.3", default-features = false, features = ["alloc"] } parity-db = "0.4.8" @@ -71,7 +68,7 @@ rlp = { version = "0.5", default-features = false } scale-codec = { package = "parity-scale-codec", version = "3.2.1", default-features = false, features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } -serde = { version = "1.0.101", default-features = false } +serde = { version = "1.0", default-features = false, features = ["derive", "alloc"] } serde_json = "1.0" futures = "0.3.28" futures-timer = "3.0.1" @@ -90,118 +87,118 @@ sqlx = { version = "0.7.0-alpha.3", default-features = false, features = ["macro thiserror = "1.0" tokio = "1.28.2" # Polkadot -xcm = { git = "https://github.com/paritytech/polkadot", tag = "v0.9.42", default-features = false } +xcm = { git = "https://github.com/paritytech/polkadot", tag = "v0.9.43", default-features = false } # Substrate Client -sc-block-builder = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-chain-spec = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-client-db = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-consensus-manual-seal = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-consensus-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-network-common = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-network-sync = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-proposer-metrics = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"} -sc-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-block-builder = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sc-chain-spec = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sc-client-db = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sc-consensus-manual-seal = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sc-consensus-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sc-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sc-network-common = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sc-network-sync = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sc-proposer-metrics = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43"} +sc-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } # Substrate Primitive -sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-consensus-beefy = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-database = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-consensus-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-keyring = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-state-machine = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-storage = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-trie = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-version = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-keystore = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -beefy-primitives = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", package = "sp-beefy", branch = "polkadot-v0.9.42" } -sp-application-crypto = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-consensus-babe = { version = "0.10.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-externalities = { version = "0.13.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-runtime-interface = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sp-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +sp-consensus-beefy = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +sp-core = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +sp-database = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sp-consensus-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +sp-io = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +sp-keyring = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sp-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +sp-runtime = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +sp-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +sp-state-machine = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +sp-std = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +sp-storage = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +sp-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +sp-trie = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +sp-version = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +sp-keystore = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +beefy-primitives = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", package = "sp-beefy", branch = "polkadot-v0.9.43" } +sp-application-crypto = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sp-consensus-babe = { version = "0.10.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sp-externalities = { version = "0.13.0", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sp-runtime-interface = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } # Substrate FRAME -frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-executive = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-aura = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-sudo = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-transaction-payment = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-transaction-payment-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-utility = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-collective = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-babe = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-beefy-mmr = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +frame-executive = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +frame-system-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +frame-system-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +pallet-aura = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +pallet-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +pallet-sudo = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +pallet-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +pallet-transaction-payment = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +pallet-transaction-payment-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +pallet-utility = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +pallet-collective = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +pallet-babe = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +pallet-beefy-mmr = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +pallet-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } # Substrate Utility -frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-staking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sp-staking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } # Frontier Client -fc-cli = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } -fc-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42" } -fc-db = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } -fc-mapping-sync = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42" } -fc-rpc = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42" } -fc-rpc-core = { version = "1.1.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42" } -fc-storage = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42" } +fc-cli = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", default-features = false } +fc-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43" } +fc-db = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", default-features = false } +fc-mapping-sync = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43" } +fc-rpc = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43" } +fc-rpc-core = { version = "1.1.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43" } +fc-storage = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43" } # Frontier Primitive -fp-account = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } -fp-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } -fp-ethereum = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } -fp-evm = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } -fp-rpc = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } -fp-self-contained = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } -fp-storage = { version = "2.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } +fp-account = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", default-features = false } +fp-consensus = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", default-features = false } +fp-ethereum = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", default-features = false } +fp-evm = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", default-features = false } +fp-rpc = { version = "3.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", default-features = false } +fp-self-contained = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", default-features = false } +fp-storage = { version = "2.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", default-features = false } # Frontier FRAME -pallet-base-fee = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } -pallet-ethereum = { version = "4.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } -pallet-evm = { version = "6.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } -pallet-evm-chain-id = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } -pallet-evm-precompile-modexp = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } -pallet-evm-precompile-sha3fips = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } -pallet-evm-precompile-simple = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } -pallet-evm-test-vector-support = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } -pallet-hotfix-sufficients = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } +pallet-base-fee = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", default-features = false } +pallet-ethereum = { version = "4.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", default-features = false } +pallet-evm = { version = "6.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", default-features = false } +pallet-evm-chain-id = { version = "1.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", default-features = false } +pallet-evm-precompile-modexp = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", default-features = false } +pallet-evm-precompile-sha3fips = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", default-features = false } +pallet-evm-precompile-simple = { version = "2.0.0-dev", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", default-features = false } +pallet-evm-test-vector-support = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", default-features = false } +pallet-hotfix-sufficients = { version = "1.0.0", git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", default-features = false } # Stability Client stbl-cli-authorship = { version = "1.0.0", path = './client/authorship' } # Stability -pallet-evm-precompile-blake2 = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } -pallet-evm-precompile-bn128 = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.42", default-features = false } +pallet-evm-precompile-blake2 = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", default-features = false } +pallet-evm-precompile-bn128 = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", default-features = false } precompile-utils = { path = "./precompiles/utils", default-features = false } precompile-fee-token-selector = { path = "./precompiles/token-fee-controller/fee-token-selector", default-features = false } precompile-validator-fee-selector = { path = "./precompiles/token-fee-controller/validator-fee-selector", default-features = false } @@ -221,9 +218,6 @@ pallet-fee-rewards-vault = { path = "./pallets/fee-rewards-vault", default-featu precompile-fee-rewards-vault-controller = { path = "./precompiles/fee-rewards-vault-controller", default-features = false } precompile-upgrade-runtime-controller = { path = "./precompiles/upgrade-runtime-controller", default-features = false } # Stability Test -stability-test-client = { path = "./test-utils/stability-client", default-features = false } -stability-test-runtime = { path = "./test-utils/stability-runtime", default-features = false } -stability-test-runtime-client = { path = "./test-utils/stability-runtime-client" } pallet-user-fee-selector = { path = "./pallets/token-fee-controller/user-fee-selector", default-features = false } pallet-validator-fee-selector = { path = "./pallets/token-fee-controller/validator-fee-selector", default-features = false } pallet-supported-tokens-manager = { path = "./pallets/token-fee-controller/supported-tokens-manager", default-features = false } diff --git a/client/authorship/Cargo.toml b/client/authorship/Cargo.toml index 39c055a2..7ffdb84b 100644 --- a/client/authorship/Cargo.toml +++ b/client/authorship/Cargo.toml @@ -44,5 +44,4 @@ hex = { workspace = true } [dev-dependencies] parking_lot = { workspace = true } -sc-transaction-pool = { workspace = true } -stability-test-runtime-client = { workspace = true } \ No newline at end of file +sc-transaction-pool = { workspace = true } \ No newline at end of file diff --git a/client/authorship/src/authorship.rs b/client/authorship/src/authorship.rs index ebd192d8..74ab187f 100644 --- a/client/authorship/src/authorship.rs +++ b/client/authorship/src/authorship.rs @@ -796,788 +796,4 @@ where storage_changes, }) } -} - -#[cfg(test)] -mod tests { - use super::*; - - use futures::executor::block_on; - use parking_lot::Mutex; - use sc_client_api::Backend; - use sc_transaction_pool::BasicPool; - use sc_transaction_pool_api::{ChainEvent, MaintainedTransactionPool, TransactionSource}; - use sp_api::Core; - use sp_blockchain::HeaderBackend; - use sp_consensus::{BlockOrigin, Environment, Proposer}; - use sp_core::Pair; - use sp_runtime::traits::NumberFor; - use stability_test_runtime_client::{ - prelude::*, - runtime::{Extrinsic, Transfer}, - TestClientBuilder, TestClientBuilderExt, - }; - - const SOURCE: TransactionSource = TransactionSource::External; - - fn extrinsic_included(nonce: u64) -> Extrinsic { - Transfer { - amount: Default::default(), - nonce, - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Bob.into(), - } - .into_signed_tx() - } - - fn extrinsic_skipped(value: u32) -> Extrinsic { - Extrinsic::Skipped(value) - } - - fn exhausts_resources_extrinsic_from(who: usize) -> Extrinsic { - let pair = AccountKeyring::numeric(who); - let transfer = Transfer { - // increase the amount to bump priority - amount: 1, - nonce: 0, - from: pair.public(), - to: AccountKeyring::Bob.into(), - }; - let signature = pair.sign(&transfer.encode()).into(); - Extrinsic::Transfer { - transfer, - signature, - exhaust_resources_when_not_first: true, - } - } - - fn chain_event(header: B::Header) -> ChainEvent - where - NumberFor: From, - { - ChainEvent::NewBestBlock { - hash: header.hash(), - tree_route: None, - } - } - - #[test] - fn should_cease_building_block_when_deadline_is_reached() { - // given - let client = Arc::new(stability_test_runtime_client::new()); - let spawner = sp_core::testing::TaskExecutor::new(); - let txpool = BasicPool::new_full( - Default::default(), - true.into(), - None, - spawner.clone(), - client.clone(), - ); - - block_on(txpool.submit_at( - &BlockId::number(0), - SOURCE, - vec![extrinsic_included(0), extrinsic_included(1)], - )) - .unwrap(); - - block_on( - txpool.maintain(chain_event( - client - .expect_header(BlockId::Hash(client.info().genesis_hash)) - .expect("there should be header"), - )), - ); - - let keystore_config = sc_service::config::KeystoreConfig::InMemory; - let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); - - Keystore::ecdsa_generate_new( - &*keystore_container.sync_keystore().clone(), - KeyTypeId::try_from("aura").unwrap(), - Some("//Alice"), - ) - .expect("Creates authority key"); - - let mut proposer_factory = ProposerFactory::new( - spawner.clone(), - client.clone(), - txpool.clone(), - keystore_container.sync_keystore(), - None, - None, - None, - ); - - let cell = Mutex::new((false, time::Instant::now())); - let proposer = proposer_factory.init_with_now( - &client - .expect_header(BlockId::Hash(client.info().genesis_hash)) - .unwrap(), - Box::new(move || { - let mut value = cell.lock(); - if !value.0 { - value.0 = true; - return value.1; - } - let old = value.1; - let new = old + time::Duration::from_secs(1); - *value = (true, new); - old - }), - ); - - // when - let deadline = time::Duration::from_secs(3); - let block = - block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) - .map(|r| r.block) - .unwrap(); - - // then - // block should have some extrinsics although we have some more in the pool. - assert_eq!(block.extrinsics().len(), 1); - assert_eq!(txpool.ready().count(), 2); - } - - #[test] - fn should_not_panic_when_deadline_is_reached() { - let client = Arc::new(stability_test_runtime_client::new()); - let spawner = sp_core::testing::TaskExecutor::new(); - let txpool = BasicPool::new_full( - Default::default(), - true.into(), - None, - spawner.clone(), - client.clone(), - ); - - let keystore_config = sc_service::config::KeystoreConfig::InMemory; - let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); - - Keystore::ecdsa_generate_new( - &*keystore_container.sync_keystore().clone(), - KeyTypeId::try_from("aura").unwrap(), - Some("//Alice"), - ) - .expect("Creates authority key"); - - let mut proposer_factory = ProposerFactory::new( - spawner.clone(), - client.clone(), - txpool.clone(), - keystore_container.sync_keystore(), - None, - None, - None, - ); - - let cell = Mutex::new((false, time::Instant::now())); - let proposer = proposer_factory.init_with_now( - &client - .expect_header(BlockId::Hash(client.info().genesis_hash)) - .unwrap(), - Box::new(move || { - let mut value = cell.lock(); - if !value.0 { - value.0 = true; - return value.1; - } - let new = value.1 + time::Duration::from_secs(160); - *value = (true, new); - new - }), - ); - - let deadline = time::Duration::from_secs(1); - block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) - .map(|r| r.block) - .unwrap(); - } - - #[test] - fn proposed_storage_changes_should_match_execute_block_storage_changes() { - let (client, backend) = TestClientBuilder::new().build_with_backend(); - let client = Arc::new(client); - let spawner = sp_core::testing::TaskExecutor::new(); - let txpool = BasicPool::new_full( - Default::default(), - true.into(), - None, - spawner.clone(), - client.clone(), - ); - - let genesis_hash = client.info().best_hash; - - block_on(txpool.submit_at(&BlockId::number(0), SOURCE, vec![extrinsic_included(0)])) - .unwrap(); - - block_on( - txpool.maintain(chain_event( - client - .expect_header(BlockId::number(0)) - .expect("there should be header"), - )), - ); - - let keystore_config = sc_service::config::KeystoreConfig::InMemory; - let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); - - Keystore::ecdsa_generate_new( - &*keystore_container.sync_keystore().clone(), - KeyTypeId::try_from("aura").unwrap(), - Some("//Alice"), - ) - .expect("Creates authority key"); - - let mut proposer_factory = ProposerFactory::new( - spawner.clone(), - client.clone(), - txpool.clone(), - keystore_container.sync_keystore(), - None, - None, - None, - ); - - let proposer = proposer_factory.init_with_now( - &client - .header(&BlockId::Hash(client.info().genesis_hash)) - .unwrap() - .unwrap(), - Box::new(move || time::Instant::now()), - ); - - let deadline = time::Duration::from_secs(9); - let proposal = - block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) - .unwrap(); - - assert_eq!(proposal.block.extrinsics().len(), 1); - - let api = client.runtime_api(); - api.execute_block(genesis_hash, proposal.block) - .unwrap(); - - let state = backend.state_at(genesis_hash).unwrap(); - - let storage_changes = api.into_storage_changes(&state, genesis_hash).unwrap(); - - assert_eq!( - proposal.storage_changes.transaction_storage_root, - storage_changes.transaction_storage_root, - ); - } - - #[test] - fn should_not_remove_invalid_transactions_when_skipping() { - // given - let mut client = Arc::new(stability_test_runtime_client::new()); - let spawner = sp_core::testing::TaskExecutor::new(); - let txpool = BasicPool::new_full( - Default::default(), - true.into(), - None, - spawner.clone(), - client.clone(), - ); - - block_on(txpool.submit_at( - &BlockId::number(0), - SOURCE, - vec![ - extrinsic_included(0), - extrinsic_included(1), - Transfer { - amount: Default::default(), - nonce: 2, - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Bob.into(), - }.into_resources_exhausting_tx(), - extrinsic_included(3), - Transfer { - amount: Default::default(), - nonce: 4, - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Bob.into(), - }.into_resources_exhausting_tx(), - extrinsic_included(5), - extrinsic_included(6), - ], - )) - .unwrap(); - - let keystore_config = sc_service::config::KeystoreConfig::InMemory; - let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); - - Keystore::ecdsa_generate_new( - &*keystore_container.sync_keystore().clone(), - KeyTypeId::try_from("aura").unwrap(), - Some("//Alice"), - ) - .expect("Creates authority key"); - - let mut proposer_factory = ProposerFactory::new( - spawner.clone(), - client.clone(), - txpool.clone(), - keystore_container.sync_keystore(), - None, - None, - None, - ); - - let mut propose_block = |client: &TestClient, - number, - expected_block_extrinsics, - expected_pool_transactions| { - let hash = client - .expect_block_hash_from_id(&BlockId::Number(number)) - .unwrap(); - let proposer = proposer_factory.init_with_now( - &client.expect_header(BlockId::Hash(hash)).unwrap(), - Box::new(move || time::Instant::now()), - ); - - // when - let deadline = time::Duration::from_secs(900); - let block = - block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) - .map(|r| r.block) - .unwrap(); - - // then - // block should have some extrinsics although we have some more in the pool. - assert_eq!(txpool.ready().count(), expected_pool_transactions); - assert_eq!(block.extrinsics().len(), expected_block_extrinsics); - - block - }; - - block_on( - txpool.maintain(chain_event( - client - .expect_header(BlockId::Hash(client.info().genesis_hash)) - .expect("there should be header"), - )), - ); - assert_eq!(txpool.ready().count(), 7); - - // let's create one block and import it - let block = propose_block(&client, 0, 2, 7); - let hashof1 = block.hash(); - block_on(client.import(BlockOrigin::Own, block)).unwrap(); - - block_on( - txpool.maintain(chain_event( - client - .expect_header(BlockId::Hash(hashof1)) - .expect("there should be header"), - )), - ); - assert_eq!(txpool.ready().count(), 5); - - // now let's make sure that we can still make some progress - let block = propose_block(&client, 1, 2, 5); - block_on(client.import(BlockOrigin::Own, block)).unwrap(); - } - - #[test] - fn should_cease_building_block_when_block_limit_is_reached() { - let client = Arc::new(stability_test_runtime_client::new()); - let spawner = sp_core::testing::TaskExecutor::new(); - let txpool = BasicPool::new_full( - Default::default(), - true.into(), - None, - spawner.clone(), - client.clone(), - ); - let genesis_header = client - .expect_header(BlockId::Hash(client.info().genesis_hash)) - .expect("there should be header"); - - let extrinsics_num = 5; - let extrinsics = std::iter::once( - Transfer { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Bob.into(), - amount: 100, - nonce: 0, - } - .into_signed_tx(), - ) - .chain((0..extrinsics_num - 1).map(|v| Extrinsic::IncludeData(vec![v as u8; 10]))) - .collect::>(); - - let block_limit = genesis_header.encoded_size() - + extrinsics - .iter() - .take(extrinsics_num - 1) - .map(Encode::encoded_size) - .sum::() - + Vec::::new().encoded_size(); - - block_on(txpool.submit_at(&BlockId::number(0), SOURCE, extrinsics)).unwrap(); - - block_on(txpool.maintain(chain_event(genesis_header.clone()))); - - let keystore_config = sc_service::config::KeystoreConfig::InMemory; - let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); - - Keystore::ecdsa_generate_new( - &*keystore_container.sync_keystore().clone(), - KeyTypeId::try_from("aura").unwrap(), - Some("//Alice"), - ) - .expect("Creates authority key"); - - let mut proposer_factory = ProposerFactory::new( - spawner.clone(), - client.clone(), - txpool.clone(), - keystore_container.sync_keystore(), - None, - None, - None, - ); - - let proposer = block_on(proposer_factory.init(&genesis_header)).unwrap(); - - // Give it enough time - let deadline = time::Duration::from_secs(300); - let block = block_on(proposer.propose( - Default::default(), - Default::default(), - deadline, - Some(block_limit), - )) - .map(|r| r.block) - .unwrap(); - - // Based on the block limit, one transaction shouldn't be included. - assert_eq!(block.extrinsics().len(), extrinsics_num - 1); - - let proposer = block_on(proposer_factory.init(&genesis_header)).unwrap(); - - let block = - block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) - .map(|r| r.block) - .unwrap(); - - // Without a block limit we should include all of them - assert_eq!(block.extrinsics().len(), extrinsics_num); - - let mut proposer_factory = ProposerFactory::with_proof_recording( - spawner.clone(), - client.clone(), - txpool.clone(), - keystore_container.sync_keystore(), - None, - None, - None, - ); - let proposer = block_on(proposer_factory.init(&genesis_header)).unwrap(); - - // Give it enough time - let block = block_on(proposer.propose( - Default::default(), - Default::default(), - deadline, - Some(block_limit), - )) - .map(|r| r.block) - .unwrap(); - - // The block limit didn't changed, but we now include the proof in the estimation of the - // block size and thus, only the `Transfer` will fit into the block. It reads more data - // than we have reserved in the block limit. - assert_eq!(block.extrinsics().len(), 1); - } - - #[test] - fn should_keep_adding_transactions_after_exhausts_resources_before_soft_deadline() { - // given - let client = Arc::new(stability_test_runtime_client::new()); - let spawner = sp_core::testing::TaskExecutor::new(); - let txpool = BasicPool::new_full( - Default::default(), - true.into(), - None, - spawner.clone(), - client.clone(), - ); - - block_on( - txpool.submit_at( - &BlockId::number(0), - SOURCE, - // add 2 * MAX_SKIPPED_TRANSACTIONS that exhaust resources - (0..MAX_SKIPPED_TRANSACTIONS * 2) - .into_iter() - .map(|i| exhausts_resources_extrinsic_from(i)) - // and some transactions that are okay. - .chain( - (0..MAX_SKIPPED_TRANSACTIONS) - .into_iter() - .map(|i| extrinsic_included(i as _)), - ) - .collect(), - ), - ) - .unwrap(); - - block_on( - txpool.maintain(chain_event( - client - .expect_header(BlockId::Hash(client.info().genesis_hash)) - .expect("there should be header"), - )), - ); - assert_eq!(txpool.ready().count(), MAX_SKIPPED_TRANSACTIONS * 3); - - let keystore_config = sc_service::config::KeystoreConfig::InMemory; - let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); - - Keystore::ecdsa_generate_new( - &*keystore_container.sync_keystore().clone(), - KeyTypeId::try_from("aura").unwrap(), - Some("//Alice"), - ) - .expect("Creates authority key"); - - let mut proposer_factory = ProposerFactory::new( - spawner.clone(), - client.clone(), - txpool.clone(), - keystore_container.sync_keystore(), - None, - None, - None, - ); - - let cell = Mutex::new(time::Instant::now()); - let proposer = proposer_factory.init_with_now( - &client - .expect_header(BlockId::Hash(client.info().genesis_hash)) - .unwrap(), - Box::new(move || { - let mut value = cell.lock(); - let old = *value; - *value = old + time::Duration::from_secs(1); - old - }), - ); - - // when - // give it enough time so that deadline is never triggered. - let deadline = time::Duration::from_secs(900); - let block = - block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) - .map(|r| r.block) - .unwrap(); - - // then block should have all non-exhaust resources extrinsics (+ the first one). - assert_eq!(block.extrinsics().len(), MAX_SKIPPED_TRANSACTIONS + 1); - } - - #[test] - fn should_only_skip_up_to_some_limit_after_soft_deadline() { - // given - let client = Arc::new(stability_test_runtime_client::new()); - let spawner = sp_core::testing::TaskExecutor::new(); - let txpool = BasicPool::new_full( - Default::default(), - true.into(), - None, - spawner.clone(), - client.clone(), - ); - - block_on( - txpool.submit_at( - &BlockId::number(0), - SOURCE, - (0..MAX_SKIPPED_TRANSACTIONS + 2) - .into_iter() - .map(|i| exhausts_resources_extrinsic_from(i)) - // and some transactions that are okay. - .chain( - (0..MAX_SKIPPED_TRANSACTIONS) - .into_iter() - .map(|i| extrinsic_included(i as _)), - ) - .collect(), - ), - ) - .unwrap(); - - block_on( - txpool.maintain(chain_event( - client - .expect_header(BlockId::Hash(client.info().genesis_hash)) - .expect("there should be header"), - )), - ); - assert_eq!(txpool.ready().count(), MAX_SKIPPED_TRANSACTIONS * 2 + 2); - - let keystore_config = sc_service::config::KeystoreConfig::InMemory; - let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); - - Keystore::ecdsa_generate_new( - &*keystore_container.sync_keystore().clone(), - KeyTypeId::try_from("aura").unwrap(), - Some("//Alice"), - ) - .expect("Creates authority key"); - - let mut proposer_factory = ProposerFactory::new( - spawner.clone(), - client.clone(), - txpool.clone(), - keystore_container.sync_keystore(), - None, - None, - None, - ); - - let deadline = time::Duration::from_secs(600); - let cell = Arc::new(Mutex::new((0, time::Instant::now()))); - let cell2 = cell.clone(); - let proposer = proposer_factory.init_with_now( - &client - .expect_header(BlockId::Hash(client.info().genesis_hash)) - .unwrap(), - Box::new(move || { - let mut value = cell.lock(); - let (called, old) = *value; - // add time after deadline is calculated internally (hence 1) - let increase = if called == 1 { - // we start after the soft_deadline should have already been reached. - deadline / 2 - } else { - // but we make sure to never reach the actual deadline - time::Duration::from_millis(0) - }; - *value = (called + 1, old + increase); - old - }), - ); - - let block = - block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) - .map(|r| r.block) - .unwrap(); - - // then the block should have no transactions despite some in the pool - assert_eq!(block.extrinsics().len(), 1); - assert!( - cell2.lock().0 > MAX_SKIPPED_TRANSACTIONS, - "Not enough calls to current time, which indicates the test might have ended because of deadline, not soft deadline" - ); - } - - #[test] - fn should_skip_transactions_if_runtime_is_compatible_fee_return_false() { - // given - let client = Arc::new(stability_test_runtime_client::new()); - let spawner = sp_core::testing::TaskExecutor::new(); - let txpool = BasicPool::new_full( - Default::default(), - true.into(), - None, - spawner.clone(), - client.clone(), - ); - let genesis_header = client - .expect_header(BlockId::Hash(client.info().genesis_hash)) - .expect("there should be header"); - - let extrinsics = vec![extrinsic_skipped(0), extrinsic_included(0)]; - - block_on(txpool.submit_at(&BlockId::number(0), SOURCE, extrinsics)).unwrap(); - - block_on(txpool.maintain(chain_event(genesis_header.clone()))); - - let keystore_config = sc_service::config::KeystoreConfig::InMemory; - let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); - - Keystore::ecdsa_generate_new( - &*keystore_container.sync_keystore().clone(), - KeyTypeId::try_from("aura").unwrap(), - Some("//Alice"), - ) - .expect("Creates authority key"); - - let mut proposer_factory = ProposerFactory::new( - spawner.clone(), - client.clone(), - txpool.clone(), - keystore_container.sync_keystore(), - None, - None, - None, - ); - - let proposer = block_on(proposer_factory.init(&genesis_header)).unwrap(); - - let deadline = time::Duration::from_secs(300); - let block = - block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) - .map(|r| r.block) - .unwrap(); - - assert_eq!(block.extrinsics().len(), 1); - - let extrinsic_in_block = &block.extrinsics()[0]; - - if let Extrinsic::Skipped(_) = extrinsic_in_block { - panic!("Skipped extrinsic should not be in block") - } - } - - #[test] - #[should_panic = "called `Result::unwrap()` on an `Err` value: OneShotCancelled(Canceled)"] - fn should_panic_if_not_find_aura_key() { - let client = Arc::new(stability_test_runtime_client::new()); - let spawner = sp_core::testing::TaskExecutor::new(); - let txpool = BasicPool::new_full( - Default::default(), - true.into(), - None, - spawner.clone(), - client.clone(), - ); - let genesis_header = client - .expect_header(BlockId::Hash(client.info().genesis_hash)) - .expect("there should be header"); - - let extrinsics = vec![extrinsic_skipped(0), extrinsic_included(0)]; - - block_on(txpool.submit_at(&BlockId::number(0), SOURCE, extrinsics)).unwrap(); - - block_on(txpool.maintain(chain_event(genesis_header.clone()))); - - let keystore_config = sc_service::config::KeystoreConfig::InMemory; - let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); - - let mut proposer_factory = ProposerFactory::new( - spawner.clone(), - client.clone(), - txpool.clone(), - keystore_container.sync_keystore(), - None, - None, - None, - ); - - let proposer = block_on(proposer_factory.init(&genesis_header)).unwrap(); - - let deadline = time::Duration::from_secs(300); - - block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) - .map(|r| r.block) - .unwrap(); - } -} +} \ No newline at end of file diff --git a/node/src/eth.rs b/node/src/eth.rs index afd192a8..04574f7c 100644 --- a/node/src/eth.rs +++ b/node/src/eth.rs @@ -10,7 +10,7 @@ use futures::{future, prelude::*}; use sc_client_api::{BlockchainEvents, StateBackendFor}; use sc_executor::NativeExecutionDispatch; use sc_network_sync::SyncingService; -use sc_service::{error::Error as ServiceError, BasePath, Configuration, TaskManager}; +use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; use sp_api::ConstructRuntimeApi; use sp_runtime::traits::BlakeTwo256; // Frontier @@ -27,14 +27,7 @@ use crate::client::{FullBackend, FullClient}; pub type FrontierBackend = fc_db::Backend; pub fn db_config_dir(config: &Configuration) -> PathBuf { - let application = &config.impl_name; - config - .base_path - .as_ref() - .map(|base_path| base_path.config_dir(config.chain_spec.id())) - .unwrap_or_else(|| { - BasePath::from_project("", "", application).config_dir(config.chain_spec.id()) - }) + config.base_path.config_dir(config.chain_spec.id()) } /// Avalailable frontier backend types. diff --git a/node/src/service.rs b/node/src/service.rs index 7d3d26a4..874e77d7 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -313,6 +313,8 @@ where fee_history_cache_limit, } = new_frontier_partial(ð_config)?; + let mut net_config = sc_network::config::FullNetworkConfiguration::new(&config.network); + let grandpa_protocol_name = sc_consensus_grandpa::protocol_standard_name( &client.block_hash(0)?.expect("Genesis block exists; qed"), &config.chain_spec, @@ -321,12 +323,10 @@ where let warp_sync_params = if sealing.is_some() { None } else { - config - .network - .extra_sets - .push(sc_consensus_grandpa::grandpa_peers_set_config( - grandpa_protocol_name.clone(), - )); + net_config.add_notification_protocol(sc_consensus_grandpa::grandpa_peers_set_config( + grandpa_protocol_name.clone(), + )); + let warp_sync: Arc> = Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new( backend.clone(), @@ -339,6 +339,7 @@ where let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) = sc_service::build_network(sc_service::BuildNetworkParams { config: &config, + net_config, client: client.clone(), transaction_pool: transaction_pool.clone(), spawn_handle: task_manager.spawn_handle(), diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index d215e58c..d2e04191 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -64,7 +64,10 @@ use pallet_grandpa::{ use fp_evm::weight_per_gas; use fp_rpc::TransactionStatus; use pallet_ethereum::{Call::transact, PostLogContent, Transaction as EthereumTransaction}; -use pallet_evm::{Account as EVMAccount, FeeCalculator, Runner, GasWeightMapping}; +use pallet_evm::{ + Account as EVMAccount, EnsureAccountId20, FeeCalculator, GasWeightMapping, + Runner +}; use pallet_sponsored_transactions::Call::send_sponsored_transaction; use pallet_validator_set::SessionBlockManager; // A few exports that help ease life for downstream crates. @@ -485,7 +488,7 @@ impl pallet_evm::Config for Runtime { type FindAuthor = FindAuthorLinkedOrTruncated; type GasLimitPovSizeRatio = GasLimitPovSizeRatio; type Timestamp = Timestamp; - type WeightInfo = pallet_evm::weights::SubstrateWeight; + type WeightInfo = pallet_evm::weights::SubstrateWeight; } parameter_types! { @@ -550,7 +553,7 @@ impl pallet_base_fee::Config for Runtime { impl pallet_hotfix_sufficients::Config for Runtime { type AddressMapping = IdentityAddressMapping; - type WeightInfo = pallet_hotfix_sufficients::weights::SubstrateWeight; + type WeightInfo = pallet_hotfix_sufficients::weights::SubstrateWeight; } parameter_types! { @@ -570,7 +573,7 @@ impl pallet_collective::Config for Runtime { type MaxProposals = CouncilMaxProposals; type MaxMembers = CouncilMaxMembers; type DefaultVote = pallet_collective::PrimeDefaultVote; - type WeightInfo = pallet_collective::weights::SubstrateWeight; + type WeightInfo = pallet_collective::weights::SubstrateWeight; type SetMembersOrigin = EnsureRootOrHalfTechCommittee; type MaxProposalWeight = MaxProposalWeight; } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index bdf5e384..8445d0e9 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,8 +1,8 @@ [toolchain] # Stable -#channel = "1.68.2" # rustc 1.68.2 (9eb3afe9e 2023-03-27) +#channel = "1.69.0" # rustc 1.69.0 (84c898d65 2023-04-16) # Nightly -channel = "nightly-2022-11-16" # rustc 1.67.0-nightly (a00f8ba7f 2022-11-15) +channel = "nightly-2023-05-23" # rustc 1.71.0-nightly (8b4b20836 2023-05-22) components = ["rustfmt", "clippy"] targets = ["wasm32-unknown-unknown"] profile = "minimal" \ No newline at end of file diff --git a/test-utils/stability-client/Cargo.toml b/test-utils/stability-client/Cargo.toml deleted file mode 100644 index 1fc0adfa..00000000 --- a/test-utils/stability-client/Cargo.toml +++ /dev/null @@ -1,32 +0,0 @@ -[package] -name = "stability-test-client" -description = "Client testing utilities" -version = "1.0.0" -authors = ["Stability Solutions"] -edition = "2021" -license = "GPL-3.0-or-later WITH Classpath-exception-2.0" -publish = false - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -array-bytes = { workspace = true } -async-trait = { workspace = true } -codec = { package = "parity-scale-codec", workspace = true } -futures = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } -sc-client-api = { workspace = true } -sc-client-db = { workspace = true, features = ["test-helpers"] } -sc-consensus = { workspace = true } -sc-executor = { workspace = true } -sc-offchain = { workspace = true } -sc-service = { workspace = true, default-features = false, features = ["test-helpers"]} -sp-blockchain ={ workspace = true } -sp-consensus = { workspace = true } -sp-core = { workspace = true } -sp-keyring = { workspace = true } -sp-keystore = { workspace = true } -sp-runtime = { workspace = true } -sp-state-machine = { workspace = true } diff --git a/test-utils/stability-client/src/client_ext.rs b/test-utils/stability-client/src/client_ext.rs deleted file mode 100644 index ca30dbde..00000000 --- a/test-utils/stability-client/src/client_ext.rs +++ /dev/null @@ -1,209 +0,0 @@ -// This file is part of Stability. - -// Copyright (C) 2018-2022 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Client extension for tests. - -use sc_client_api::{backend::Finalizer, client::BlockBackend}; -use sc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy}; -use sc_service::client::Client; -use sp_consensus::{BlockOrigin, Error as ConsensusError}; -use sp_runtime::{traits::Block as BlockT, Justification, Justifications}; - -/// Extension trait for a test client. -pub trait ClientExt: Sized { - /// Finalize a block. - fn finalize_block( - &self, - hash: Block::Hash, - justification: Option, - ) -> sp_blockchain::Result<()>; - - /// Returns hash of the genesis block. - fn genesis_hash(&self) -> ::Hash; -} - -/// Extension trait for a test client around block importing. -#[async_trait::async_trait] -pub trait ClientBlockImportExt: Sized { - /// Import block to the chain. No finality. - async fn import(&mut self, origin: BlockOrigin, block: Block) -> Result<(), ConsensusError>; - - /// Import a block and make it our best block if possible. - async fn import_as_best( - &mut self, - origin: BlockOrigin, - block: Block, - ) -> Result<(), ConsensusError>; - - /// Import a block and finalize it. - async fn import_as_final( - &mut self, - origin: BlockOrigin, - block: Block, - ) -> Result<(), ConsensusError>; - - /// Import block with justification(s), finalizes block. - async fn import_justified( - &mut self, - origin: BlockOrigin, - block: Block, - justifications: Justifications, - ) -> Result<(), ConsensusError>; -} - -impl ClientExt for Client -where - B: sc_client_api::backend::Backend, - E: sc_client_api::CallExecutor + sc_executor::RuntimeVersionOf + 'static, - Self: BlockImport, - Block: BlockT, -{ - fn finalize_block( - &self, - hash: Block::Hash, - justification: Option, - ) -> sp_blockchain::Result<()> { - Finalizer::finalize_block(self, hash, justification, true) - } - - fn genesis_hash(&self) -> ::Hash { - self.block_hash(0u32.into()).unwrap().unwrap() - } -} - -/// This implementation is required, because of the weird api requirements around `BlockImport`. -#[async_trait::async_trait] -impl ClientBlockImportExt for std::sync::Arc -where - for<'r> &'r T: BlockImport, - Transaction: Send + 'static, - T: Send + Sync, -{ - async fn import(&mut self, origin: BlockOrigin, block: Block) -> Result<(), ConsensusError> { - let (header, extrinsics) = block.deconstruct(); - let mut import = BlockImportParams::new(origin, header); - import.body = Some(extrinsics); - import.fork_choice = Some(ForkChoiceStrategy::LongestChain); - - BlockImport::import_block(self, import).await.map(|_| ()) - } - - async fn import_as_best( - &mut self, - origin: BlockOrigin, - block: Block, - ) -> Result<(), ConsensusError> { - let (header, extrinsics) = block.deconstruct(); - let mut import = BlockImportParams::new(origin, header); - import.body = Some(extrinsics); - import.fork_choice = Some(ForkChoiceStrategy::Custom(true)); - - BlockImport::import_block(self, import).await.map(|_| ()) - } - - async fn import_as_final( - &mut self, - origin: BlockOrigin, - block: Block, - ) -> Result<(), ConsensusError> { - let (header, extrinsics) = block.deconstruct(); - let mut import = BlockImportParams::new(origin, header); - import.body = Some(extrinsics); - import.finalized = true; - import.fork_choice = Some(ForkChoiceStrategy::Custom(true)); - - BlockImport::import_block(self, import).await.map(|_| ()) - } - - async fn import_justified( - &mut self, - origin: BlockOrigin, - block: Block, - justifications: Justifications, - ) -> Result<(), ConsensusError> { - let (header, extrinsics) = block.deconstruct(); - let mut import = BlockImportParams::new(origin, header); - import.justifications = Some(justifications); - import.body = Some(extrinsics); - import.finalized = true; - import.fork_choice = Some(ForkChoiceStrategy::LongestChain); - - BlockImport::import_block(self, import).await.map(|_| ()) - } -} - -#[async_trait::async_trait] -impl ClientBlockImportExt for Client -where - Self: BlockImport, - RA: Send, - B: Send + Sync, - E: Send, - >::Transaction: Send, -{ - async fn import(&mut self, origin: BlockOrigin, block: Block) -> Result<(), ConsensusError> { - let (header, extrinsics) = block.deconstruct(); - let mut import = BlockImportParams::new(origin, header); - import.body = Some(extrinsics); - import.fork_choice = Some(ForkChoiceStrategy::LongestChain); - - BlockImport::import_block(self, import).await.map(|_| ()) - } - - async fn import_as_best( - &mut self, - origin: BlockOrigin, - block: Block, - ) -> Result<(), ConsensusError> { - let (header, extrinsics) = block.deconstruct(); - let mut import = BlockImportParams::new(origin, header); - import.body = Some(extrinsics); - import.fork_choice = Some(ForkChoiceStrategy::Custom(true)); - - BlockImport::import_block(self, import).await.map(|_| ()) - } - - async fn import_as_final( - &mut self, - origin: BlockOrigin, - block: Block, - ) -> Result<(), ConsensusError> { - let (header, extrinsics) = block.deconstruct(); - let mut import = BlockImportParams::new(origin, header); - import.body = Some(extrinsics); - import.finalized = true; - import.fork_choice = Some(ForkChoiceStrategy::Custom(true)); - - BlockImport::import_block(self, import).await.map(|_| ()) - } - - async fn import_justified( - &mut self, - origin: BlockOrigin, - block: Block, - justifications: Justifications, - ) -> Result<(), ConsensusError> { - let (header, extrinsics) = block.deconstruct(); - let mut import = BlockImportParams::new(origin, header); - import.justifications = Some(justifications); - import.body = Some(extrinsics); - import.finalized = true; - import.fork_choice = Some(ForkChoiceStrategy::LongestChain); - - BlockImport::import_block(self, import).await.map(|_| ()) - } -} diff --git a/test-utils/stability-client/src/lib.rs b/test-utils/stability-client/src/lib.rs deleted file mode 100644 index 4d8bab34..00000000 --- a/test-utils/stability-client/src/lib.rs +++ /dev/null @@ -1,476 +0,0 @@ -// This file is part of Stability. - -// Copyright 2023 Stability Solutions. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Client testing utilities. - -#![warn(missing_docs)] - -pub mod client_ext; - -pub use self::client_ext::{ClientBlockImportExt, ClientExt}; -pub use sc_client_api::{ - execution_extensions::{ExecutionExtensions, ExecutionStrategies}, - BadBlocks, ForkBlocks, -}; -pub use sc_client_db::{self, Backend, BlocksPruning}; -pub use sc_executor::{self, NativeElseWasmExecutor, WasmExecutionMethod, WasmExecutor}; -pub use sc_service::{client, RpcHandlers}; -pub use sp_consensus; -pub use sp_keyring::{ - ed25519::Keyring as Ed25519Keyring, sr25519::Keyring as Sr25519Keyring, AccountKeyring, -}; -pub use sp_keystore::{Keystore, KeystorePtr}; -pub use sp_runtime::{Storage, StorageChild}; -pub use sp_state_machine::ExecutionStrategy; - -use futures::{future::Future, stream::StreamExt}; -use sc_client_api::BlockchainEvents; -use sc_service::client::{ClientConfig, LocalCallExecutor}; -use serde::Deserialize; -use sp_core::{storage::ChildInfo, testing::TaskExecutor}; -use sp_runtime::{codec::Encode, traits::Block as BlockT, OpaqueExtrinsic}; -use std::{ - collections::{HashMap, HashSet}, - pin::Pin, - sync::Arc, -}; - -/// A genesis storage initialization trait. -pub trait GenesisInit: Default { - /// Construct genesis storage. - fn genesis_storage(&self) -> Storage; -} - -impl GenesisInit for () { - fn genesis_storage(&self) -> Storage { - Default::default() - } -} - -/// A builder for creating a test client instance. -pub struct TestClientBuilder { - execution_strategies: ExecutionStrategies, - genesis_init: G, - /// The key is an unprefixed storage key, this only contains - /// default child trie content. - child_storage_extension: HashMap, StorageChild>, - backend: Arc, - _executor: std::marker::PhantomData, - keystore: Option, - fork_blocks: ForkBlocks, - bad_blocks: BadBlocks, - enable_offchain_indexing_api: bool, - no_genesis: bool, -} - -impl Default - for TestClientBuilder, G> -{ - fn default() -> Self { - Self::with_default_backend() - } -} - -impl - TestClientBuilder, G> -{ - /// Create new `TestClientBuilder` with default backend. - pub fn with_default_backend() -> Self { - let backend = Arc::new(Backend::new_test(std::u32::MAX, std::u64::MAX)); - Self::with_backend(backend) - } - - /// Create new `TestClientBuilder` with default backend and pruning window size - pub fn with_pruning_window(blocks_pruning: u32) -> Self { - let backend = Arc::new(Backend::new_test(blocks_pruning, 0)); - Self::with_backend(backend) - } - - /// Create new `TestClientBuilder` with default backend and storage chain mode - pub fn with_tx_storage(blocks_pruning: u32) -> Self { - let backend = - Arc::new(Backend::new_test_with_tx_storage(BlocksPruning::Some(blocks_pruning), 0)); - Self::with_backend(backend) - } -} - -impl - TestClientBuilder -{ - /// Create a new instance of the test client builder. - pub fn with_backend(backend: Arc) -> Self { - TestClientBuilder { - backend, - execution_strategies: ExecutionStrategies::default(), - child_storage_extension: Default::default(), - genesis_init: Default::default(), - _executor: Default::default(), - keystore: None, - fork_blocks: None, - bad_blocks: None, - enable_offchain_indexing_api: false, - no_genesis: false, - } - } - - /// Set the keystore that should be used by the externalities. - pub fn set_keystore(mut self, keystore: KeystorePtr) -> Self { - self.keystore = Some(keystore); - self - } - - /// Alter the genesis storage parameters. - pub fn genesis_init_mut(&mut self) -> &mut G { - &mut self.genesis_init - } - - /// Give access to the underlying backend of these clients - pub fn backend(&self) -> Arc { - self.backend.clone() - } - - /// Extend child storage - pub fn add_child_storage( - mut self, - child_info: &ChildInfo, - key: impl AsRef<[u8]>, - value: impl AsRef<[u8]>, - ) -> Self { - let storage_key = child_info.storage_key(); - let entry = self.child_storage_extension.entry(storage_key.to_vec()).or_insert_with(|| { - StorageChild { data: Default::default(), child_info: child_info.clone() } - }); - entry.data.insert(key.as_ref().to_vec(), value.as_ref().to_vec()); - self - } - - /// Set the execution strategy that should be used by all contexts. - pub fn set_execution_strategy(mut self, execution_strategy: ExecutionStrategy) -> Self { - self.execution_strategies = ExecutionStrategies { - syncing: execution_strategy, - importing: execution_strategy, - block_construction: execution_strategy, - offchain_worker: execution_strategy, - other: execution_strategy, - }; - self - } - - /// Sets custom block rules. - pub fn set_block_rules( - mut self, - fork_blocks: ForkBlocks, - bad_blocks: BadBlocks, - ) -> Self { - self.fork_blocks = fork_blocks; - self.bad_blocks = bad_blocks; - self - } - - /// Enable the offchain indexing api. - pub fn enable_offchain_indexing_api(mut self) -> Self { - self.enable_offchain_indexing_api = true; - self - } - - /// Disable writing genesis. - pub fn set_no_genesis(mut self) -> Self { - self.no_genesis = true; - self - } - - /// Build the test client with the given native executor. - pub fn build_with_executor( - self, - executor: ExecutorDispatch, - ) -> ( - client::Client, - sc_consensus::LongestChain, - ) - where - ExecutorDispatch: - sc_client_api::CallExecutor + sc_executor::RuntimeVersionOf + Clone + 'static, - Backend: sc_client_api::backend::Backend, - >::OffchainStorage: 'static, - { - let storage = { - let mut storage = self.genesis_init.genesis_storage(); - // Add some child storage keys. - for (key, child_content) in self.child_storage_extension { - storage.children_default.insert( - key, - StorageChild { - data: child_content.data.into_iter().collect(), - child_info: child_content.child_info, - }, - ); - } - - storage - }; - - let client_config = ClientConfig { - offchain_indexing_api: self.enable_offchain_indexing_api, - no_genesis: self.no_genesis, - ..Default::default() - }; - - let genesis_block_builder = sc_service::GenesisBlockBuilder::new( - &storage, - !client_config.no_genesis, - self.backend.clone(), - executor.clone(), - ) - .expect("Creates genesis block builder"); - - let spawn_handle = Box::new(TaskExecutor::new()); - - let client = client::Client::new( - self.backend.clone(), - executor, - spawn_handle, - genesis_block_builder, - self.fork_blocks, - self.bad_blocks, - None, - None, - client_config, - ) - .expect("Creates new client"); - - let longest_chain = sc_consensus::LongestChain::new(self.backend); - - (client, longest_chain) - } -} - -impl - TestClientBuilder< - Block, - client::LocalCallExecutor>, - Backend, - G, - > where - D: sc_executor::NativeExecutionDispatch, -{ - /// Build the test client with the given native executor. - pub fn build_with_native_executor( - self, - executor: I, - ) -> ( - client::Client< - Backend, - client::LocalCallExecutor>, - Block, - RuntimeApi, - >, - sc_consensus::LongestChain, - ) - where - I: Into>>, - D: sc_executor::NativeExecutionDispatch + 'static, - Backend: sc_client_api::backend::Backend + 'static, - { - let executor = executor.into().unwrap_or_else(|| { - NativeElseWasmExecutor::new(WasmExecutionMethod::Interpreted, None, 8, 2) - }); - let executor = LocalCallExecutor::new( - self.backend.clone(), - executor.clone(), - Default::default(), - ExecutionExtensions::new( - self.execution_strategies.clone(), - self.keystore.clone(), - sc_offchain::OffchainDb::factory_from_backend(&*self.backend), - Arc::new(executor), - ), - ) - .expect("Creates LocalCallExecutor"); - - self.build_with_executor(executor) - } -} - -/// The output of an RPC transaction. -pub struct RpcTransactionOutput { - /// The output string of the transaction if any. - pub result: String, - /// An async receiver if data will be returned via a callback. - pub receiver: futures::channel::mpsc::UnboundedReceiver, -} - -impl std::fmt::Debug for RpcTransactionOutput { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - write!(f, "RpcTransactionOutput {{ result: {:?}, receiver }}", self.result) - } -} - -/// An error for when the RPC call fails. -#[derive(Deserialize, Debug)] -pub struct RpcTransactionError { - /// A Number that indicates the error type that occurred. - pub code: i64, - /// A String providing a short description of the error. - pub message: String, - /// A Primitive or Structured value that contains additional information about the error. - pub data: Option, -} - -impl std::fmt::Display for RpcTransactionError { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - std::fmt::Debug::fmt(self, f) - } -} - -/// An extension trait for `RpcHandlers`. -#[async_trait::async_trait] -pub trait RpcHandlersExt { - /// Send a transaction through the RpcHandlers. - async fn send_transaction( - &self, - extrinsic: OpaqueExtrinsic, - ) -> Result; -} - -#[async_trait::async_trait] -impl RpcHandlersExt for RpcHandlers { - async fn send_transaction( - &self, - extrinsic: OpaqueExtrinsic, - ) -> Result { - let (result, rx) = self - .rpc_query(&format!( - r#"{{ - "jsonrpc": "2.0", - "method": "author_submitExtrinsic", - "params": ["0x{}"], - "id": 0 - }}"#, - array_bytes::bytes2hex("", &extrinsic.encode()) - )) - .await - .expect("valid JSON-RPC request object; qed"); - parse_rpc_result(result, rx) - } -} - -pub(crate) fn parse_rpc_result( - result: String, - receiver: futures::channel::mpsc::UnboundedReceiver, -) -> Result { - let json: serde_json::Value = - serde_json::from_str(&result).expect("the result can only be a JSONRPC string; qed"); - let error = json.as_object().expect("JSON result is always an object; qed").get("error"); - - if let Some(error) = error { - return Err(serde_json::from_value(error.clone()) - .expect("the JSONRPC result's error is always valid; qed")) - } - - Ok(RpcTransactionOutput { result, receiver }) -} - -/// An extension trait for `BlockchainEvents`. -pub trait BlockchainEventsExt -where - C: BlockchainEvents, - B: BlockT, -{ - /// Wait for `count` blocks to be imported in the node and then exit. This function will not - /// return if no blocks are ever created, thus you should restrict the maximum amount of time of - /// the test execution. - fn wait_for_blocks(&self, count: usize) -> Pin + Send>>; -} - -impl BlockchainEventsExt for C -where - C: BlockchainEvents, - B: BlockT, -{ - fn wait_for_blocks(&self, count: usize) -> Pin + Send>> { - assert!(count > 0, "'count' argument must be greater than 0"); - - let mut import_notification_stream = self.import_notification_stream(); - let mut blocks = HashSet::new(); - - Box::pin(async move { - while let Some(notification) = import_notification_stream.next().await { - if notification.is_new_best { - blocks.insert(notification.hash); - if blocks.len() == count { - break - } - } - } - }) - } -} - -#[cfg(test)] -mod tests { - #[test] - fn parses_error_properly() { - let (_, rx) = futures::channel::mpsc::unbounded(); - assert!(super::parse_rpc_result( - r#"{ - "jsonrpc": "2.0", - "result": 19, - "id": 1 - }"# - .to_string(), - rx - ) - .is_ok()); - - let (_, rx) = futures::channel::mpsc::unbounded(); - let error = super::parse_rpc_result( - r#"{ - "jsonrpc": "2.0", - "error": { - "code": -32601, - "message": "Method not found" - }, - "id": 1 - }"# - .to_string(), - rx, - ) - .unwrap_err(); - assert_eq!(error.code, -32601); - assert_eq!(error.message, "Method not found"); - assert!(error.data.is_none()); - - let (_, rx) = futures::channel::mpsc::unbounded(); - let error = super::parse_rpc_result( - r#"{ - "jsonrpc": "2.0", - "error": { - "code": -32601, - "message": "Method not found", - "data": 42 - }, - "id": 1 - }"# - .to_string(), - rx, - ) - .unwrap_err(); - assert_eq!(error.code, -32601); - assert_eq!(error.message, "Method not found"); - assert!(error.data.is_some()); - } -} diff --git a/test-utils/stability-runtime-client/Cargo.toml b/test-utils/stability-runtime-client/Cargo.toml deleted file mode 100644 index f1872629..00000000 --- a/test-utils/stability-runtime-client/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -name = "stability-test-runtime-client" -version = "1.0.0" -authors = ["Stability Solutions"] -edition = "2021" -license = "GPL-3.0-or-later WITH Classpath-exception-2.0" -publish = false - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -codec = { package = "parity-scale-codec", workspace = true } -futures = { workspace = true } -sc-block-builder = { workspace = true } -sc-chain-spec = { workspace = true } -sc-client-api = { workspace = true } -sc-consensus = { workspace = true } -sp-api = { workspace = true } -sp-blockchain = { workspace = true } -sp-consensus = { workspace = true } -sp-core = { workspace = true } -sp-runtime = { workspace = true } -stability-test-client = { workspace = true } -stability-test-runtime = { workspace = true, features = ["std"] } diff --git a/test-utils/stability-runtime-client/src/block_builder_ext.rs b/test-utils/stability-runtime-client/src/block_builder_ext.rs deleted file mode 100644 index b5c668c2..00000000 --- a/test-utils/stability-runtime-client/src/block_builder_ext.rs +++ /dev/null @@ -1,65 +0,0 @@ -// This file is part of Stability. - -// Copyright (C) 2018-2022 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Block Builder extensions for tests. - -use sc_client_api::backend; -use sp_api::{ApiExt, ProvideRuntimeApi}; - -use sc_block_builder::BlockBuilderApi; - -/// Extension trait for test block builder. -pub trait BlockBuilderExt { - /// Add transfer extrinsic to the block. - fn push_transfer( - &mut self, - transfer: stability_test_runtime::Transfer, - ) -> Result<(), sp_blockchain::Error>; - /// Add storage change extrinsic to the block. - fn push_storage_change( - &mut self, - key: Vec, - value: Option>, - ) -> Result<(), sp_blockchain::Error>; -} - -impl<'a, A, B> BlockBuilderExt - for sc_block_builder::BlockBuilder<'a, stability_test_runtime::Block, A, B> -where - A: ProvideRuntimeApi + 'a, - A::Api: BlockBuilderApi - + ApiExt< - stability_test_runtime::Block, - StateBackend = backend::StateBackendFor, - >, - B: backend::Backend, -{ - fn push_transfer( - &mut self, - transfer: stability_test_runtime::Transfer, - ) -> Result<(), sp_blockchain::Error> { - self.push(transfer.into_signed_tx()) - } - - fn push_storage_change( - &mut self, - key: Vec, - value: Option>, - ) -> Result<(), sp_blockchain::Error> { - self.push(stability_test_runtime::Extrinsic::StorageChange(key, value)) - } -} diff --git a/test-utils/stability-runtime-client/src/lib.rs b/test-utils/stability-runtime-client/src/lib.rs deleted file mode 100644 index 2d272485..00000000 --- a/test-utils/stability-runtime-client/src/lib.rs +++ /dev/null @@ -1,300 +0,0 @@ -// This file is part of Stability. - -// Copyright (C) 2018-2022 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Client testing utilities. - -#![warn(missing_docs)] - -mod block_builder_ext; - -pub use sc_consensus::LongestChain; -pub use stability_test_client::*; -pub use stability_test_runtime as runtime; -use std::sync::Arc; - -pub use self::block_builder_ext::BlockBuilderExt; - -use sc_chain_spec::construct_genesis_block; -use sp_api::StateVersion; - -use sp_core::{sr25519, storage::ChildInfo, Pair}; -use sp_runtime::traits::{Block as BlockT, Hash as HashT, Header as HeaderT}; -use stability_test_runtime::genesismap::{additional_storage_with_genesis, GenesisConfig}; - -/// A prelude to import in tests. -pub mod prelude { - // Trait extensions - pub use super::{ - BlockBuilderExt, ClientBlockImportExt, ClientExt, DefaultTestClientBuilderExt, - TestClientBuilderExt, - }; - // Client structs - pub use super::{ - Backend, ExecutorDispatch, LocalExecutorDispatch, NativeElseWasmExecutor, TestClient, - TestClientBuilder, WasmExecutionMethod, - }; - // Keyring - pub use super::{AccountKeyring, Sr25519Keyring}; -} - -/// A unit struct which implements `NativeExecutionDispatch` feeding in the -/// hard-coded runtime. -pub struct LocalExecutorDispatch; - -impl sc_executor::NativeExecutionDispatch for LocalExecutorDispatch { - type ExtendHostFunctions = (); - - fn dispatch(method: &str, data: &[u8]) -> Option> { - stability_test_runtime::api::dispatch(method, data) - } - - fn native_version() -> sc_executor::NativeVersion { - stability_test_runtime::native_version() - } -} - -/// Test client database backend. -pub type Backend = stability_test_client::Backend; - -/// Test client executor. -pub type ExecutorDispatch = client::LocalCallExecutor< - stability_test_runtime::Block, - Backend, - NativeElseWasmExecutor, ->; - -/// Parameters of test-client builder with test-runtime. -#[derive(Default)] -pub struct GenesisParameters { - heap_pages_override: Option, - extra_storage: Storage, - wasm_code: Option>, -} - -impl GenesisParameters { - fn genesis_config(&self) -> GenesisConfig { - GenesisConfig::new( - vec![ - sr25519::Public::from(Sr25519Keyring::Alice).into(), - sr25519::Public::from(Sr25519Keyring::Bob).into(), - sr25519::Public::from(Sr25519Keyring::Charlie).into(), - ], - (0..16_usize) - .into_iter() - .map(|i| AccountKeyring::numeric(i).public()) - .chain(vec![ - AccountKeyring::Alice.into(), - AccountKeyring::Bob.into(), - AccountKeyring::Charlie.into(), - ]) - .collect(), - 1000, - self.heap_pages_override, - self.extra_storage.clone(), - ) - } - - /// Set the wasm code that should be used at genesis. - pub fn set_wasm_code(&mut self, code: Vec) { - self.wasm_code = Some(code); - } - - /// Access extra genesis storage. - pub fn extra_storage(&mut self) -> &mut Storage { - &mut self.extra_storage - } -} - -impl GenesisInit for GenesisParameters { - fn genesis_storage(&self) -> Storage { - use codec::Encode; - - let mut storage = self.genesis_config().genesis_map(); - - if let Some(ref code) = self.wasm_code { - storage.top.insert( - sp_core::storage::well_known_keys::CODE.to_vec(), - code.clone(), - ); - } - - let child_roots = storage.children_default.values().map(|child_content| { - let state_root = - <<::Header as HeaderT>::Hashing as HashT>::trie_root( - child_content.data.clone().into_iter().collect(), - sp_runtime::StateVersion::V1, - ); - let prefixed_storage_key = child_content.child_info.prefixed_storage_key(); - (prefixed_storage_key.into_inner(), state_root.encode()) - }); - let state_root = - <<::Header as HeaderT>::Hashing as HashT>::trie_root( - storage.top.clone().into_iter().chain(child_roots).collect(), - sp_runtime::StateVersion::V1, - ); - let block: runtime::Block = construct_genesis_block(state_root, StateVersion::V1); - storage.top.extend(additional_storage_with_genesis(&block)); - - storage - } -} - -/// A `TestClient` with `test-runtime` builder. -pub type TestClientBuilder = stability_test_client::TestClientBuilder< - stability_test_runtime::Block, - E, - B, - GenesisParameters, ->; - -/// Test client type with `LocalExecutorDispatch` and generic Backend. -pub type Client = client::Client< - B, - client::LocalCallExecutor< - stability_test_runtime::Block, - B, - sc_executor::NativeElseWasmExecutor, - >, - stability_test_runtime::Block, - stability_test_runtime::RuntimeApi, ->; - -/// A test client with default backend. -pub type TestClient = Client; - -/// A `TestClientBuilder` with default backend and executor. -pub trait DefaultTestClientBuilderExt: Sized { - /// Create new `TestClientBuilder` - fn new() -> Self; -} - -impl DefaultTestClientBuilderExt for TestClientBuilder { - fn new() -> Self { - Self::with_default_backend() - } -} - -/// A `test-runtime` extensions to `TestClientBuilder`. -pub trait TestClientBuilderExt: Sized { - /// Returns a mutable reference to the genesis parameters. - fn genesis_init_mut(&mut self) -> &mut GenesisParameters; - - /// Override the default value for Wasm heap pages. - fn set_heap_pages(mut self, heap_pages: u64) -> Self { - self.genesis_init_mut().heap_pages_override = Some(heap_pages); - self - } - - /// Add an extra value into the genesis storage. - /// - /// # Panics - /// - /// Panics if the key is empty. - fn add_extra_child_storage>, V: Into>>( - mut self, - child_info: &ChildInfo, - key: K, - value: V, - ) -> Self { - let storage_key = child_info.storage_key().to_vec(); - let key = key.into(); - assert!(!storage_key.is_empty()); - assert!(!key.is_empty()); - self.genesis_init_mut() - .extra_storage - .children_default - .entry(storage_key) - .or_insert_with(|| StorageChild { - data: Default::default(), - child_info: child_info.clone(), - }) - .data - .insert(key, value.into()); - self - } - - /// Add an extra child value into the genesis storage. - /// - /// # Panics - /// - /// Panics if the key is empty. - fn add_extra_storage>, V: Into>>(mut self, key: K, value: V) -> Self { - let key = key.into(); - assert!(!key.is_empty()); - self.genesis_init_mut() - .extra_storage - .top - .insert(key, value.into()); - self - } - - /// Build the test client. - fn build(self) -> Client { - self.build_with_longest_chain().0 - } - - /// Build the test client and longest chain selector. - fn build_with_longest_chain( - self, - ) -> ( - Client, - sc_consensus::LongestChain, - ); - - /// Build the test client and the backend. - fn build_with_backend(self) -> (Client, Arc); -} - -impl TestClientBuilderExt - for TestClientBuilder< - client::LocalCallExecutor< - stability_test_runtime::Block, - B, - NativeElseWasmExecutor, - >, - B, - > where - B: sc_client_api::backend::Backend + 'static, -{ - fn genesis_init_mut(&mut self) -> &mut GenesisParameters { - Self::genesis_init_mut(self) - } - - fn build_with_longest_chain( - self, - ) -> ( - Client, - sc_consensus::LongestChain, - ) { - self.build_with_native_executor(None) - } - - fn build_with_backend(self) -> (Client, Arc) { - let backend = self.backend(); - (self.build_with_native_executor(None).0, backend) - } -} - -/// Creates new client instance used for tests. -pub fn new() -> Client { - TestClientBuilder::new().build() -} - -/// Create a new native executor. -pub fn new_native_executor() -> NativeElseWasmExecutor { - NativeElseWasmExecutor::new(sc_executor::WasmExecutionMethod::Interpreted, None, 8, 2) -} \ No newline at end of file diff --git a/test-utils/stability-runtime/Cargo.toml b/test-utils/stability-runtime/Cargo.toml deleted file mode 100644 index e8b8b50c..00000000 --- a/test-utils/stability-runtime/Cargo.toml +++ /dev/null @@ -1,111 +0,0 @@ -[package] -name = "stability-test-runtime" -version = "1.0.0" -authors = ["Stability Solutions"] -edition = "2021" -license = "GPL-3.0-or-later WITH Classpath-exception-2.0" -build = "build.rs" -publish = false - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - - -[dependencies] -pallet-beefy-mmr = { workspace = true } -sp-application-crypto = { workspace = true } -sp-consensus-aura = { workspace = true } -sp-consensus-beefy = { workspace = true } -sp-consensus-babe = { workspace = true } -sp-block-builder = { workspace = true } -codec = { package = "parity-scale-codec", workspace = true, features = ["derive"] } -scale-info = { workspace = true, features = ["derive"] } -sp-inherents = { workspace = true } -sp-keyring = { workspace = true, optional = true } -memory-db = { workspace = true } -sp-offchain = { workspace = true } -sp-core = { workspace = true } -sp-std ={ workspace = true } -sp-runtime-interface = { workspace = true } -sp-io = { workspace = true } -frame-support = { workspace = true } -sp-version = { workspace = true } -sp-session = { workspace = true } -sp-api = { workspace = true } -sp-runtime = { workspace = true } -pallet-babe = { workspace = true } -frame-system = { workspace = true } -frame-system-rpc-runtime-api = { workspace = true } -pallet-timestamp = { workspace = true } -sp-consensus-grandpa = { workspace = true } -sp-trie = { workspace = true } -sp-transaction-pool = { workspace = true } -trie-db = { workspace = true } -sc-service = { workspace=true, optional = true, features = ["test-helpers"] } -sp-state-machine = { workspace = true } -sp-externalities = { workspace = true } -stbl-primitives-fee-compatible-api = { workspace = true } -stbl-primitives-zero-gas-transactions-api = { workspace = true } -pallet-zero-gas-transactions = { workspace = true } -pallet-ethereum = { workspace = true } -# 3rd party -cfg-if = { workspace = true } -log = { workspace = true } -serde = { workspace = true, optional = true, features = ["derive"] } -stbl-core-primitives = { workspace = true } - -[dev-dependencies] -sc-block-builder = { workspace = true } -sc-executor = { workspace = true } -sp-consensus = { workspace = true } -stability-test-runtime-client = { workspace = true } -futures = { workspace = true } - -[build-dependencies] -substrate-wasm-builder = { workspace = true, optional = true } - -[features] -default = [ - "std", -] -std = [ - "pallet-beefy-mmr/std", - "sp-application-crypto/std", - "sp-consensus-aura/std", - "sp-consensus-babe/std", - "sp-consensus-beefy/std", - "sp-block-builder/std", - "codec/std", - "scale-info/std", - "sp-inherents/std", - "sp-keyring", - "log/std", - "memory-db/std", - "sp-offchain/std", - "sp-core/std", - "sp-core/std", - "sp-std/std", - "sp-runtime-interface/std", - "sp-io/std", - "frame-support/std", - "sp-version/std", - "serde", - "sp-session/std", - "sp-api/std", - "sp-runtime/std", - "sp-externalities/std", - "sp-state-machine/std", - "pallet-babe/std", - "frame-system-rpc-runtime-api/std", - "frame-system/std", - "pallet-timestamp/std", - "sc-service", - "sp-consensus-grandpa/std", - "sp-trie/std", - "sp-transaction-pool/std", - "trie-db/std", - "stbl-core-primitives/std", - "substrate-wasm-builder", -] -# Special feature to disable logging -disable-logging = [ "sp-api/disable-logging" ] diff --git a/test-utils/stability-runtime/build.rs b/test-utils/stability-runtime/build.rs deleted file mode 100644 index 115d6160..00000000 --- a/test-utils/stability-runtime/build.rs +++ /dev/null @@ -1,42 +0,0 @@ -// This file is part of Stability. - -// Copyright 2023 Stability Solutions. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -fn main() { - #[cfg(feature = "std")] - { - substrate_wasm_builder::WasmBuilder::new() - .with_current_project() - .export_heap_base() - // Note that we set the stack-size to 1MB explicitly even though it is set - // to this value by default. This is because some of our tests - // (`restoration_of_globals`) depend on the stack-size. - .append_to_rust_flags("-Clink-arg=-zstack-size=1048576") - .import_memory() - .build(); - } - - #[cfg(feature = "std")] - { - substrate_wasm_builder::WasmBuilder::new() - .with_current_project() - .export_heap_base() - .import_memory() - .set_file_name("wasm_binary_logging_disabled.rs") - .enable_feature("disable-logging") - .build(); - } -} diff --git a/test-utils/stability-runtime/src/genesismap.rs b/test-utils/stability-runtime/src/genesismap.rs deleted file mode 100644 index ce460a88..00000000 --- a/test-utils/stability-runtime/src/genesismap.rs +++ /dev/null @@ -1,119 +0,0 @@ -// This file is part of Stability. - -// Copyright 2023 Stability Solutions. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Tool for creating the genesis block. - -use super::{system, wasm_binary_unwrap, AccountId, AuthorityId, Runtime}; -use codec::{Encode, Joiner, KeyedVec}; -use frame_support::traits::GenesisBuild; -use sc_service::construct_genesis_block; -use sp_core::{ - map, - storage::{well_known_keys, StateVersion, Storage}, -}; -use sp_io::hashing::{blake2_256, twox_128}; -use sp_runtime::traits::{Block as BlockT, Hash as HashT, Header as HeaderT}; -use std::collections::BTreeMap; - -/// Configuration of a general Substrate test genesis block. -pub struct GenesisConfig { - authorities: Vec, - balances: Vec<(AccountId, u64)>, - heap_pages_override: Option, - /// Additional storage key pairs that will be added to the genesis map. - extra_storage: Storage, -} - -impl GenesisConfig { - pub fn new( - authorities: Vec, - endowed_accounts: Vec, - balance: u64, - heap_pages_override: Option, - extra_storage: Storage, - ) -> Self { - GenesisConfig { - authorities, - balances: endowed_accounts.into_iter().map(|a| (a, balance)).collect(), - heap_pages_override, - extra_storage, - } - } - - pub fn genesis_map(&self) -> Storage { - let wasm_runtime = wasm_binary_unwrap().to_vec(); - let mut map: BTreeMap, Vec> = self - .balances - .iter() - .map(|&(ref account, balance)| { - (account.to_keyed_vec(b"balance:"), vec![].and(&balance)) - }) - .map(|(k, v)| (blake2_256(&k[..])[..].to_vec(), v.to_vec())) - .chain( - vec![ - (well_known_keys::CODE.into(), wasm_runtime), - ( - well_known_keys::HEAP_PAGES.into(), - vec![].and(&(self.heap_pages_override.unwrap_or(16_u64))), - ), - ] - .into_iter(), - ) - .collect(); - map.insert(twox_128(&b"sys:auth"[..])[..].to_vec(), self.authorities.encode()); - // Add the extra storage entries. - map.extend(self.extra_storage.top.clone().into_iter()); - - // Assimilate the system genesis config. - let mut storage = - Storage { top: map, children_default: self.extra_storage.children_default.clone() }; - >::assimilate_storage( - &system::GenesisConfig { authorities: self.authorities.clone() }, - &mut storage, - ) - .expect("Adding `system::GensisConfig` to the genesis"); - - storage - } -} - -pub fn insert_genesis_block(storage: &mut Storage) -> sp_core::hash::H256 { - let child_roots = storage.children_default.iter().map(|(sk, child_content)| { - let state_root = - <<::Header as HeaderT>::Hashing as HashT>::trie_root( - child_content.data.clone().into_iter().collect(), - sp_runtime::StateVersion::V1, - ); - (sk.clone(), state_root.encode()) - }); - // add child roots to storage - storage.top.extend(child_roots); - let state_root = <<::Header as HeaderT>::Hashing as HashT>::trie_root( - storage.top.clone().into_iter().collect(), - sp_runtime::StateVersion::V1, - ); - let block: crate::Block = construct_genesis_block(state_root, StateVersion::V1); - let genesis_hash = block.header.hash(); - storage.top.extend(additional_storage_with_genesis(&block)); - genesis_hash -} - -pub fn additional_storage_with_genesis(genesis_block: &crate::Block) -> BTreeMap, Vec> { - map![ - twox_128(&b"latest"[..]).to_vec() => genesis_block.hash().as_fixed_bytes().to_vec() - ] -} diff --git a/test-utils/stability-runtime/src/lib.rs b/test-utils/stability-runtime/src/lib.rs deleted file mode 100644 index f94deda6..00000000 --- a/test-utils/stability-runtime/src/lib.rs +++ /dev/null @@ -1,1526 +0,0 @@ -// This file is part of Stability. - -// Copyright 2023 Stability Solutions. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! The Substrate runtime. This can be compiled with `#[no_std]`, ready for Wasm. - -#![cfg_attr(not(feature = "std"), no_std)] - -#[cfg(feature = "std")] -pub mod genesismap; -pub mod system; - -use codec::{Decode, Encode, Error, Input, MaxEncodedLen}; -use scale_info::TypeInfo; -use sp_std::{marker::PhantomData, prelude::*}; - -use cfg_if::cfg_if; -use frame_support::{ - dispatch::RawOrigin, - parameter_types, - traits::{CallerTrait, ConstU32, ConstU64, CrateVersion, KeyOwnerProofSystem}, - weights::{RuntimeDbWeight, Weight}, -}; -use frame_system::limits::{BlockLength, BlockWeights}; -use pallet_ethereum::Transaction as EthereumTransaction; -use sp_api::{decl_runtime_apis, impl_runtime_apis}; -use sp_application_crypto::{ecdsa, ed25519, sr25519, RuntimeAppPublic}; -pub use sp_core::hash::H256; -use sp_core::{offchain::KeyTypeId, OpaqueMetadata, RuntimeDebug}; -use sp_inherents::{CheckInherentsResult, InherentData}; -use sp_trie::{ - trie_types::{TrieDBBuilder, TrieDBMutBuilderV1}, - PrefixedMemoryDB, StorageProof, -}; -use trie_db::{Trie, TrieMut}; - -#[cfg(feature = "std")] -use sp_runtime::traits::NumberFor; -use sp_runtime::{ - create_runtime_str, impl_opaque_keys, - traits::{ - BlakeTwo256, BlindCheckable, Block as BlockT, Extrinsic as ExtrinsicT, GetNodeBlockType, - GetRuntimeBlockType, IdentityLookup, Verify, - }, - transaction_validity::{ - InvalidTransaction, TransactionSource, TransactionValidity, TransactionValidityError, - ValidTransaction, - }, - ApplyExtrinsicResult, Perbill, -}; -#[cfg(any(feature = "std", test))] -use sp_version::NativeVersion; -use sp_version::RuntimeVersion; - -// Ensure Babe and Aura use the same crypto to simplify things a bit. -pub use sp_consensus_babe::{AllowedSlots, AuthorityId, Slot}; - -pub type AuraId = sp_consensus_aura::sr25519::AuthorityId; - -// Include the WASM binary -#[cfg(feature = "std")] -include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); - -#[cfg(feature = "std")] -pub mod wasm_binary_logging_disabled { - include!(concat!(env!("OUT_DIR"), "/wasm_binary_logging_disabled.rs")); -} - -/// Wasm binary unwrapped. If built with `SKIP_WASM_BUILD`, the function panics. -#[cfg(feature = "std")] -pub fn wasm_binary_unwrap() -> &'static [u8] { - WASM_BINARY.expect( - "Development wasm binary is not available. Testing is only supported with the flag \ - disabled.", - ) -} - -/// Wasm binary unwrapped. If built with `SKIP_WASM_BUILD`, the function panics. -#[cfg(feature = "std")] -pub fn wasm_binary_logging_disabled_unwrap() -> &'static [u8] { - wasm_binary_logging_disabled::WASM_BINARY.expect( - "Development wasm binary is not available. Testing is only supported with the flag \ - disabled.", - ) -} - -/// Test runtime version. -#[sp_version::runtime_version] -pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: create_runtime_str!("test"), - impl_name: create_runtime_str!("parity-test"), - authoring_version: 1, - spec_version: 2, - impl_version: 2, - apis: RUNTIME_API_VERSIONS, - transaction_version: 1, - state_version: 1, -}; - -fn version() -> RuntimeVersion { - VERSION -} - -/// Native version. -#[cfg(any(feature = "std", test))] -pub fn native_version() -> NativeVersion { - NativeVersion { - runtime_version: VERSION, - can_author_with: Default::default(), - } -} - -/// Calls in transactions. -#[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)] -pub struct Transfer { - pub from: AccountId, - pub to: AccountId, - pub amount: u64, - pub nonce: u64, -} - -impl Transfer { - /// Convert into a signed extrinsic. - #[cfg(feature = "std")] - pub fn into_signed_tx(self) -> Extrinsic { - let signature = sp_keyring::AccountKeyring::from_public(&self.from) - .expect("Creates keyring from public key.") - .sign(&self.encode()); - Extrinsic::Transfer { - transfer: self, - signature, - exhaust_resources_when_not_first: false, - } - } - - /// Convert into a signed extrinsic, which will only end up included in the block - /// if it's the first transaction. Otherwise it will cause `ResourceExhaustion` error - /// which should be considered as block being full. - #[cfg(feature = "std")] - pub fn into_resources_exhausting_tx(self) -> Extrinsic { - let signature = sp_keyring::AccountKeyring::from_public(&self.from) - .expect("Creates keyring from public key.") - .sign(&self.encode()); - - Extrinsic::Transfer { - transfer: self, - signature, - exhaust_resources_when_not_first: true, - } - } -} - -/// Extrinsic for test-runtime. -#[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)] -pub enum Extrinsic { - AuthoritiesChange(Vec), - Transfer { - transfer: Transfer, - signature: AccountSignature, - exhaust_resources_when_not_first: bool, - }, - Skipped(u32), - IncludeData(Vec), - StorageChange(Vec, Option>), - OffchainIndexSet(Vec, Vec), - OffchainIndexClear(Vec), - Store(Vec), - /// Read X times from the state some data and then panic! - /// - /// Returns `Ok` if it didn't read anything. - ReadAndPanic(u32), - /// Read X times from the state some data. - /// - /// Panics if it can not read `X` times. - Read(u32), -} - -#[cfg(feature = "std")] -impl serde::Serialize for Extrinsic { - fn serialize(&self, seq: S) -> Result - where - S: serde::Serializer, - { - self.using_encoded(|bytes| seq.serialize_bytes(bytes)) - } -} - -// rustc can't deduce this trait bound https://github.com/rust-lang/rust/issues/48214 -#[cfg(feature = "std")] -impl<'a> serde::Deserialize<'a> for Extrinsic { - fn deserialize(de: D) -> Result - where - D: serde::Deserializer<'a>, - { - let r = sp_core::bytes::deserialize(de)?; - Decode::decode(&mut &r[..]) - .map_err(|e| serde::de::Error::custom(format!("Decode error: {}", e))) - } -} - -impl BlindCheckable for Extrinsic { - type Checked = Self; - - fn check(self) -> Result { - match self { - Extrinsic::AuthoritiesChange(new_auth) => Ok(Extrinsic::AuthoritiesChange(new_auth)), - Extrinsic::Transfer { - transfer, - signature, - exhaust_resources_when_not_first, - } => { - if sp_runtime::verify_encoded_lazy(&signature, &transfer, &transfer.from) { - Ok(Extrinsic::Transfer { - transfer, - signature, - exhaust_resources_when_not_first, - }) - } else { - Err(InvalidTransaction::BadProof.into()) - } - } - Extrinsic::IncludeData(v) => Ok(Extrinsic::IncludeData(v)), - Extrinsic::Skipped(v) => Ok(Extrinsic::Skipped(v)), - Extrinsic::StorageChange(key, value) => Ok(Extrinsic::StorageChange(key, value)), - Extrinsic::OffchainIndexSet(key, value) => Ok(Extrinsic::OffchainIndexSet(key, value)), - Extrinsic::OffchainIndexClear(key) => Ok(Extrinsic::OffchainIndexClear(key)), - Extrinsic::Store(data) => Ok(Extrinsic::Store(data)), - Extrinsic::ReadAndPanic(i) => Ok(Extrinsic::ReadAndPanic(i)), - Extrinsic::Read(i) => Ok(Extrinsic::Read(i)), - } - } -} - -impl ExtrinsicT for Extrinsic { - type Call = Extrinsic; - type SignaturePayload = (); - - fn is_signed(&self) -> Option { - if let Extrinsic::IncludeData(_) = *self { - Some(false) - } else { - Some(true) - } - } - - fn new(call: Self::Call, _signature_payload: Option) -> Option { - Some(call) - } -} - -impl sp_runtime::traits::Dispatchable for Extrinsic { - type RuntimeOrigin = RuntimeOrigin; - type Config = (); - type Info = (); - type PostInfo = (); - fn dispatch( - self, - _origin: Self::RuntimeOrigin, - ) -> sp_runtime::DispatchResultWithInfo { - panic!("This implementation should not be used for actual dispatch."); - } -} - -impl Extrinsic { - /// Convert `&self` into `&Transfer`. - /// - /// Panics if this is no `Transfer` extrinsic. - pub fn transfer(&self) -> &Transfer { - self.try_transfer().expect("cannot convert to transfer ref") - } - - /// Try to convert `&self` into `&Transfer`. - /// - /// Returns `None` if this is no `Transfer` extrinsic. - pub fn try_transfer(&self) -> Option<&Transfer> { - match self { - Extrinsic::Transfer { ref transfer, .. } => Some(transfer), - _ => None, - } - } -} - -/// The signature type used by accounts/transactions. -pub type AccountSignature = sr25519::Signature; -/// An identifier for an account on this system. -pub type AccountId = ::Signer; -/// A simple hash type for all our hashing. -pub type Hash = H256; -/// The hashing algorithm used. -pub type Hashing = BlakeTwo256; -/// The block number type used in this runtime. -pub type BlockNumber = u64; -/// Index of a transaction. -pub type Index = u64; -/// The item of a block digest. -pub type DigestItem = sp_runtime::generic::DigestItem; -/// The digest of a block. -pub type Digest = sp_runtime::generic::Digest; -/// A test block. -pub type Block = sp_runtime::generic::Block; -/// A test block's header. -pub type Header = sp_runtime::generic::Header; - -/// Run whatever tests we have. -pub fn run_tests(mut input: &[u8]) -> Vec { - use sp_runtime::print; - - print("run_tests..."); - let block = Block::decode(&mut input).unwrap(); - print("deserialized block."); - let stxs = block.extrinsics.iter().map(Encode::encode); - print("reserialized transactions."); - [stxs.count() as u8].encode() -} - -/// A type that can not be decoded. -#[derive(PartialEq, TypeInfo)] -pub struct DecodeFails { - _phantom: PhantomData, -} - -impl Encode for DecodeFails { - fn encode(&self) -> Vec { - Vec::new() - } -} - -impl codec::EncodeLike for DecodeFails {} - -impl Default for DecodeFails { - /// Create a default instance. - fn default() -> DecodeFails { - DecodeFails { - _phantom: Default::default(), - } - } -} - -impl Decode for DecodeFails { - fn decode(_: &mut I) -> Result { - Err("DecodeFails always fails".into()) - } -} - -pub type Signature = stbl_core_primitives::Signature; - -pub type RealAccountiD = stbl_core_primitives::AccountId; - -cfg_if! { - if #[cfg(feature = "std")] { - decl_runtime_apis! { - #[api_version(2)] - pub trait TestAPI { - /// Return the balance of the given account id. - fn balance_of(id: AccountId) -> u64; - /// A benchmark function that adds one to the given value and returns the result. - fn benchmark_add_one(val: &u64) -> u64; - /// A benchmark function that adds one to each value in the given vector and returns the - /// result. - fn benchmark_vector_add_one(vec: &Vec) -> Vec; - /// A function that always fails to convert a parameter between runtime and node. - fn fail_convert_parameter(param: DecodeFails); - /// A function that always fails to convert its return value between runtime and node. - fn fail_convert_return_value() -> DecodeFails; - /// A function for that the signature changed in version `2`. - #[changed_in(2)] - fn function_signature_changed() -> Vec; - /// The new signature. - fn function_signature_changed() -> u64; - fn fail_on_native() -> u64; - fn fail_on_wasm() -> u64; - /// trie no_std testing - fn use_trie() -> u64; - fn benchmark_indirect_call() -> u64; - fn benchmark_direct_call() -> u64; - fn vec_with_capacity(size: u32) -> Vec; - /// Returns the initialized block number. - fn get_block_number() -> u64; - /// Takes and returns the initialized block number. - fn take_block_number() -> Option; - /// Test that `ed25519` crypto works in the runtime. - /// - /// Returns the signature generated for the message `ed25519` and the public key. - fn test_ed25519_crypto() -> (ed25519::AppSignature, ed25519::AppPublic); - /// Test that `sr25519` crypto works in the runtime. - /// - /// Returns the signature generated for the message `sr25519`. - fn test_sr25519_crypto() -> (sr25519::AppSignature, sr25519::AppPublic); - /// Test that `ecdsa` crypto works in the runtime. - /// - /// Returns the signature generated for the message `ecdsa`. - fn test_ecdsa_crypto() -> (ecdsa::AppSignature, ecdsa::AppPublic); - /// Run various tests against storage. - fn test_storage(); - /// Check a witness. - fn test_witness(proof: StorageProof, root: crate::Hash); - /// Test that ensures that we can call a function that takes multiple - /// arguments. - fn test_multiple_arguments(data: Vec, other: Vec, num: u32); - /// Traces log "Hey I'm runtime." - fn do_trace_log(); - /// Verify the given signature, public & message bundle. - fn verify_ed25519(sig: ed25519::Signature, public: ed25519::Public, message: Vec) -> bool; - } - } - } else { - decl_runtime_apis! { - pub trait TestAPI { - /// Return the balance of the given account id. - fn balance_of(id: AccountId) -> u64; - /// A benchmark function that adds one to the given value and returns the result. - fn benchmark_add_one(val: &u64) -> u64; - /// A benchmark function that adds one to each value in the given vector and returns the - /// result. - fn benchmark_vector_add_one(vec: &Vec) -> Vec; - /// A function that always fails to convert a parameter between runtime and node. - fn fail_convert_parameter(param: DecodeFails); - /// A function that always fails to convert its return value between runtime and node. - fn fail_convert_return_value() -> DecodeFails; - /// In wasm we just emulate the old behavior. - fn function_signature_changed() -> Vec; - fn fail_on_native() -> u64; - fn fail_on_wasm() -> u64; - /// trie no_std testing - fn use_trie() -> u64; - fn benchmark_indirect_call() -> u64; - fn benchmark_direct_call() -> u64; - fn vec_with_capacity(size: u32) -> Vec; - /// Returns the initialized block number. - fn get_block_number() -> u64; - /// Takes and returns the initialized block number. - fn take_block_number() -> Option; - /// Test that `ed25519` crypto works in the runtime. - /// - /// Returns the signature generated for the message `ed25519` and the public key. - fn test_ed25519_crypto() -> (ed25519::AppSignature, ed25519::AppPublic); - /// Test that `sr25519` crypto works in the runtime. - /// - /// Returns the signature generated for the message `sr25519`. - fn test_sr25519_crypto() -> (sr25519::AppSignature, sr25519::AppPublic); - /// Test that `ecdsa` crypto works in the runtime. - /// - /// Returns the signature generated for the message `ecdsa`. - fn test_ecdsa_crypto() -> (ecdsa::AppSignature, ecdsa::AppPublic); - /// Run various tests against storage. - fn test_storage(); - /// Check a witness. - fn test_witness(proof: StorageProof, root: crate::Hash); - /// Test that ensures that we can call a function that takes multiple - /// arguments. - fn test_multiple_arguments(data: Vec, other: Vec, num: u32); - /// Traces log "Hey I'm runtime." - fn do_trace_log(); - /// Verify the given signature, public & message bundle. - fn verify_ed25519(sig: ed25519::Signature, public: ed25519::Public, message: Vec) -> bool; - } - } - } -} - -#[derive(Clone, Eq, PartialEq, TypeInfo)] -pub struct Runtime; - -impl GetNodeBlockType for Runtime { - type NodeBlock = Block; -} - -impl GetRuntimeBlockType for Runtime { - type RuntimeBlock = Block; -} - -#[derive(Clone, RuntimeDebug, Encode, Decode, PartialEq, Eq, TypeInfo, MaxEncodedLen)] -pub struct RuntimeOrigin; - -impl From::AccountId>> for RuntimeOrigin { - fn from(_: RawOrigin<::AccountId>) -> Self { - unimplemented!("Not required in tests!") - } -} - -impl CallerTrait<::AccountId> for RuntimeOrigin { - fn into_system(self) -> Option::AccountId>> { - unimplemented!("Not required in tests!") - } - - fn as_system_ref(&self) -> Option<&RawOrigin<::AccountId>> { - unimplemented!("Not required in tests!") - } -} - -impl From for Result, RuntimeOrigin> { - fn from(_origin: RuntimeOrigin) -> Result, RuntimeOrigin> { - unimplemented!("Not required in tests!") - } -} - -impl frame_support::traits::OriginTrait for RuntimeOrigin { - type Call = ::RuntimeCall; - type PalletsOrigin = RuntimeOrigin; - type AccountId = ::AccountId; - - fn add_filter(&mut self, _filter: impl Fn(&Self::Call) -> bool + 'static) { - unimplemented!("Not required in tests!") - } - - fn reset_filter(&mut self) { - unimplemented!("Not required in tests!") - } - - fn set_caller_from(&mut self, _other: impl Into) { - unimplemented!("Not required in tests!") - } - - fn filter_call(&self, _call: &Self::Call) -> bool { - unimplemented!("Not required in tests!") - } - - fn caller(&self) -> &Self::PalletsOrigin { - unimplemented!("Not required in tests!") - } - - fn into_caller(self) -> Self::PalletsOrigin { - unimplemented!("Not required in tests!") - } - - fn try_with_caller( - self, - _f: impl FnOnce(Self::PalletsOrigin) -> Result, - ) -> Result { - unimplemented!("Not required in tests!") - } - - fn none() -> Self { - unimplemented!("Not required in tests!") - } - fn root() -> Self { - unimplemented!("Not required in tests!") - } - fn signed(_by: Self::AccountId) -> Self { - unimplemented!("Not required in tests!") - } - fn as_signed(self) -> Option { - unimplemented!("Not required in tests!") - } - fn as_system_ref(&self) -> Option<&RawOrigin> { - unimplemented!("Not required in tests!") - } -} - -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, TypeInfo)] -pub struct RuntimeEvent; - -impl From> for RuntimeEvent { - fn from(_evt: frame_system::Event) -> Self { - unimplemented!("Not required in tests!") - } -} - -impl frame_support::traits::PalletInfo for Runtime { - fn index() -> Option { - let type_id = sp_std::any::TypeId::of::

(); - if type_id == sp_std::any::TypeId::of::>() { - return Some(0); - } - if type_id == sp_std::any::TypeId::of::>() { - return Some(1); - } - if type_id == sp_std::any::TypeId::of::>() { - return Some(2); - } - - None - } - fn name() -> Option<&'static str> { - let type_id = sp_std::any::TypeId::of::

(); - if type_id == sp_std::any::TypeId::of::>() { - return Some("System"); - } - if type_id == sp_std::any::TypeId::of::>() { - return Some("Timestamp"); - } - if type_id == sp_std::any::TypeId::of::>() { - return Some("Babe"); - } - - None - } - fn module_name() -> Option<&'static str> { - let type_id = sp_std::any::TypeId::of::

(); - if type_id == sp_std::any::TypeId::of::>() { - return Some("system"); - } - if type_id == sp_std::any::TypeId::of::>() { - return Some("pallet_timestamp"); - } - if type_id == sp_std::any::TypeId::of::>() { - return Some("pallet_babe"); - } - - None - } - fn crate_version() -> Option { - use frame_support::traits::PalletInfoAccess as _; - let type_id = sp_std::any::TypeId::of::

() + } + + fn status(&self) -> RpcResult> { + let status = self.graph.validated_pool().status(); + Ok(TxPoolResult { + pending: U256::from(status.ready), + queued: U256::from(status.future), + }) + } +} + +impl Clone for TxPool { + fn clone(&self) -> Self { + Self::new(self.client.clone(), self.graph.clone()) + } +} diff --git a/vendor/primitives/ext/Cargo.toml b/vendor/primitives/ext/Cargo.toml new file mode 100644 index 00000000..8361b5b2 --- /dev/null +++ b/vendor/primitives/ext/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "moonbeam-primitives-ext" +authors = { workspace = true } +edition = "2021" +homepage = "https://moonbeam.network" +license = "GPL-3.0-only" +repository = { workspace = true } +version = "0.1.0" + +[dependencies] +ethereum-types = { workspace = true } + +# Moonbeam +evm-tracing-events = { workspace = true } + +# Substrate +parity-scale-codec = { workspace = true } +sp-externalities = { workspace = true } +sp-runtime-interface = { workspace = true } +sp-std = { workspace = true } + +[features] +default = [ "std" ] +std = [ + "ethereum-types/std", + "evm-tracing-events/std", + "parity-scale-codec/std", + "sp-externalities/std", + "sp-runtime-interface/std", + "sp-std/std", +] diff --git a/vendor/primitives/ext/src/lib.rs b/vendor/primitives/ext/src/lib.rs new file mode 100644 index 00000000..2e0fe897 --- /dev/null +++ b/vendor/primitives/ext/src/lib.rs @@ -0,0 +1,82 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! Environmental-aware externalities for EVM tracing in Wasm runtime. This enables +//! capturing the - potentially large - trace output data in the host and keep +//! a low memory footprint in `--execution=wasm`. +//! +//! - The original trace Runtime Api call is wrapped `using` environmental (thread local). +//! - Arguments are scale-encoded known types in the host. +//! - Host functions will decode the input and emit an event `with` environmental. + +#![cfg_attr(not(feature = "std"), no_std)] +use sp_runtime_interface::runtime_interface; + +use parity_scale_codec::Decode; +use sp_std::vec::Vec; + +use evm_tracing_events::{Event, EvmEvent, GasometerEvent, RuntimeEvent, StepEventFilter}; + +#[runtime_interface] +pub trait MoonbeamExt { + fn raw_step(&mut self, _data: Vec) {} + + fn raw_gas(&mut self, _data: Vec) {} + + fn raw_return_value(&mut self, _data: Vec) {} + + fn call_list_entry(&mut self, _index: u32, _value: Vec) {} + + fn call_list_new(&mut self) {} + + // New design, proxy events. + /// An `Evm` event proxied by the Moonbeam runtime to this host function. + /// evm -> moonbeam_runtime -> host. + fn evm_event(&mut self, event: Vec) { + if let Ok(event) = EvmEvent::decode(&mut &event[..]) { + Event::Evm(event).emit(); + } + } + + /// A `Gasometer` event proxied by the Moonbeam runtime to this host function. + /// evm_gasometer -> moonbeam_runtime -> host. + fn gasometer_event(&mut self, event: Vec) { + if let Ok(event) = GasometerEvent::decode(&mut &event[..]) { + Event::Gasometer(event).emit(); + } + } + + /// A `Runtime` event proxied by the Moonbeam runtime to this host function. + /// evm_runtime -> moonbeam_runtime -> host. + fn runtime_event(&mut self, event: Vec) { + if let Ok(event) = RuntimeEvent::decode(&mut &event[..]) { + Event::Runtime(event).emit(); + } + } + + /// Allow the tracing module in the runtime to know how to filter Step event + /// content, as cloning the entire data is expensive and most of the time + /// not necessary. + fn step_event_filter(&self) -> StepEventFilter { + evm_tracing_events::step_event_filter().unwrap_or_default() + } + + /// An event to create a new CallList (currently a new transaction when tracing a block). + #[version(2)] + fn call_list_new(&mut self) { + Event::CallListNew().emit(); + } +} diff --git a/vendor/primitives/rpc/debug/Cargo.toml b/vendor/primitives/rpc/debug/Cargo.toml new file mode 100644 index 00000000..a7f36de1 --- /dev/null +++ b/vendor/primitives/rpc/debug/Cargo.toml @@ -0,0 +1,39 @@ +[package] +name = "moonbeam-rpc-primitives-debug" +authors = { workspace = true } +edition = "2021" +homepage = "https://moonbeam.network" +license = "GPL-3.0-only" +repository = { workspace = true } +version = "0.1.0" + +[dependencies] +environmental = { workspace = true } +ethereum = { workspace = true } +ethereum-types = { workspace = true } +hex = { workspace = true, optional = true, features = [ "serde" ] } +serde = { workspace = true, optional = true, features = [ "derive" ] } + +# Substrate +parity-scale-codec = { workspace = true } +sp-api = { workspace = true } +sp-core = { workspace = true } +sp-io = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } + +[features] +default = [ "std" ] +std = [ + "environmental/std", + "ethereum-types/std", + "ethereum/std", + "hex", + "parity-scale-codec/std", + "serde", + "sp-api/std", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", + "sp-std/std", +] diff --git a/vendor/primitives/rpc/debug/src/lib.rs b/vendor/primitives/rpc/debug/src/lib.rs new file mode 100644 index 00000000..5e019ea4 --- /dev/null +++ b/vendor/primitives/rpc/debug/src/lib.rs @@ -0,0 +1,66 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +#![cfg_attr(not(feature = "std"), no_std)] + +use ethereum::{TransactionV0 as LegacyTransaction, TransactionV2 as Transaction}; +use ethereum_types::H256; +use parity_scale_codec::{Decode, Encode}; +use sp_std::vec::Vec; + +sp_api::decl_runtime_apis! { + // Api version is virtually 4. + // + // We realized that even using runtime overrides, using the ApiExt interface reads the api + // versions from the state runtime, meaning we cannot just reset the versioning as we see fit. + // + // In order to be able to use ApiExt as part of the RPC handler logic we need to be always + // above the version that exists on chain for this Api, even if this Api is only meant + // to be used overridden. + #[api_version(4)] + pub trait DebugRuntimeApi { + #[changed_in(4)] + fn trace_transaction( + extrinsics: Vec, + transaction: &LegacyTransaction, + ) -> Result<(), sp_runtime::DispatchError>; + + fn trace_transaction( + extrinsics: Vec, + transaction: &Transaction, + ) -> Result<(), sp_runtime::DispatchError>; + + fn trace_block( + extrinsics: Vec, + known_transactions: Vec, + ) -> Result<(), sp_runtime::DispatchError>; + } +} + +#[derive(Clone, Copy, Eq, PartialEq, Debug, Encode, Decode)] +pub enum TracerInput { + None, + Blockscout, + CallTracer, +} + +/// DebugRuntimeApi V2 result. Trace response is stored in client and runtime api call response is +/// empty. +#[derive(Debug)] +pub enum Response { + Single, + Block, +} diff --git a/vendor/primitives/rpc/evm-tracing-events/Cargo.toml b/vendor/primitives/rpc/evm-tracing-events/Cargo.toml new file mode 100644 index 00000000..e10f9dc1 --- /dev/null +++ b/vendor/primitives/rpc/evm-tracing-events/Cargo.toml @@ -0,0 +1,36 @@ +[package] +name = "evm-tracing-events" +authors = { workspace = true } +edition = "2021" +homepage = "https://moonbeam.network" +license = "GPL-3.0-only" +repository = { workspace = true } +version = "0.1.0" + +[dependencies] +environmental = { workspace = true } + +# Substrate +parity-scale-codec = { workspace = true } +sp-runtime-interface = { workspace = true } + +# Ethereum +ethereum = { workspace = true, features = [ "with-codec" ] } +ethereum-types = { workspace = true } +evm = { workspace = true, features = [ "with-codec" ] } +evm-gasometer = { workspace = true } +evm-runtime = { workspace = true } + +[features] +default = [ "std" ] +std = [ + "environmental/std", + "ethereum-types/std", + "ethereum/std", + "evm-gasometer/std", + "evm-runtime/std", + "evm/std", + "parity-scale-codec/std", + "sp-runtime-interface/std", +] +evm-tracing = [ "evm-gasometer/tracing", "evm-runtime/tracing", "evm/tracing" ] diff --git a/vendor/primitives/rpc/evm-tracing-events/src/evm.rs b/vendor/primitives/rpc/evm-tracing-events/src/evm.rs new file mode 100644 index 00000000..b13a63c1 --- /dev/null +++ b/vendor/primitives/rpc/evm-tracing-events/src/evm.rs @@ -0,0 +1,257 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +extern crate alloc; + +use alloc::vec::Vec; +use ethereum_types::{H160, H256, U256}; +use evm::ExitReason; +use parity_scale_codec::{Decode, Encode}; + +#[derive(Clone, Debug, Encode, Decode, PartialEq, Eq)] +pub struct Transfer { + /// Source address. + pub source: H160, + /// Target address. + pub target: H160, + /// Transfer value. + pub value: U256, +} + +impl From for Transfer { + fn from(i: evm_runtime::Transfer) -> Self { + Self { + source: i.source, + target: i.target, + value: i.value, + } + } +} + +#[derive(Clone, Copy, Eq, PartialEq, Debug, Encode, Decode)] +pub enum CreateScheme { + /// Legacy create scheme of `CREATE`. + Legacy { + /// Caller of the create. + caller: H160, + }, + /// Create scheme of `CREATE2`. + Create2 { + /// Caller of the create. + caller: H160, + /// Code hash. + code_hash: H256, + /// Salt. + salt: H256, + }, + /// Create at a fixed location. + Fixed(H160), +} + +impl From for CreateScheme { + fn from(i: evm_runtime::CreateScheme) -> Self { + match i { + evm_runtime::CreateScheme::Legacy { caller } => Self::Legacy { caller }, + evm_runtime::CreateScheme::Create2 { + caller, + code_hash, + salt, + } => Self::Create2 { + caller, + code_hash, + salt, + }, + evm_runtime::CreateScheme::Fixed(address) => Self::Fixed(address), + } + } +} + +#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq)] +pub enum EvmEvent { + Call { + code_address: H160, + transfer: Option, + input: Vec, + target_gas: Option, + is_static: bool, + context: super::Context, + }, + Create { + caller: H160, + address: H160, + scheme: CreateScheme, + value: U256, + init_code: Vec, + target_gas: Option, + }, + Suicide { + address: H160, + target: H160, + balance: U256, + }, + Exit { + reason: ExitReason, + return_value: Vec, + }, + TransactCall { + caller: H160, + address: H160, + value: U256, + data: Vec, + gas_limit: u64, + }, + TransactCreate { + caller: H160, + value: U256, + init_code: Vec, + gas_limit: u64, + address: H160, + }, + TransactCreate2 { + caller: H160, + value: U256, + init_code: Vec, + salt: H256, + gas_limit: u64, + address: H160, + }, + PrecompileSubcall { + code_address: H160, + transfer: Option, + input: Vec, + target_gas: Option, + is_static: bool, + context: super::Context, + }, +} + +#[cfg(feature = "evm-tracing")] +impl<'a> From> for EvmEvent { + fn from(i: evm::tracing::Event<'a>) -> Self { + match i { + evm::tracing::Event::Call { + code_address, + transfer, + input, + target_gas, + is_static, + context, + } => Self::Call { + code_address, + transfer: if let Some(transfer) = transfer { + Some(transfer.clone().into()) + } else { + None + }, + input: input.to_vec(), + target_gas, + is_static, + context: context.clone().into(), + }, + evm::tracing::Event::Create { + caller, + address, + scheme, + value, + init_code, + target_gas, + } => Self::Create { + caller, + address, + scheme: scheme.into(), + value, + init_code: init_code.to_vec(), + target_gas, + }, + evm::tracing::Event::Suicide { + address, + target, + balance, + } => Self::Suicide { + address, + target, + balance, + }, + evm::tracing::Event::Exit { + reason, + return_value, + } => Self::Exit { + reason: reason.clone(), + return_value: return_value.to_vec(), + }, + evm::tracing::Event::TransactCall { + caller, + address, + value, + data, + gas_limit, + } => Self::TransactCall { + caller, + address, + value, + data: data.to_vec(), + gas_limit, + }, + evm::tracing::Event::TransactCreate { + caller, + value, + init_code, + gas_limit, + address, + } => Self::TransactCreate { + caller, + value, + init_code: init_code.to_vec(), + gas_limit, + address, + }, + evm::tracing::Event::TransactCreate2 { + caller, + value, + init_code, + salt, + gas_limit, + address, + } => Self::TransactCreate2 { + caller, + value, + init_code: init_code.to_vec(), + salt, + gas_limit, + address, + }, + evm::tracing::Event::PrecompileSubcall { + code_address, + transfer, + input, + target_gas, + is_static, + context, + } => Self::PrecompileSubcall { + code_address, + transfer: if let Some(transfer) = transfer { + Some(transfer.clone().into()) + } else { + None + }, + input: input.to_vec(), + target_gas, + is_static, + context: context.clone().into(), + }, + } + } +} diff --git a/vendor/primitives/rpc/evm-tracing-events/src/gasometer.rs b/vendor/primitives/rpc/evm-tracing-events/src/gasometer.rs new file mode 100644 index 00000000..355f18ca --- /dev/null +++ b/vendor/primitives/rpc/evm-tracing-events/src/gasometer.rs @@ -0,0 +1,114 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +use parity_scale_codec::{Decode, Encode}; + +#[derive(Debug, Default, Copy, Clone, Encode, Decode, PartialEq, Eq)] +pub struct Snapshot { + pub gas_limit: u64, + pub memory_gas: u64, + pub used_gas: u64, + pub refunded_gas: i64, +} + +impl Snapshot { + pub fn gas(&self) -> u64 { + self.gas_limit - self.used_gas - self.memory_gas + } +} + +#[cfg(feature = "evm-tracing")] +impl From> for Snapshot { + fn from(i: Option) -> Self { + if let Some(i) = i { + Self { + gas_limit: i.gas_limit, + memory_gas: i.memory_gas, + used_gas: i.used_gas, + refunded_gas: i.refunded_gas, + } + } else { + Default::default() + } + } +} + +#[derive(Debug, Copy, Clone, Encode, Decode, PartialEq, Eq)] +pub enum GasometerEvent { + RecordCost { + cost: u64, + snapshot: Snapshot, + }, + RecordRefund { + refund: i64, + snapshot: Snapshot, + }, + RecordStipend { + stipend: u64, + snapshot: Snapshot, + }, + RecordDynamicCost { + gas_cost: u64, + memory_gas: u64, + gas_refund: i64, + snapshot: Snapshot, + }, + RecordTransaction { + cost: u64, + snapshot: Snapshot, + }, +} + +#[cfg(feature = "evm-tracing")] +impl From for GasometerEvent { + fn from(i: evm_gasometer::tracing::Event) -> Self { + match i { + evm_gasometer::tracing::Event::RecordCost { cost, snapshot } => Self::RecordCost { + cost, + snapshot: snapshot.into(), + }, + evm_gasometer::tracing::Event::RecordRefund { refund, snapshot } => { + Self::RecordRefund { + refund, + snapshot: snapshot.into(), + } + } + evm_gasometer::tracing::Event::RecordStipend { stipend, snapshot } => { + Self::RecordStipend { + stipend, + snapshot: snapshot.into(), + } + } + evm_gasometer::tracing::Event::RecordDynamicCost { + gas_cost, + memory_gas, + gas_refund, + snapshot, + } => Self::RecordDynamicCost { + gas_cost, + memory_gas, + gas_refund, + snapshot: snapshot.into(), + }, + evm_gasometer::tracing::Event::RecordTransaction { cost, snapshot } => { + Self::RecordTransaction { + cost, + snapshot: snapshot.into(), + } + } + } + } +} diff --git a/vendor/primitives/rpc/evm-tracing-events/src/lib.rs b/vendor/primitives/rpc/evm-tracing-events/src/lib.rs new file mode 100644 index 00000000..54fbcd28 --- /dev/null +++ b/vendor/primitives/rpc/evm-tracing-events/src/lib.rs @@ -0,0 +1,116 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! A Proxy in this context is an environmental trait implementor meant to be used for capturing +//! EVM trace events sent to a Host function from the Runtime. Works like: +//! - Runtime Api call `using` environmental. +//! - Runtime calls a Host function with some scale-encoded Evm event. +//! - Host function emits an additional event to this Listener. +//! - Proxy listens for the event and format the actual trace response. +//! +//! There are two proxy types: `Raw` and `CallList`. +//! - `Raw` - used for opcode-level traces. +//! - `CallList` - used for block tracing (stack of call stacks) and custom tracing outputs. +//! +//! The EVM event types may contain references and not implement Encode/Decode. +//! This module provide mirror types and conversion into them from the original events. + +#![cfg_attr(not(feature = "std"), no_std)] +extern crate alloc; + +pub mod evm; +pub mod gasometer; +pub mod runtime; + +pub use self::evm::EvmEvent; +pub use gasometer::GasometerEvent; +pub use runtime::RuntimeEvent; + +use ethereum_types::{H160, U256}; +use parity_scale_codec::{Decode, Encode}; +use sp_runtime_interface::pass_by::PassByCodec; + +environmental::environmental!(listener: dyn Listener + 'static); + +pub fn using R>(l: &mut (dyn Listener + 'static), f: F) -> R { + listener::using(l, f) +} + +/// Allow to configure which data of the Step event +/// we want to keep or discard. Not discarding the data requires cloning the data +/// in the runtime which have a significant cost for each step. +#[derive(Clone, Copy, Eq, PartialEq, Debug, Encode, Decode, Default, PassByCodec)] +pub struct StepEventFilter { + pub enable_stack: bool, + pub enable_memory: bool, +} + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode)] +pub enum Event { + Evm(evm::EvmEvent), + Gasometer(gasometer::GasometerEvent), + Runtime(runtime::RuntimeEvent), + CallListNew(), +} + +impl Event { + /// Access the global reference and call it's `event` method, passing the `Event` itself as + /// argument. + /// + /// This only works if we are `using` a global reference to a `Listener` implementor. + pub fn emit(self) { + listener::with(|listener| listener.event(self)); + } +} + +/// Main trait to proxy emitted messages. +/// Used 2 times : +/// - Inside the runtime to proxy the events through the host functions +/// - Inside the client to forward those events to the client listener. +pub trait Listener { + fn event(&mut self, event: Event); + + /// Allow the runtime to know which data should be discarded and not cloned. + /// WARNING: It is only called once when the runtime tracing is instantiated to avoid + /// performing many ext calls. + fn step_event_filter(&self) -> StepEventFilter; +} + +pub fn step_event_filter() -> Option { + let mut filter = None; + listener::with(|listener| filter = Some(listener.step_event_filter())); + filter +} + +#[derive(Clone, Debug, Encode, Decode, PartialEq, Eq)] +pub struct Context { + /// Execution address. + pub address: H160, + /// Caller of the EVM. + pub caller: H160, + /// Apparent value of the EVM. + pub apparent_value: U256, +} + +impl From for Context { + fn from(i: evm_runtime::Context) -> Self { + Self { + address: i.address, + caller: i.caller, + apparent_value: i.apparent_value, + } + } +} diff --git a/vendor/primitives/rpc/evm-tracing-events/src/runtime.rs b/vendor/primitives/rpc/evm-tracing-events/src/runtime.rs new file mode 100644 index 00000000..0fec676f --- /dev/null +++ b/vendor/primitives/rpc/evm-tracing-events/src/runtime.rs @@ -0,0 +1,326 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +extern crate alloc; + +use super::Context; +use alloc::vec::Vec; +use ethereum_types::{H160, H256, U256}; +pub use evm::{ExitError, ExitReason, ExitSucceed, Opcode}; +use parity_scale_codec::{Decode, Encode}; + +#[derive(Clone, Debug, Encode, Decode, PartialEq, Eq)] +pub struct Stack { + pub data: Vec, + pub limit: u64, +} + +impl From<&evm::Stack> for Stack { + fn from(i: &evm::Stack) -> Self { + Self { + data: i.data().clone(), + limit: i.limit() as u64, + } + } +} + +#[derive(Clone, Debug, Encode, Decode, PartialEq, Eq)] +pub struct Memory { + pub data: Vec, + pub effective_len: U256, + pub limit: u64, +} + +impl From<&evm::Memory> for Memory { + fn from(i: &evm::Memory) -> Self { + Self { + data: i.data().clone(), + effective_len: i.effective_len(), + limit: i.limit() as u64, + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Encode, Decode)] +pub enum Capture { + /// The machine has exited. It cannot be executed again. + Exit(E), + /// The machine has trapped. It is waiting for external information, and can + /// be executed again. + Trap(T), +} + +pub type Trap = Vec; // Should hold the marshalled Opcode. + +#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq)] +pub enum RuntimeEvent { + Step { + context: Context, + // This needs to be marshalled in the runtime no matter what. + opcode: Vec, + // We can use ExitReason with `with-codec` feature, + position: Result, + stack: Option, + memory: Option, + }, + StepResult { + result: Result<(), Capture>, + return_value: Vec, + }, + SLoad { + address: H160, + index: H256, + value: H256, + }, + SStore { + address: H160, + index: H256, + value: H256, + }, +} + +#[cfg(feature = "evm-tracing")] +impl RuntimeEvent { + pub fn from_evm_event<'a>( + i: evm_runtime::tracing::Event<'a>, + filter: crate::StepEventFilter, + ) -> Self { + match i { + evm_runtime::tracing::Event::Step { + context, + opcode, + position, + stack, + memory, + } => Self::Step { + context: context.clone().into(), + opcode: opcodes_string(opcode), + position: match position { + Ok(position) => Ok(*position as u64), + Err(e) => Err(e.clone()), + }, + stack: if filter.enable_stack { + Some(stack.into()) + } else { + None + }, + memory: if filter.enable_memory { + Some(memory.into()) + } else { + None + }, + }, + evm_runtime::tracing::Event::StepResult { + result, + return_value, + } => Self::StepResult { + result: match result { + Ok(_) => Ok(()), + Err(capture) => match capture { + evm::Capture::Exit(e) => Err(Capture::Exit(e.clone())), + evm::Capture::Trap(t) => Err(Capture::Trap(opcodes_string(*t))), + }, + }, + return_value: return_value.to_vec(), + }, + evm_runtime::tracing::Event::SLoad { + address, + index, + value, + } => Self::SLoad { + address, + index, + value, + }, + evm_runtime::tracing::Event::SStore { + address, + index, + value, + } => Self::SStore { + address, + index, + value, + }, + } + } +} + +#[cfg(feature = "evm-tracing")] +/// Converts an Opcode into its name, stored in a `Vec`. +pub fn opcodes_string(opcode: Opcode) -> Vec { + let tmp; + let out = match opcode { + Opcode(0) => "Stop", + Opcode(1) => "Add", + Opcode(2) => "Mul", + Opcode(3) => "Sub", + Opcode(4) => "Div", + Opcode(5) => "SDiv", + Opcode(6) => "Mod", + Opcode(7) => "SMod", + Opcode(8) => "AddMod", + Opcode(9) => "MulMod", + Opcode(10) => "Exp", + Opcode(11) => "SignExtend", + Opcode(16) => "Lt", + Opcode(17) => "Gt", + Opcode(18) => "Slt", + Opcode(19) => "Sgt", + Opcode(20) => "Eq", + Opcode(21) => "IsZero", + Opcode(22) => "And", + Opcode(23) => "Or", + Opcode(24) => "Xor", + Opcode(25) => "Not", + Opcode(26) => "Byte", + Opcode(27) => "Shl", + Opcode(28) => "Shr", + Opcode(29) => "Sar", + Opcode(32) => "Keccak256", + Opcode(48) => "Address", + Opcode(49) => "Balance", + Opcode(50) => "Origin", + Opcode(51) => "Caller", + Opcode(52) => "CallValue", + Opcode(53) => "CallDataLoad", + Opcode(54) => "CallDataSize", + Opcode(55) => "CallDataCopy", + Opcode(56) => "CodeSize", + Opcode(57) => "CodeCopy", + Opcode(58) => "GasPrice", + Opcode(59) => "ExtCodeSize", + Opcode(60) => "ExtCodeCopy", + Opcode(61) => "ReturnDataSize", + Opcode(62) => "ReturnDataCopy", + Opcode(63) => "ExtCodeHash", + Opcode(64) => "BlockHash", + Opcode(65) => "Coinbase", + Opcode(66) => "Timestamp", + Opcode(67) => "Number", + Opcode(68) => "Difficulty", + Opcode(69) => "GasLimit", + Opcode(70) => "ChainId", + Opcode(80) => "Pop", + Opcode(81) => "MLoad", + Opcode(82) => "MStore", + Opcode(83) => "MStore8", + Opcode(84) => "SLoad", + Opcode(85) => "SStore", + Opcode(86) => "Jump", + Opcode(87) => "JumpI", + Opcode(88) => "GetPc", + Opcode(89) => "MSize", + Opcode(90) => "Gas", + Opcode(91) => "JumpDest", + Opcode(96) => "Push1", + Opcode(97) => "Push2", + Opcode(98) => "Push3", + Opcode(99) => "Push4", + Opcode(100) => "Push5", + Opcode(101) => "Push6", + Opcode(102) => "Push7", + Opcode(103) => "Push8", + Opcode(104) => "Push9", + Opcode(105) => "Push10", + Opcode(106) => "Push11", + Opcode(107) => "Push12", + Opcode(108) => "Push13", + Opcode(109) => "Push14", + Opcode(110) => "Push15", + Opcode(111) => "Push16", + Opcode(112) => "Push17", + Opcode(113) => "Push18", + Opcode(114) => "Push19", + Opcode(115) => "Push20", + Opcode(116) => "Push21", + Opcode(117) => "Push22", + Opcode(118) => "Push23", + Opcode(119) => "Push24", + Opcode(120) => "Push25", + Opcode(121) => "Push26", + Opcode(122) => "Push27", + Opcode(123) => "Push28", + Opcode(124) => "Push29", + Opcode(125) => "Push30", + Opcode(126) => "Push31", + Opcode(127) => "Push32", + Opcode(128) => "Dup1", + Opcode(129) => "Dup2", + Opcode(130) => "Dup3", + Opcode(131) => "Dup4", + Opcode(132) => "Dup5", + Opcode(133) => "Dup6", + Opcode(134) => "Dup7", + Opcode(135) => "Dup8", + Opcode(136) => "Dup9", + Opcode(137) => "Dup10", + Opcode(138) => "Dup11", + Opcode(139) => "Dup12", + Opcode(140) => "Dup13", + Opcode(141) => "Dup14", + Opcode(142) => "Dup15", + Opcode(143) => "Dup16", + Opcode(144) => "Swap1", + Opcode(145) => "Swap2", + Opcode(146) => "Swap3", + Opcode(147) => "Swap4", + Opcode(148) => "Swap5", + Opcode(149) => "Swap6", + Opcode(150) => "Swap7", + Opcode(151) => "Swap8", + Opcode(152) => "Swap9", + Opcode(153) => "Swap10", + Opcode(154) => "Swap11", + Opcode(155) => "Swap12", + Opcode(156) => "Swap13", + Opcode(157) => "Swap14", + Opcode(158) => "Swap15", + Opcode(159) => "Swap16", + Opcode(160) => "Log0", + Opcode(161) => "Log1", + Opcode(162) => "Log2", + Opcode(163) => "Log3", + Opcode(164) => "Log4", + Opcode(176) => "JumpTo", + Opcode(177) => "JumpIf", + Opcode(178) => "JumpSub", + Opcode(180) => "JumpSubv", + Opcode(181) => "BeginSub", + Opcode(182) => "BeginData", + Opcode(184) => "ReturnSub", + Opcode(185) => "PutLocal", + Opcode(186) => "GetLocal", + Opcode(225) => "SLoadBytes", + Opcode(226) => "SStoreBytes", + Opcode(227) => "SSize", + Opcode(240) => "Create", + Opcode(241) => "Call", + Opcode(242) => "CallCode", + Opcode(243) => "Return", + Opcode(244) => "DelegateCall", + Opcode(245) => "Create2", + Opcode(250) => "StaticCall", + Opcode(252) => "TxExecGas", + Opcode(253) => "Revert", + Opcode(254) => "Invalid", + Opcode(255) => "SelfDestruct", + Opcode(n) => { + tmp = alloc::format!("Unknown({})", n); + &tmp + } + }; + out.as_bytes().to_vec() +} diff --git a/vendor/primitives/rpc/txpool/Cargo.toml b/vendor/primitives/rpc/txpool/Cargo.toml new file mode 100644 index 00000000..1aa1ff08 --- /dev/null +++ b/vendor/primitives/rpc/txpool/Cargo.toml @@ -0,0 +1,30 @@ +[package] +name = "moonbeam-rpc-primitives-txpool" +authors = { workspace = true } +edition = "2021" +homepage = "https://moonbeam.network" +license = "GPL-3.0-only" +repository = { workspace = true } +version = "0.6.0" + +[dependencies] +ethereum = { workspace = true, features = [ "with-codec" ] } + +# Substrate +parity-scale-codec = { workspace = true } +scale-info = { workspace = true, features = [ "derive" ] } +sp-api = { workspace = true } +sp-io = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } + +[features] +default = [ "std" ] +std = [ + "ethereum/std", + "scale-info/std", + "sp-api/std", + "sp-io/std", + "sp-runtime/std", + "sp-std/std", +] diff --git a/vendor/primitives/rpc/txpool/src/lib.rs b/vendor/primitives/rpc/txpool/src/lib.rs new file mode 100644 index 00000000..219631e1 --- /dev/null +++ b/vendor/primitives/rpc/txpool/src/lib.rs @@ -0,0 +1,54 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +#![cfg_attr(not(feature = "std"), no_std)] +// These clippy lints are disabled because the macro-generated code triggers them. +#![allow(clippy::unnecessary_mut_passed)] +#![allow(clippy::too_many_arguments)] + +pub use ethereum::{TransactionV0 as LegacyTransaction, TransactionV2 as Transaction}; +use parity_scale_codec::{Decode, Encode}; +use sp_runtime::scale_info::TypeInfo; +use sp_runtime::traits::Block as BlockT; +use sp_runtime::RuntimeDebug; +use sp_std::vec::Vec; + +#[derive(Eq, PartialEq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +pub struct TxPoolResponseLegacy { + pub ready: Vec, + pub future: Vec, +} + +#[derive(Eq, PartialEq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +pub struct TxPoolResponse { + pub ready: Vec, + pub future: Vec, +} + +sp_api::decl_runtime_apis! { + #[api_version(2)] + pub trait TxPoolRuntimeApi { + #[changed_in(2)] + fn extrinsic_filter( + xt_ready: Vec<::Extrinsic>, + xt_future: Vec<::Extrinsic>, + ) -> TxPoolResponseLegacy; + fn extrinsic_filter( + xt_ready: Vec<::Extrinsic>, + xt_future: Vec<::Extrinsic>, + ) -> TxPoolResponse; + } +} diff --git a/vendor/rpc-core/debug/Cargo.toml b/vendor/rpc-core/debug/Cargo.toml new file mode 100644 index 00000000..c693d636 --- /dev/null +++ b/vendor/rpc-core/debug/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "moonbeam-rpc-core-debug" +authors = { workspace = true } +edition = "2021" +homepage = "https://moonbeam.network" +license = "GPL-3.0-only" +repository = { workspace = true } +version = "0.1.0" + +[dependencies] +ethereum-types = { workspace = true, features = [ "std" ] } +futures = { workspace = true, features = [ "compat" ] } +jsonrpsee = { workspace = true, features = [ "macros", "server" ] } +moonbeam-client-evm-tracing = { workspace = true } +moonbeam-rpc-core-types = { workspace = true } +serde = { workspace = true, features = [ "derive" ] } +serde_json = { workspace = true } + +sp-core = { workspace = true, features = [ "std" ] } diff --git a/vendor/rpc-core/debug/src/lib.rs b/vendor/rpc-core/debug/src/lib.rs new file mode 100644 index 00000000..0c10a35f --- /dev/null +++ b/vendor/rpc-core/debug/src/lib.rs @@ -0,0 +1,48 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . +use ethereum_types::H256; +use jsonrpsee::{core::RpcResult, proc_macros::rpc}; +use moonbeam_client_evm_tracing::types::single; +use moonbeam_rpc_core_types::RequestBlockId; +use serde::Deserialize; + +#[derive(Clone, Eq, PartialEq, Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TraceParams { + pub disable_storage: Option, + pub disable_memory: Option, + pub disable_stack: Option, + /// Javascript tracer (we just check if it's Blockscout tracer string) + pub tracer: Option, + pub timeout: Option, +} + +#[rpc(server)] +#[jsonrpsee::core::async_trait] +pub trait Debug { + #[method(name = "debug_traceTransaction")] + async fn trace_transaction( + &self, + transaction_hash: H256, + params: Option, + ) -> RpcResult; + #[method(name = "debug_traceBlockByNumber", aliases = ["debug_traceBlockByHash"])] + async fn trace_block( + &self, + id: RequestBlockId, + params: Option, + ) -> RpcResult>; +} diff --git a/vendor/rpc-core/trace/Cargo.toml b/vendor/rpc-core/trace/Cargo.toml new file mode 100644 index 00000000..048e15b5 --- /dev/null +++ b/vendor/rpc-core/trace/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "moonbeam-rpc-core-trace" +authors = { workspace = true } +edition = "2021" +homepage = "https://moonbeam.network" +license = "GPL-3.0-only" +repository = { workspace = true } +version = "0.6.0" + +[dependencies] +ethereum-types = { workspace = true, features = [ "std" ] } +futures = { workspace = true, features = [ "compat" ] } +jsonrpsee = { workspace = true, features = [ "macros", "server" ] } +moonbeam-client-evm-tracing = { workspace = true } +moonbeam-rpc-core-types = { workspace = true } +serde = { workspace = true, features = [ "derive" ] } +serde_json = { workspace = true } diff --git a/vendor/rpc-core/trace/src/lib.rs b/vendor/rpc-core/trace/src/lib.rs new file mode 100644 index 00000000..e52a9254 --- /dev/null +++ b/vendor/rpc-core/trace/src/lib.rs @@ -0,0 +1,50 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +use ethereum_types::H160; +use jsonrpsee::{core::RpcResult, proc_macros::rpc}; +use moonbeam_client_evm_tracing::types::block::TransactionTrace; +use moonbeam_rpc_core_types::RequestBlockId; +use serde::Deserialize; + +#[rpc(server)] +#[jsonrpsee::core::async_trait] +pub trait Trace { + #[method(name = "trace_filter")] + async fn filter(&self, filter: FilterRequest) -> RpcResult>; +} + +#[derive(Clone, Eq, PartialEq, Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FilterRequest { + /// (optional?) From this block. + pub from_block: Option, + + /// (optional?) To this block. + pub to_block: Option, + + /// (optional) Sent from these addresses. + pub from_address: Option>, + + /// (optional) Sent to these addresses. + pub to_address: Option>, + + /// (optional) The offset trace number + pub after: Option, + + /// (optional) Integer number of traces to display in a batch. + pub count: Option, +} diff --git a/vendor/rpc-core/txpool/Cargo.toml b/vendor/rpc-core/txpool/Cargo.toml new file mode 100644 index 00000000..9467c940 --- /dev/null +++ b/vendor/rpc-core/txpool/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "moonbeam-rpc-core-txpool" +authors = { workspace = true } +edition = "2021" +homepage = "https://moonbeam.network" +license = "GPL-3.0-only" +repository = { workspace = true } +version = "0.6.0" + +[dependencies] +ethereum = { workspace = true, features = [ "std", "with-codec" ] } +ethereum-types = { workspace = true, features = [ "std" ] } +jsonrpsee = { workspace = true, features = [ "macros", "server" ] } +serde = { workspace = true, features = [ "derive" ] } +serde_json = { workspace = true } + +fc-rpc-core = { workspace = true } diff --git a/vendor/rpc-core/txpool/src/lib.rs b/vendor/rpc-core/txpool/src/lib.rs new file mode 100644 index 00000000..87d6dbe8 --- /dev/null +++ b/vendor/rpc-core/txpool/src/lib.rs @@ -0,0 +1,34 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +use ethereum_types::U256; +use jsonrpsee::{core::RpcResult, proc_macros::rpc}; + +mod types; + +pub use crate::types::{Get as GetT, Summary, Transaction, TransactionMap, TxPoolResult}; + +#[rpc(server)] +pub trait TxPool { + #[method(name = "txpool_content")] + fn content(&self) -> RpcResult>>; + + #[method(name = "txpool_inspect")] + fn inspect(&self) -> RpcResult>>; + + #[method(name = "txpool_status")] + fn status(&self) -> RpcResult>; +} diff --git a/vendor/rpc-core/txpool/src/types/content.rs b/vendor/rpc-core/txpool/src/types/content.rs new file mode 100644 index 00000000..a52f11bc --- /dev/null +++ b/vendor/rpc-core/txpool/src/types/content.rs @@ -0,0 +1,111 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +use crate::GetT; +use ethereum::{TransactionAction, TransactionV2 as EthereumTransaction}; +use ethereum_types::{H160, H256, U256}; +use fc_rpc_core::types::Bytes; +use serde::{Serialize, Serializer}; + +#[derive(Debug, Default, Clone, PartialEq, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct Transaction { + /// Hash + pub hash: H256, + /// Nonce + pub nonce: U256, + /// Block hash + #[serde(serialize_with = "block_hash_serialize")] + pub block_hash: Option, + /// Block number + pub block_number: Option, + /// Sender + pub from: H160, + /// Recipient + #[serde(serialize_with = "to_serialize")] + pub to: Option, + /// Transfered value + pub value: U256, + /// Gas Price + pub gas_price: U256, + /// Gas + pub gas: U256, + /// Data + pub input: Bytes, + /// Transaction Index + pub transaction_index: Option, +} + +fn block_hash_serialize(hash: &Option, serializer: S) -> Result +where + S: Serializer, +{ + serializer.serialize_str(&format!("0x{:x}", hash.unwrap_or_default())) +} + +fn to_serialize(hash: &Option, serializer: S) -> Result +where + S: Serializer, +{ + serializer.serialize_str(&format!("0x{:x}", hash.unwrap_or_default())) +} + +impl GetT for Transaction { + fn get(hash: H256, from_address: H160, txn: &EthereumTransaction) -> Self { + let (nonce, action, value, gas_price, gas_limit, input) = match txn { + EthereumTransaction::Legacy(t) => ( + t.nonce, + t.action, + t.value, + t.gas_price, + t.gas_limit, + t.input.clone(), + ), + EthereumTransaction::EIP2930(t) => ( + t.nonce, + t.action, + t.value, + t.gas_price, + t.gas_limit, + t.input.clone(), + ), + EthereumTransaction::EIP1559(t) => ( + t.nonce, + t.action, + t.value, + t.max_fee_per_gas, + t.gas_limit, + t.input.clone(), + ), + }; + Self { + hash, + nonce, + block_hash: None, + block_number: None, + from: from_address, + to: match action { + TransactionAction::Call(to) => Some(to), + _ => None, + }, + value, + gas_price, + gas: gas_limit, + input: Bytes(input), + transaction_index: None, + } + } +} diff --git a/vendor/rpc-core/txpool/src/types/inspect.rs b/vendor/rpc-core/txpool/src/types/inspect.rs new file mode 100644 index 00000000..95e7240b --- /dev/null +++ b/vendor/rpc-core/txpool/src/types/inspect.rs @@ -0,0 +1,63 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +use crate::GetT; +use ethereum::{TransactionAction, TransactionV2 as EthereumTransaction}; +use ethereum_types::{H160, H256, U256}; +use serde::{Serialize, Serializer}; + +#[derive(Clone, Debug)] +pub struct Summary { + pub to: Option, + pub value: U256, + pub gas: U256, + pub gas_price: U256, +} + +impl Serialize for Summary { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + let res = format!( + "0x{:x}: {} wei + {} gas x {} wei", + self.to.unwrap_or_default(), + self.value, + self.gas, + self.gas_price + ); + serializer.serialize_str(&res) + } +} + +impl GetT for Summary { + fn get(_hash: H256, _from_address: H160, txn: &EthereumTransaction) -> Self { + let (action, value, gas_price, gas_limit) = match txn { + EthereumTransaction::Legacy(t) => (t.action, t.value, t.gas_price, t.gas_limit), + EthereumTransaction::EIP2930(t) => (t.action, t.value, t.gas_price, t.gas_limit), + EthereumTransaction::EIP1559(t) => (t.action, t.value, t.max_fee_per_gas, t.gas_limit), + }; + Self { + to: match action { + TransactionAction::Call(to) => Some(to), + _ => None, + }, + value, + gas_price, + gas: gas_limit, + } + } +} diff --git a/vendor/rpc-core/txpool/src/types/mod.rs b/vendor/rpc-core/txpool/src/types/mod.rs new file mode 100644 index 00000000..2a783eaa --- /dev/null +++ b/vendor/rpc-core/txpool/src/types/mod.rs @@ -0,0 +1,38 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +mod content; +mod inspect; + +use ethereum::TransactionV2 as EthereumTransaction; +use ethereum_types::{H160, H256, U256}; +use serde::Serialize; +use std::collections::HashMap; + +pub use self::content::Transaction; +pub use self::inspect::Summary; + +pub type TransactionMap = HashMap>; + +#[derive(Debug, Serialize)] +pub struct TxPoolResult { + pub pending: T, + pub queued: T, +} + +pub trait Get { + fn get(hash: H256, from_address: H160, txn: &EthereumTransaction) -> Self; +} diff --git a/vendor/rpc-core/types/Cargo.toml b/vendor/rpc-core/types/Cargo.toml new file mode 100644 index 00000000..5ab90865 --- /dev/null +++ b/vendor/rpc-core/types/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "moonbeam-rpc-core-types" +authors = { workspace = true } +edition = "2021" +homepage = "https://moonbeam.network" +license = "GPL-3.0-only" +repository = { workspace = true } +version = "0.1.0" + +[dependencies] +ethereum-types = { workspace = true, features = [ "std" ] } +serde = { workspace = true, features = [ "derive" ] } +serde_json = { workspace = true } diff --git a/vendor/rpc-core/types/src/lib.rs b/vendor/rpc-core/types/src/lib.rs new file mode 100644 index 00000000..49130982 --- /dev/null +++ b/vendor/rpc-core/types/src/lib.rs @@ -0,0 +1,48 @@ +// Copyright 2019-2022 PureStake Inc.. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +use ethereum_types::H256; +use serde::{de::Error, Deserialize, Deserializer}; + +#[derive(Copy, Clone, Eq, PartialEq, Debug, Deserialize)] +#[serde(rename_all = "camelCase", untagged)] +pub enum RequestBlockId { + Number(#[serde(deserialize_with = "deserialize_u32_0x")] u32), + Hash(H256), + Tag(RequestBlockTag), +} + +#[derive(Copy, Clone, Eq, PartialEq, Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub enum RequestBlockTag { + Earliest, + Latest, + Pending, +} + +fn deserialize_u32_0x<'de, D>(deserializer: D) -> Result +where + D: Deserializer<'de>, +{ + let buf = String::deserialize(deserializer)?; + + let parsed = match buf.strip_prefix("0x") { + Some(buf) => u32::from_str_radix(&buf, 16), + None => u32::from_str_radix(&buf, 10), + }; + + parsed.map_err(|e| Error::custom(format!("parsing error: {:?} from '{}'", e, buf))) +} diff --git a/vendor/runtime/evm_tracer/Cargo.toml b/vendor/runtime/evm_tracer/Cargo.toml new file mode 100644 index 00000000..6972c702 --- /dev/null +++ b/vendor/runtime/evm_tracer/Cargo.toml @@ -0,0 +1,47 @@ +[package] +name = "moonbeam-evm-tracer" +authors = { workspace = true } +edition = "2021" +homepage = "https://moonbeam.network" +license = "GPL-3.0-only" +repository = { workspace = true } +version = "0.1.0" + +[dependencies] + +# Moonbeam +evm-tracing-events = { workspace = true, features = [ "evm-tracing" ] } +moonbeam-primitives-ext = { workspace = true } + +# Substrate +parity-scale-codec = { workspace = true } +sp-core = { workspace = true } +sp-io = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } + +# Frontier +ethereum-types = { workspace = true } +evm = { workspace = true } +evm-gasometer = { workspace = true } +evm-runtime = { workspace = true } +fp-evm = { workspace = true } +pallet-evm = { workspace = true, features = [ "forbid-evm-reentrancy" ] } + +[features] +default = [ "std" ] +std = [ + "ethereum-types/std", + "evm-gasometer/std", + "evm-runtime/std", + "evm-tracing-events/std", + "evm/std", + "evm/with-serde", + "fp-evm/std", + "moonbeam-primitives-ext/std", + "pallet-evm/std", + "parity-scale-codec/std", + "sp-core/std", + "sp-runtime/std", + "sp-std/std", +] diff --git a/vendor/runtime/evm_tracer/src/lib.rs b/vendor/runtime/evm_tracer/src/lib.rs new file mode 100644 index 00000000..5d998775 --- /dev/null +++ b/vendor/runtime/evm_tracer/src/lib.rs @@ -0,0 +1,117 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! Substrate EVM tracing. +//! +//! The purpose of this crate is enable tracing the EVM opcode execution and will be used by +//! both Dapp developers - to get a granular view on their transactions - and indexers to access +//! the EVM callstack (internal transactions). +//! +//! Proxies EVM messages to the host functions. + +#![cfg_attr(not(feature = "std"), no_std)] + +pub mod tracer { + use evm_tracing_events::{EvmEvent, GasometerEvent, RuntimeEvent, StepEventFilter}; + use parity_scale_codec::Encode; + + use evm::tracing::{using as evm_using, EventListener as EvmListener}; + use evm_gasometer::tracing::{using as gasometer_using, EventListener as GasometerListener}; + use evm_runtime::tracing::{using as runtime_using, EventListener as RuntimeListener}; + use sp_std::{cell::RefCell, rc::Rc}; + + struct ListenerProxy(pub Rc>); + impl GasometerListener for ListenerProxy { + fn event(&mut self, event: evm_gasometer::tracing::Event) { + self.0.borrow_mut().event(event); + } + } + + impl RuntimeListener for ListenerProxy { + fn event(&mut self, event: evm_runtime::tracing::Event) { + self.0.borrow_mut().event(event); + } + } + + impl EvmListener for ListenerProxy { + fn event(&mut self, event: evm::tracing::Event) { + self.0.borrow_mut().event(event); + } + } + + pub struct EvmTracer { + step_event_filter: StepEventFilter, + } + + impl EvmTracer { + pub fn new() -> Self { + Self { + step_event_filter: moonbeam_primitives_ext::moonbeam_ext::step_event_filter(), + } + } + + /// Setup event listeners and execute provided closure. + /// + /// Consume the tracer and return it alongside the return value of + /// the closure. + pub fn trace R>(self, f: F) { + let wrapped = Rc::new(RefCell::new(self)); + + let mut gasometer = ListenerProxy(Rc::clone(&wrapped)); + let mut runtime = ListenerProxy(Rc::clone(&wrapped)); + let mut evm = ListenerProxy(Rc::clone(&wrapped)); + + // Each line wraps the previous `f` into a `using` call. + // Listening to new events results in adding one new line. + // Order is irrelevant when registering listeners. + let f = || runtime_using(&mut runtime, f); + let f = || gasometer_using(&mut gasometer, f); + let f = || evm_using(&mut evm, f); + f(); + } + + pub fn emit_new() { + moonbeam_primitives_ext::moonbeam_ext::call_list_new(); + } + } + + impl EvmListener for EvmTracer { + /// Proxies `evm::tracing::Event` to the host. + fn event(&mut self, event: evm::tracing::Event) { + let event: EvmEvent = event.into(); + let message = event.encode(); + moonbeam_primitives_ext::moonbeam_ext::evm_event(message); + } + } + + impl GasometerListener for EvmTracer { + /// Proxies `evm_gasometer::tracing::Event` to the host. + fn event(&mut self, event: evm_gasometer::tracing::Event) { + let event: GasometerEvent = event.into(); + let message = event.encode(); + moonbeam_primitives_ext::moonbeam_ext::gasometer_event(message); + } + } + + impl RuntimeListener for EvmTracer { + /// Proxies `evm_runtime::tracing::Event` to the host. + fn event(&mut self, event: evm_runtime::tracing::Event) { + let event = RuntimeEvent::from_evm_event(event, self.step_event_filter); + let message = event.encode(); + moonbeam_primitives_ext::moonbeam_ext::runtime_event(message); + } + } +} From f18e8f962eaadc2ad2b0a5122a6b0ce6cd5004e1 Mon Sep 17 00:00:00 2001 From: Carlos Lostao Date: Wed, 15 Nov 2023 12:37:25 +0100 Subject: [PATCH 27/37] update: node service for changes --- node/src/rpc/eth.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/node/src/rpc/eth.rs b/node/src/rpc/eth.rs index 770f9ce1..ffec6174 100644 --- a/node/src/rpc/eth.rs +++ b/node/src/rpc/eth.rs @@ -110,6 +110,7 @@ where C: BlockchainEvents + 'static, C: HeaderBackend + HeaderMetadata + StorageProvider, BE: Backend + 'static, + B::Header: HeaderT, P: TransactionPool + 'static, A: ChainApi + 'static, CT: ConvertTransaction<::Extrinsic> + Send + Sync + 'static, From c3f41d5801430aae1455542b88ca9de2e7774001 Mon Sep 17 00:00:00 2001 From: Carlos Lostao Date: Wed, 15 Nov 2023 13:07:12 +0100 Subject: [PATCH 28/37] fix: address comparison --- vendor/client/evm-tracing/src/formatters/call_tracer.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vendor/client/evm-tracing/src/formatters/call_tracer.rs b/vendor/client/evm-tracing/src/formatters/call_tracer.rs index dc91ee60..62543bd0 100644 --- a/vendor/client/evm-tracing/src/formatters/call_tracer.rs +++ b/vendor/client/evm-tracing/src/formatters/call_tracer.rs @@ -208,9 +208,7 @@ impl super::ResponseFormatter for Formatter { }), ) => { &b[..] - == a.get(0..a.len() - 1).expect( - "non-root element while traversing trace result", - ) + == &a[..] } _ => unreachable!(), }) { From c9ddedd6ce4587710f1ca065ab9dae06449e1365 Mon Sep 17 00:00:00 2001 From: Carlos Lostao Date: Wed, 15 Nov 2023 17:40:36 +0100 Subject: [PATCH 29/37] fix: warnings --- client/authorship/Cargo.toml | 2 +- client/authorship/src/authorship.rs | 2 +- node/Cargo.toml | 4 +- node/src/eth.rs | 49 +++++++++++++++++++ node/src/rpc/eth.rs | 2 +- node/src/rpc/mod.rs | 2 - node/src/rpc/tracing.rs | 22 ++++----- node/src/service.rs | 10 ++-- pallets/dnt-fee-controller/Cargo.toml | 2 +- pallets/erc20-manager/Cargo.toml | 2 +- pallets/sponsored-transactions/Cargo.toml | 2 +- pallets/upgrade-runtime-proposal/Cargo.toml | 2 +- .../fee-token-selector/Cargo.toml | 2 +- .../supported-tokens-manager/Cargo.toml | 2 +- primitives/fee-compatible-api/Cargo.toml | 2 +- primitives/transaction-validator/Cargo.toml | 2 +- .../zero-gas-transactions-api/Cargo.toml | 2 +- test-utils/stability-client/Cargo.toml | 2 +- test-utils/stability-root-testing/Cargo.toml | 4 +- .../stability-runtime-client/Cargo.toml | 2 +- 20 files changed, 80 insertions(+), 39 deletions(-) diff --git a/client/authorship/Cargo.toml b/client/authorship/Cargo.toml index 90d760fe..ee9941ab 100644 --- a/client/authorship/Cargo.toml +++ b/client/authorship/Cargo.toml @@ -12,7 +12,7 @@ repository = "https://github.com/stabilityprotocol/stability/" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { workspace = true, package = "parity-scale-codec" } +parity-scale-codec = { workspace = true } futures = { workspace = true } futures-timer = { workspace = true } log = { workspace = true } diff --git a/client/authorship/src/authorship.rs b/client/authorship/src/authorship.rs index f11685f8..3bd3daca 100644 --- a/client/authorship/src/authorship.rs +++ b/client/authorship/src/authorship.rs @@ -19,7 +19,7 @@ // FIXME #1021 move this into sp-consensus use account::EthereumSigner; -use codec::Encode; +use parity_scale_codec::Encode; use futures::{ channel::oneshot, future, diff --git a/node/Cargo.toml b/node/Cargo.toml index 86bb0537..fc805f76 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -19,11 +19,11 @@ futures = { workspace = true } hex-literal = { workspace = true } jsonrpsee = { workspace = true, features = ["server", "macros"] } log = { workspace = true } -scale-codec = { workspace = true, package = "parity-scale-codec" } +scale-codec = { workspace = true } serde = { workspace = true } # Substrate -prometheus-endpoint = { package = "substrate-prometheus-endpoint", workspace = true } +prometheus-endpoint = { workspace = true } sc-chain-spec = { workspace = true } sc-cli = { workspace = true } sc-client-api = { workspace = true } diff --git a/node/src/eth.rs b/node/src/eth.rs index 04574f7c..f02f6272 100644 --- a/node/src/eth.rs +++ b/node/src/eth.rs @@ -13,6 +13,7 @@ use sc_network_sync::SyncingService; use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; use sp_api::ConstructRuntimeApi; use sp_runtime::traits::BlakeTwo256; +use core::str::FromStr; // Frontier pub use fc_consensus::FrontierBlockImport; @@ -40,6 +41,32 @@ pub enum BackendType { Sql, } + +#[derive(Debug, PartialEq, Clone)] +pub enum EthApi { + Txpool, + Debug, + Trace, +} + +impl FromStr for EthApi { + type Err = String; + + fn from_str(s: &str) -> Result { + Ok(match s { + "txpool" => Self::Txpool, + "debug" => Self::Debug, + "trace" => Self::Trace, + _ => { + return Err(format!( + "`{}` is not recognized as a supported Ethereum Api", + s + )) + } + }) + } +} + /// The ethereum-compatibility configuration used to run a node. #[derive(Clone, Debug, clap::Parser)] pub struct EthConfiguration { @@ -88,6 +115,28 @@ pub struct EthConfiguration { /// Default value is 200MB. #[arg(long, default_value = "209715200")] pub frontier_sql_backend_cache_size: u64, + + /// Sets the maximum permits + #[arg(long, default_value = "10")] + pub ethapi_max_permits: u64, + + /// Sets the maximum permits + #[arg(long, default_value = "500")] + pub trace_filter_max_count: u32, + + /// Size in bytes of data a raw tracing request is allowed to use. + /// Bound the size of memory, stack and storage data. + #[arg(long, default_value = "20000000")] + pub tracing_raw_max_memory_usage: usize, + + /// Duration (in seconds) after which the cache of `trace_filter` for a given block will be + /// discarded. + #[arg(long, default_value = "300")] + pub ethapi_trace_cache_duration: u64, + + #[arg(long, value_delimiter = ',', default_value = "debug,trace")] + pub ethapi: Vec, + } pub struct FrontierPartialComponents { diff --git a/node/src/rpc/eth.rs b/node/src/rpc/eth.rs index ffec6174..7efabcd9 100644 --- a/node/src/rpc/eth.rs +++ b/node/src/rpc/eth.rs @@ -117,7 +117,7 @@ where { use fc_rpc::{ Eth, EthApiServer, EthDevSigner, EthFilter, EthFilterApiServer, EthPubSub, - EthPubSubApiServer, EthSigner, Net, NetApiServer, TxPoolApiServer, Web3, Web3ApiServer, + EthPubSubApiServer, EthSigner, Net, NetApiServer, Web3, Web3ApiServer, }; let EthDeps { diff --git a/node/src/rpc/mod.rs b/node/src/rpc/mod.rs index 17c2ed78..cca57894 100644 --- a/node/src/rpc/mod.rs +++ b/node/src/rpc/mod.rs @@ -87,8 +87,6 @@ where A: ChainApi + 'static, CT: fp_rpc::ConvertTransaction<::Extrinsic> + Send + Sync + 'static, { - use moonbeam_rpc_debug::*; - use moonbeam_rpc_trace::*; use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; use sc_consensus_manual_seal::rpc::{ManualSeal, ManualSealApiServer}; use stability_rpc::{StabilityRpc, StabilityRpcEndpointsServer}; diff --git a/node/src/rpc/tracing.rs b/node/src/rpc/tracing.rs index 04d6d441..02b5caa9 100644 --- a/node/src/rpc/tracing.rs +++ b/node/src/rpc/tracing.rs @@ -18,20 +18,20 @@ use std::time::Duration; use super::*; -use fc_db::Backend as BackendT; use fc_rpc::OverrideHandle; use fp_rpc::EthereumRuntimeRPCApi; use moonbeam_rpc_debug::{DebugHandler, DebugRequester}; use moonbeam_rpc_trace::{CacheRequester as TraceFilterCacheRequester, CacheTask}; use sc_client_api::BlockOf; use sc_service::TaskManager; -use sp_core::{traits::SpawnEssentialNamed, H256}; +use sp_core::{H256}; use sp_runtime::traits::Header as HeaderT; use tokio::sync::Semaphore; use sp_runtime::traits::BlakeTwo256; use sc_client_api::StateBackend; use sp_block_builder::BlockBuilder; use fc_db::BackendReader; +use crate::eth::{EthConfiguration, EthApi}; #[derive(Clone)] pub struct RpcRequesters { @@ -41,6 +41,7 @@ pub struct RpcRequesters { // Spawn the tasks that are required to run a Moonbeam tracing node. pub fn spawn_tracing_tasks( + eth_config: &EthConfiguration, task_manager: &TaskManager, client: Arc, backend: Arc, @@ -60,19 +61,14 @@ where B::Header: HeaderT, BE: Backend + 'static, BE::State: StateBackend, -{ - let ethapi_max_permits = 1000; - let trace_enabled = true; - let debug_enabled = true; - let permit_pool = Arc::new(Semaphore::new(ethapi_max_permits as usize)); - let tracing_raw_max_memory_usage = 1024 * 1024; - let ethapi_trace_cache_duration = 3600; +{ + let permit_pool = Arc::new(Semaphore::new(eth_config.ethapi_max_permits as usize)); - let (trace_filter_task, trace_filter_requester) = if trace_enabled { + let (trace_filter_task, trace_filter_requester) = if eth_config.ethapi.contains(&EthApi::Trace) { let (trace_filter_task, trace_filter_requester) = CacheTask::create( Arc::clone(&client), Arc::clone(&backend), - Duration::from_secs(ethapi_trace_cache_duration), + Duration::from_secs(eth_config.ethapi_trace_cache_duration), Arc::clone(&permit_pool), Arc::clone(&overrides), prometheus_registry.clone() @@ -82,14 +78,14 @@ where (None, None) }; - let (debug_task, debug_requester) = if debug_enabled { + let (debug_task, debug_requester) = if eth_config.ethapi.contains(&EthApi::Debug) { let (debug_task, debug_requester) = DebugHandler::task( Arc::clone(&client), Arc::clone(&backend), Arc::clone(&frontier_backend), Arc::clone(&permit_pool), Arc::clone(&overrides), - tracing_raw_max_memory_usage, + eth_config.tracing_raw_max_memory_usage, ); (Some(debug_task), Some(debug_requester)) } else { diff --git a/node/src/service.rs b/node/src/service.rs index 43cedce4..907c0704 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -2,24 +2,21 @@ use std::{cell::RefCell, path::Path, sync::Arc, time::Duration}; -use fc_rpc::OverrideHandle; use futures::{channel::mpsc, prelude::*}; // Substrate use prometheus_endpoint::Registry; use sc_client_api::{BlockBackend, StateBackendFor}; use sc_consensus::BasicQueue; -use sc_executor::{NativeElseWasmExecutor, NativeExecutionDispatch}; +use sc_executor::{NativeExecutionDispatch}; use sc_network_common::sync::warp::WarpSyncParams; use sc_service::{ - error::Error as ServiceError, Configuration, PartialComponents, SpawnTaskHandle, TaskManager, + error::Error as ServiceError, Configuration, PartialComponents, TaskManager, }; use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker}; use sp_api::{ConstructRuntimeApi, TransactionFor}; -use sp_core::traits::SpawnEssentialNamed; use sp_runtime::traits::BlakeTwo256; use sp_trie::PrefixedMemoryDB; use stbl_primitives_zero_gas_transactions_api::ZeroGasTransactionApi; -use tokio::sync::Semaphore; // Runtime use sc_service::KeystoreContainer; use stability_runtime::{opaque::Block, Hash, TransactionConverter}; @@ -413,6 +410,7 @@ where }; let tracing_requesters = crate::rpc::spawn_tracing_tasks( + ð_config.clone(), &task_manager, client.clone(), backend.clone(), @@ -449,7 +447,7 @@ where pubsub_notification_sinks.clone(), Some(TracingConfig { tracing_requesters: tracing_requesters.clone(), - trace_filter_max_count: 2000u32, + trace_filter_max_count: eth_config.trace_filter_max_count, }), ) .map_err(Into::into) diff --git a/pallets/dnt-fee-controller/Cargo.toml b/pallets/dnt-fee-controller/Cargo.toml index 26075440..9fbd46bd 100644 --- a/pallets/dnt-fee-controller/Cargo.toml +++ b/pallets/dnt-fee-controller/Cargo.toml @@ -8,7 +8,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } diff --git a/pallets/erc20-manager/Cargo.toml b/pallets/erc20-manager/Cargo.toml index 19db9799..18c80617 100644 --- a/pallets/erc20-manager/Cargo.toml +++ b/pallets/erc20-manager/Cargo.toml @@ -9,7 +9,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } diff --git a/pallets/sponsored-transactions/Cargo.toml b/pallets/sponsored-transactions/Cargo.toml index e138d198..ec8bb15b 100644 --- a/pallets/sponsored-transactions/Cargo.toml +++ b/pallets/sponsored-transactions/Cargo.toml @@ -8,7 +8,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } hex = { workspace = true, default-features = false } scale-info = { workspace = true } sp-core = { workspace = true } diff --git a/pallets/upgrade-runtime-proposal/Cargo.toml b/pallets/upgrade-runtime-proposal/Cargo.toml index 9504fe06..5a561386 100644 --- a/pallets/upgrade-runtime-proposal/Cargo.toml +++ b/pallets/upgrade-runtime-proposal/Cargo.toml @@ -14,7 +14,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } scale-info = { workspace = true } syn = { workspace = true } -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } stbl-tools = { workspace = true } log = { workspace = true } diff --git a/precompiles/token-fee-controller/fee-token-selector/Cargo.toml b/precompiles/token-fee-controller/fee-token-selector/Cargo.toml index e45b12fc..40c999c3 100644 --- a/precompiles/token-fee-controller/fee-token-selector/Cargo.toml +++ b/precompiles/token-fee-controller/fee-token-selector/Cargo.toml @@ -15,7 +15,7 @@ slices = "0.2.0" precompile-utils = { workspace = true } # Substrate -codec = { package = "parity-scale-codec", workspace = true, default-features = false, features = [ "max-encoded-len" ] } +codec = { workspace = true, default-features = false, features = [ "max-encoded-len" ] } frame-support = { workspace = true } frame-system = { workspace = true } pallet-balances = { workspace = true } diff --git a/precompiles/token-fee-controller/supported-tokens-manager/Cargo.toml b/precompiles/token-fee-controller/supported-tokens-manager/Cargo.toml index 31ffd26e..62577a41 100644 --- a/precompiles/token-fee-controller/supported-tokens-manager/Cargo.toml +++ b/precompiles/token-fee-controller/supported-tokens-manager/Cargo.toml @@ -15,7 +15,7 @@ slices = "0.2.0" precompile-utils = { workspace = true } # Substrate -codec = { package = "parity-scale-codec", workspace = true, default-features = false, features = [ "max-encoded-len" ] } +codec = { workspace = true, default-features = false, features = [ "max-encoded-len" ] } frame-support = { workspace = true } frame-system = { workspace = true } pallet-balances = { workspace = true } diff --git a/primitives/fee-compatible-api/Cargo.toml b/primitives/fee-compatible-api/Cargo.toml index a71050bb..a416d605 100644 --- a/primitives/fee-compatible-api/Cargo.toml +++ b/primitives/fee-compatible-api/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] sp-runtime = { workspace = true} sp-api = { workspace = true} -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } [features] default = ['std'] diff --git a/primitives/transaction-validator/Cargo.toml b/primitives/transaction-validator/Cargo.toml index 9b3756b1..dc344e98 100644 --- a/primitives/transaction-validator/Cargo.toml +++ b/primitives/transaction-validator/Cargo.toml @@ -22,7 +22,7 @@ stbl-tools = { workspace = true } environmental = { workspace = true, optional = true } frame-support = { workspace = true } evm = { workspace = true, features = ["with-codec"] } -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } scale-info = { workspace = true} frame-benchmarking = { workspace = true, optional = true } log = { workspace = true } diff --git a/primitives/zero-gas-transactions-api/Cargo.toml b/primitives/zero-gas-transactions-api/Cargo.toml index 97b6787e..14ab13be 100644 --- a/primitives/zero-gas-transactions-api/Cargo.toml +++ b/primitives/zero-gas-transactions-api/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] sp-runtime = { workspace = true} sp-api = { workspace = true} -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } fp-ethereum = { workspace = true, default-features = false } sp-std = { workspace = true, default-features = false } diff --git a/test-utils/stability-client/Cargo.toml b/test-utils/stability-client/Cargo.toml index d01de86c..1ade73de 100644 --- a/test-utils/stability-client/Cargo.toml +++ b/test-utils/stability-client/Cargo.toml @@ -13,7 +13,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] array-bytes = { workspace = true } async-trait = { workspace = true } -codec = { package = "parity-scale-codec", default-features = false, features = ["derive"], workspace = true } +codec = { default-features = false, features = ["derive"], workspace = true } futures = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } diff --git a/test-utils/stability-root-testing/Cargo.toml b/test-utils/stability-root-testing/Cargo.toml index 59b6668d..519ed2f3 100644 --- a/test-utils/stability-root-testing/Cargo.toml +++ b/test-utils/stability-root-testing/Cargo.toml @@ -10,7 +10,7 @@ publish = false targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { default-features = false, features = ["derive"], workspace = true, package = "parity-scale-codec" } +parity-scale-codec = { default-features = false, features = ["derive"], workspace = true } scale-info = { workspace = true } frame-support = { workspace = true } frame-system = { workspace = true } @@ -23,7 +23,7 @@ sp-std = { workspace = true } try-runtime = ["frame-support/try-runtime"] default = ["std"] std = [ - "codec/std", + "parity-scale-codec/std", "frame-support/std", "frame-system/std", "scale-info/std", diff --git a/test-utils/stability-runtime-client/Cargo.toml b/test-utils/stability-runtime-client/Cargo.toml index 6329548f..554e5cad 100644 --- a/test-utils/stability-runtime-client/Cargo.toml +++ b/test-utils/stability-runtime-client/Cargo.toml @@ -10,7 +10,7 @@ publish = false targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", default-features = false, features = ["derive"], workspace = true } +codec = { default-features = false, features = ["derive"], workspace = true } futures = { workspace = true } sc-block-builder = { workspace = true } sc-chain-spec = { workspace = true } From 992f13b33db87e1328db71bfb38628ff72bf72ca Mon Sep 17 00:00:00 2001 From: Carlos Lostao Date: Wed, 15 Nov 2023 17:50:08 +0100 Subject: [PATCH 30/37] fix: merge conflicts --- pallets/custom-balances/Cargo.toml | 2 +- pallets/fee-rewards-vault/Cargo.toml | 2 +- pallets/root-controller/Cargo.toml | 2 +- .../token-fee-controller/supported-tokens-manager/Cargo.toml | 2 +- pallets/token-fee-controller/user-fee-selector/Cargo.toml | 2 +- .../token-fee-controller/validator-fee-selector/Cargo.toml | 2 +- pallets/validator-keys-controller/Cargo.toml | 2 +- pallets/validator-set/Cargo.toml | 2 +- pallets/zero-gas-transactions/Cargo.toml | 2 +- precompiles/fee-rewards-vault-controller/Cargo.toml | 2 +- .../token-fee-controller/validator-fee-selector/Cargo.toml | 2 +- precompiles/upgrade-runtime-controller/Cargo.toml | 2 +- precompiles/utils/Cargo.toml | 2 +- precompiles/validator-controller/Cargo.toml | 2 +- primitives/runner/Cargo.toml | 2 +- primitives/stability-rpc-api/Cargo.toml | 2 +- runtime/Cargo.toml | 4 ++-- runtime/src/lib.rs | 2 +- stability-rpc/Cargo.toml | 2 +- test-utils/stability-tracing/Cargo.toml | 2 +- 20 files changed, 21 insertions(+), 21 deletions(-) diff --git a/pallets/custom-balances/Cargo.toml b/pallets/custom-balances/Cargo.toml index 5c7c41ad..3d5ff534 100644 --- a/pallets/custom-balances/Cargo.toml +++ b/pallets/custom-balances/Cargo.toml @@ -9,7 +9,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } diff --git a/pallets/fee-rewards-vault/Cargo.toml b/pallets/fee-rewards-vault/Cargo.toml index f29e4eb8..a9db4938 100644 --- a/pallets/fee-rewards-vault/Cargo.toml +++ b/pallets/fee-rewards-vault/Cargo.toml @@ -9,7 +9,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } diff --git a/pallets/root-controller/Cargo.toml b/pallets/root-controller/Cargo.toml index c4816174..bc631caf 100644 --- a/pallets/root-controller/Cargo.toml +++ b/pallets/root-controller/Cargo.toml @@ -8,7 +8,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } diff --git a/pallets/token-fee-controller/supported-tokens-manager/Cargo.toml b/pallets/token-fee-controller/supported-tokens-manager/Cargo.toml index 55693d85..49945b07 100644 --- a/pallets/token-fee-controller/supported-tokens-manager/Cargo.toml +++ b/pallets/token-fee-controller/supported-tokens-manager/Cargo.toml @@ -10,7 +10,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } diff --git a/pallets/token-fee-controller/user-fee-selector/Cargo.toml b/pallets/token-fee-controller/user-fee-selector/Cargo.toml index bbe7d846..ec99a896 100644 --- a/pallets/token-fee-controller/user-fee-selector/Cargo.toml +++ b/pallets/token-fee-controller/user-fee-selector/Cargo.toml @@ -10,7 +10,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } diff --git a/pallets/token-fee-controller/validator-fee-selector/Cargo.toml b/pallets/token-fee-controller/validator-fee-selector/Cargo.toml index 643e9564..de7a7959 100644 --- a/pallets/token-fee-controller/validator-fee-selector/Cargo.toml +++ b/pallets/token-fee-controller/validator-fee-selector/Cargo.toml @@ -10,7 +10,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } diff --git a/pallets/validator-keys-controller/Cargo.toml b/pallets/validator-keys-controller/Cargo.toml index d37a7bd9..e7dd99d3 100644 --- a/pallets/validator-keys-controller/Cargo.toml +++ b/pallets/validator-keys-controller/Cargo.toml @@ -11,7 +11,7 @@ sp-runtime = { workspace = true } sp-std = { workspace = true } sp-staking = { workspace = true } log = { workspace = true } -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } diff --git a/pallets/validator-set/Cargo.toml b/pallets/validator-set/Cargo.toml index 1e2a9f27..c0261deb 100644 --- a/pallets/validator-set/Cargo.toml +++ b/pallets/validator-set/Cargo.toml @@ -11,7 +11,7 @@ sp-runtime = { workspace = true } sp-std = { workspace = true } sp-staking = { workspace = true } log = { workspace = true } -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } diff --git a/pallets/zero-gas-transactions/Cargo.toml b/pallets/zero-gas-transactions/Cargo.toml index 8f46bfa3..c2ab00a4 100644 --- a/pallets/zero-gas-transactions/Cargo.toml +++ b/pallets/zero-gas-transactions/Cargo.toml @@ -8,7 +8,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } hex = { workspace = true, default-features = false } scale-info = { workspace = true } sp-core = { workspace = true } diff --git a/precompiles/fee-rewards-vault-controller/Cargo.toml b/precompiles/fee-rewards-vault-controller/Cargo.toml index 8df44a48..e6d7b1f0 100644 --- a/precompiles/fee-rewards-vault-controller/Cargo.toml +++ b/precompiles/fee-rewards-vault-controller/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] # Substrate sp-core = { workspace = true } -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } frame-system = { workspace = true } frame-support = { workspace = true } sp-std = { workspace = true } diff --git a/precompiles/token-fee-controller/validator-fee-selector/Cargo.toml b/precompiles/token-fee-controller/validator-fee-selector/Cargo.toml index cdb37475..d35ffb9d 100644 --- a/precompiles/token-fee-controller/validator-fee-selector/Cargo.toml +++ b/precompiles/token-fee-controller/validator-fee-selector/Cargo.toml @@ -15,7 +15,7 @@ slices = "0.2.0" precompile-utils = { workspace = true } # Substrate -codec = { package = "parity-scale-codec", workspace = true, default-features = false, features = [ "max-encoded-len" ] } +codec = { workspace = true, default-features = false, features = [ "max-encoded-len" ] } frame-support = { workspace = true } frame-system = { workspace = true } pallet-balances = { workspace = true } diff --git a/precompiles/upgrade-runtime-controller/Cargo.toml b/precompiles/upgrade-runtime-controller/Cargo.toml index ca73be77..89fb1bde 100644 --- a/precompiles/upgrade-runtime-controller/Cargo.toml +++ b/precompiles/upgrade-runtime-controller/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] # Substrate sp-core = { workspace = true } -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } frame-system = { workspace = true } frame-support = { workspace = true } sp-std = { workspace = true } diff --git a/precompiles/utils/Cargo.toml b/precompiles/utils/Cargo.toml index bbb0469e..2b9e0e2a 100644 --- a/precompiles/utils/Cargo.toml +++ b/precompiles/utils/Cargo.toml @@ -26,7 +26,7 @@ precompile-utils-macro = { path = "macro" } # Substrate frame-support = { workspace = true } frame-system = { workspace = true } -parity-scale-codec = { workspace = true, package = "parity-scale-codec" } +parity-scale-codec = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } sp-std = { workspace = true } diff --git a/precompiles/validator-controller/Cargo.toml b/precompiles/validator-controller/Cargo.toml index 02ff3c11..19071a55 100644 --- a/precompiles/validator-controller/Cargo.toml +++ b/precompiles/validator-controller/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] # Substrate sp-core = { workspace = true } -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } frame-system = { workspace = true } frame-support = { workspace = true } sp-std = { workspace = true } diff --git a/primitives/runner/Cargo.toml b/primitives/runner/Cargo.toml index 4ed75330..4609341a 100644 --- a/primitives/runner/Cargo.toml +++ b/primitives/runner/Cargo.toml @@ -11,7 +11,7 @@ sp-runtime = { workspace = true } sp-std = { workspace = true } evm = { workspace = true, features = ["with-codec"] } sp-core = { workspace = true, default-features = false } -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } scale-info = { workspace = true} frame-benchmarking = { workspace = true, optional = true } sp-io = { workspace = true } diff --git a/primitives/stability-rpc-api/Cargo.toml b/primitives/stability-rpc-api/Cargo.toml index 35ceeab5..5c913725 100644 --- a/primitives/stability-rpc-api/Cargo.toml +++ b/primitives/stability-rpc-api/Cargo.toml @@ -9,7 +9,7 @@ sp-runtime = { workspace = true, default-features = false } sp-api = { workspace = true, default-features = false } sp-core = { workspace = true, default-features = false } sp-std = { workspace = true, default-features = false } -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } [features] default = ["std"] diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 13a3cad4..3a39cf5c 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -14,7 +14,7 @@ runtime-benchmarks = [ ] std = [ 'serde', - 'codec/std', + 'parity-scale-codec/std', 'scale-info/std', 'sp-api/std', 'sp-block-builder/std', @@ -95,7 +95,7 @@ version = '0.0.0' targets = ['x86_64-unknown-linux-gnu'] [dependencies] -codec = { package = "parity-scale-codec", workspace = true, default-features = false, features = [ +parity-scale-codec = { workspace = true, default-features = false, features = [ "derive", ] } scale-info = { workspace = true, features = ["derive"] } diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 2c3db0b3..d2645670 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -12,7 +12,7 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); use account::AccountId20; use account::EthereumSigner; -use codec::{Decode, Encode}; +use parity_scale_codec::{Decode, Encode}; use core::str::FromStr; use frame_support::pallet_prelude::EnsureOrigin; use frame_support::pallet_prelude::InvalidTransaction; diff --git a/stability-rpc/Cargo.toml b/stability-rpc/Cargo.toml index 71b5fbe3..004131c6 100644 --- a/stability-rpc/Cargo.toml +++ b/stability-rpc/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -codec = { workspace = true, package = "parity-scale-codec" } +codec = { workspace = true } scale-info = { workspace = true } jsonrpsee = { workspace = true, features = ["server", "macros"] } lazy_static = { version = "1.4.0", optional = true } diff --git a/test-utils/stability-tracing/Cargo.toml b/test-utils/stability-tracing/Cargo.toml index 2d8f5a16..f079923e 100644 --- a/test-utils/stability-tracing/Cargo.toml +++ b/test-utils/stability-tracing/Cargo.toml @@ -17,7 +17,7 @@ targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"] [dependencies] sp-std = { workspace = true } -codec = { default-features = false, features = ["derive"], workspace = true, package = "parity-scale-codec" } +codec = { default-features = false, features = ["derive"], workspace = true } tracing = { workspace = true } tracing-core = { workspace = true } tracing-subscriber = { workspace = true, optional = true } From 90a1cebbc66c7e79e753875eaf958a4d3d78d4cf Mon Sep 17 00:00:00 2001 From: Carlos Lostao Date: Wed, 15 Nov 2023 18:22:26 +0100 Subject: [PATCH 31/37] fix: warnings #2 --- test-utils/stability-runtime/Cargo.toml | 4 ++-- test-utils/stability-runtime/src/extrinsic.rs | 2 +- test-utils/stability-runtime/src/genesismap.rs | 2 +- test-utils/stability-runtime/src/lib.rs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test-utils/stability-runtime/Cargo.toml b/test-utils/stability-runtime/Cargo.toml index ae20c1f7..bbe6e599 100644 --- a/test-utils/stability-runtime/Cargo.toml +++ b/test-utils/stability-runtime/Cargo.toml @@ -17,7 +17,7 @@ sp-consensus-aura = { workspace = true } sp-consensus-babe = { workspace = true } sp-consensus-beefy = { workspace = true } sp-block-builder = { workspace = true } -codec = { package = "parity-scale-codec", default-features = false, features = ["derive"], workspace = true } +parity-scale-codec = { default-features = false, features = ["derive"], workspace = true } scale-info = { workspace = true } sp-inherents = { workspace = true } sp-keyring = { workspace = true, optional = true } @@ -79,7 +79,7 @@ std = [ "sp-consensus-babe/std", "sp-consensus-beefy/std", "sp-block-builder/std", - "codec/std", + "parity-scale-codec/std", "scale-info/std", "sp-inherents/std", "sp-keyring", diff --git a/test-utils/stability-runtime/src/extrinsic.rs b/test-utils/stability-runtime/src/extrinsic.rs index 02a60450..efa7cabe 100644 --- a/test-utils/stability-runtime/src/extrinsic.rs +++ b/test-utils/stability-runtime/src/extrinsic.rs @@ -21,7 +21,7 @@ use crate::{ substrate_test_pallet::pallet::Call as PalletCall, AccountId, Balance, BalancesCall, CheckSubstrateCall, Extrinsic, Index, Pair, RuntimeCall, SignedPayload, TransferData, }; -use codec::Encode; +use parity_scale_codec::Encode; use frame_system::{CheckNonce, CheckWeight}; use sp_core::crypto::Pair as TraitPair; use sp_keyring::AccountKeyring; diff --git a/test-utils/stability-runtime/src/genesismap.rs b/test-utils/stability-runtime/src/genesismap.rs index 005811c3..bbae4a42 100644 --- a/test-utils/stability-runtime/src/genesismap.rs +++ b/test-utils/stability-runtime/src/genesismap.rs @@ -20,7 +20,7 @@ use super::{ currency, substrate_test_pallet, wasm_binary_unwrap, AccountId, Balance, GenesisConfig, }; -use codec::Encode; +use parity_scale_codec::Encode; use sc_service::construct_genesis_block; use sp_core::{ sr25519, diff --git a/test-utils/stability-runtime/src/lib.rs b/test-utils/stability-runtime/src/lib.rs index dc8affe8..6c9bbb73 100644 --- a/test-utils/stability-runtime/src/lib.rs +++ b/test-utils/stability-runtime/src/lib.rs @@ -25,7 +25,7 @@ pub mod extrinsic; pub mod genesismap; pub mod substrate_test_pallet; -use codec::{Decode, Encode}; +use parity_scale_codec::{Decode, Encode}; use frame_support::{ construct_runtime, dispatch::DispatchClass, @@ -1003,7 +1003,7 @@ pub mod storage_key_generator { #[cfg(test)] mod tests { use super::*; - use codec::Encode; + use parity_scale_codec::Encode; use frame_support::dispatch::DispatchInfo; use sc_block_builder::BlockBuilderProvider; use sp_api::ProvideRuntimeApi; From 33439a04774d4522787b0676a87c3e20ac4ec1f8 Mon Sep 17 00:00:00 2001 From: Carlos Lostao Date: Wed, 15 Nov 2023 18:57:01 +0100 Subject: [PATCH 32/37] fix: importing encoding traits --- node/src/eth.rs | 2 ++ node/src/rpc/eth.rs | 1 - pallets/custom-balances/Cargo.toml | 4 ++-- pallets/custom-balances/src/lib.rs | 2 +- pallets/dnt-fee-controller/Cargo.toml | 4 ++-- pallets/erc20-manager/Cargo.toml | 4 ++-- pallets/fee-rewards-vault/Cargo.toml | 4 ++-- pallets/root-controller/Cargo.toml | 4 ++-- pallets/sponsored-transactions/Cargo.toml | 4 ++-- .../supported-tokens-manager/Cargo.toml | 4 ++-- pallets/token-fee-controller/user-fee-selector/Cargo.toml | 4 ++-- .../token-fee-controller/validator-fee-selector/Cargo.toml | 4 ++-- pallets/upgrade-runtime-proposal/Cargo.toml | 4 ++-- pallets/validator-keys-controller/Cargo.toml | 4 ++-- pallets/validator-set/Cargo.toml | 4 ++-- pallets/zero-gas-transactions/Cargo.toml | 4 ++-- test-utils/stability-tracing/Cargo.toml | 6 +++--- test-utils/stability-tracing/src/types.rs | 2 +- 18 files changed, 33 insertions(+), 32 deletions(-) diff --git a/node/src/eth.rs b/node/src/eth.rs index f02f6272..4a1b2028 100644 --- a/node/src/eth.rs +++ b/node/src/eth.rs @@ -47,6 +47,7 @@ pub enum EthApi { Txpool, Debug, Trace, + None, } impl FromStr for EthApi { @@ -57,6 +58,7 @@ impl FromStr for EthApi { "txpool" => Self::Txpool, "debug" => Self::Debug, "trace" => Self::Trace, + "none" => Self::None, _ => { return Err(format!( "`{}` is not recognized as a supported Ethereum Api", diff --git a/node/src/rpc/eth.rs b/node/src/rpc/eth.rs index a763f445..fd37f9d4 100644 --- a/node/src/rpc/eth.rs +++ b/node/src/rpc/eth.rs @@ -215,7 +215,6 @@ where io.merge(Trace::new(client.clone(), trace_requester, 20).into_rpc())?; } } - io.merge(Web3::new(client).into_rpc())?; io.merge(tx_pool.into_rpc())?; Ok(io) diff --git a/pallets/custom-balances/Cargo.toml b/pallets/custom-balances/Cargo.toml index 3d5ff534..a468a0d3 100644 --- a/pallets/custom-balances/Cargo.toml +++ b/pallets/custom-balances/Cargo.toml @@ -9,7 +9,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { workspace = true } +parity-scale-codec = { workspace = true } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } @@ -29,7 +29,7 @@ stbl-core-primitives ={ workspace = true, features = ["std"] } [features] default = ["std"] std = [ - "codec/std", + "parity-scale-codec/std", "scale-info/std", "frame-support/std", "frame-system/std", diff --git a/pallets/custom-balances/src/lib.rs b/pallets/custom-balances/src/lib.rs index 72191036..dc29c6e2 100644 --- a/pallets/custom-balances/src/lib.rs +++ b/pallets/custom-balances/src/lib.rs @@ -12,7 +12,7 @@ pub mod pallet { use core::marker::PhantomData; - use codec::MaxEncodedLen; + use parity_scale_codec::MaxEncodedLen; use frame_support::traits::tokens::{DepositConsequence, WithdrawConsequence, Preservation, Provenance, Fortitude}; use frame_support::traits::{Imbalance, SameOrOther, TryDrop}; use frame_support::RuntimeDebug; diff --git a/pallets/dnt-fee-controller/Cargo.toml b/pallets/dnt-fee-controller/Cargo.toml index 9fbd46bd..5fc2c32f 100644 --- a/pallets/dnt-fee-controller/Cargo.toml +++ b/pallets/dnt-fee-controller/Cargo.toml @@ -8,7 +8,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { workspace = true } +parity-scale-codec = { workspace = true } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } @@ -30,7 +30,7 @@ pallet-evm = { workspace = true, features = ["std"]} [features] default = ["std"] std = [ - "codec/std", + "parity-scale-codec/std", "scale-info/std", "frame-support/std", "frame-system/std", diff --git a/pallets/erc20-manager/Cargo.toml b/pallets/erc20-manager/Cargo.toml index 18c80617..e8fd65a0 100644 --- a/pallets/erc20-manager/Cargo.toml +++ b/pallets/erc20-manager/Cargo.toml @@ -9,7 +9,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { workspace = true } +parity-scale-codec = { workspace = true } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } @@ -28,7 +28,7 @@ pallet-timestamp = { workspace = true, features = ["std"] } [features] default = ["std"] std = [ - "codec/std", + "parity-scale-codec/std", "scale-info/std", "frame-support/std", "frame-system/std", diff --git a/pallets/fee-rewards-vault/Cargo.toml b/pallets/fee-rewards-vault/Cargo.toml index a9db4938..abf722e0 100644 --- a/pallets/fee-rewards-vault/Cargo.toml +++ b/pallets/fee-rewards-vault/Cargo.toml @@ -9,7 +9,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { workspace = true } +parity-scale-codec = { workspace = true } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } @@ -19,7 +19,7 @@ stbl-tools = { workspace = true } [features] default = ["std"] std = [ - "codec/std", + "parity-scale-codec/std", "scale-info/std", "frame-support/std", "frame-system/std", diff --git a/pallets/root-controller/Cargo.toml b/pallets/root-controller/Cargo.toml index bc631caf..5a47289c 100644 --- a/pallets/root-controller/Cargo.toml +++ b/pallets/root-controller/Cargo.toml @@ -8,7 +8,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { workspace = true } +parity-scale-codec = { workspace = true } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } @@ -16,7 +16,7 @@ sp-io = { workspace = true } [features] default = ["std"] std = [ - "codec/std", + "parity-scale-codec/std", "scale-info/std", "frame-support/std", "frame-system/std", diff --git a/pallets/sponsored-transactions/Cargo.toml b/pallets/sponsored-transactions/Cargo.toml index ec8bb15b..d5162867 100644 --- a/pallets/sponsored-transactions/Cargo.toml +++ b/pallets/sponsored-transactions/Cargo.toml @@ -8,7 +8,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { workspace = true } +parity-scale-codec = { workspace = true } hex = { workspace = true, default-features = false } scale-info = { workspace = true } sp-core = { workspace = true } @@ -36,7 +36,7 @@ ethereum = { workspace = true, features = ["std"] } [features] default = ["std"] std = [ - "codec/std", + "parity-scale-codec/std", "scale-info/std", "frame-support/std", "frame-system/std", diff --git a/pallets/token-fee-controller/supported-tokens-manager/Cargo.toml b/pallets/token-fee-controller/supported-tokens-manager/Cargo.toml index 49945b07..f67be391 100644 --- a/pallets/token-fee-controller/supported-tokens-manager/Cargo.toml +++ b/pallets/token-fee-controller/supported-tokens-manager/Cargo.toml @@ -10,7 +10,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { workspace = true } +parity-scale-codec = { workspace = true } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } @@ -23,7 +23,7 @@ pallet-balances = { workspace = true, features = ["std"] } [features] default = ["std"] std = [ - "codec/std", + "parity-scale-codec/std", "scale-info/std", "frame-support/std", "frame-system/std", diff --git a/pallets/token-fee-controller/user-fee-selector/Cargo.toml b/pallets/token-fee-controller/user-fee-selector/Cargo.toml index ec99a896..4ab84e19 100644 --- a/pallets/token-fee-controller/user-fee-selector/Cargo.toml +++ b/pallets/token-fee-controller/user-fee-selector/Cargo.toml @@ -10,7 +10,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { workspace = true } +parity-scale-codec = { workspace = true } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } @@ -24,7 +24,7 @@ pallet-balances = { workspace = true, features = ["std"] } [features] default = ["std"] std = [ - "codec/std", + "parity-scale-codec/std", "scale-info/std", "frame-support/std", "frame-system/std", diff --git a/pallets/token-fee-controller/validator-fee-selector/Cargo.toml b/pallets/token-fee-controller/validator-fee-selector/Cargo.toml index de7a7959..1c173caf 100644 --- a/pallets/token-fee-controller/validator-fee-selector/Cargo.toml +++ b/pallets/token-fee-controller/validator-fee-selector/Cargo.toml @@ -10,7 +10,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { workspace = true } +parity-scale-codec = { workspace = true } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } @@ -28,7 +28,7 @@ fp-evm = { workspace = true } [features] default = ["std"] std = [ - "codec/std", + "parity-scale-codec/std", "scale-info/std", "frame-support/std", "frame-system/std", diff --git a/pallets/upgrade-runtime-proposal/Cargo.toml b/pallets/upgrade-runtime-proposal/Cargo.toml index 5a561386..3242eabe 100644 --- a/pallets/upgrade-runtime-proposal/Cargo.toml +++ b/pallets/upgrade-runtime-proposal/Cargo.toml @@ -14,7 +14,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } scale-info = { workspace = true } syn = { workspace = true } -codec = { workspace = true } +parity-scale-codec = { workspace = true } stbl-tools = { workspace = true } log = { workspace = true } @@ -33,7 +33,7 @@ std = [ 'sp-core/std', 'sp-std/std', 'sp-runtime/std', - 'codec/std', + 'parity-scale-codec/std', 'log/std' ] try-runtime = ['frame-support/try-runtime'] \ No newline at end of file diff --git a/pallets/validator-keys-controller/Cargo.toml b/pallets/validator-keys-controller/Cargo.toml index e7dd99d3..2be2a8d4 100644 --- a/pallets/validator-keys-controller/Cargo.toml +++ b/pallets/validator-keys-controller/Cargo.toml @@ -11,7 +11,7 @@ sp-runtime = { workspace = true } sp-std = { workspace = true } sp-staking = { workspace = true } log = { workspace = true } -codec = { workspace = true } +parity-scale-codec = { workspace = true } frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } @@ -29,7 +29,7 @@ serde = { version = '1.0.126',features = ['derive'] } default = ['std'] runtime-benchmarks = ['frame-benchmarking'] std = [ - 'codec/std', + 'parity-scale-codec/std', 'frame-benchmarking/std', 'frame-support/std', 'frame-system/std', diff --git a/pallets/validator-set/Cargo.toml b/pallets/validator-set/Cargo.toml index c0261deb..22289703 100644 --- a/pallets/validator-set/Cargo.toml +++ b/pallets/validator-set/Cargo.toml @@ -11,7 +11,7 @@ sp-runtime = { workspace = true } sp-std = { workspace = true } sp-staking = { workspace = true } log = { workspace = true } -codec = { workspace = true } +parity-scale-codec = { workspace = true } frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } @@ -28,7 +28,7 @@ serde = { version = '1.0.126',features = ['derive'] } default = ['std'] runtime-benchmarks = ['frame-benchmarking'] std = [ - 'codec/std', + 'parity-scale-codec/std', 'frame-benchmarking/std', 'frame-support/std', 'frame-system/std', diff --git a/pallets/zero-gas-transactions/Cargo.toml b/pallets/zero-gas-transactions/Cargo.toml index c2ab00a4..785b8ec4 100644 --- a/pallets/zero-gas-transactions/Cargo.toml +++ b/pallets/zero-gas-transactions/Cargo.toml @@ -8,7 +8,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { workspace = true } +parity-scale-codec = { workspace = true } hex = { workspace = true, default-features = false } scale-info = { workspace = true } sp-core = { workspace = true } @@ -39,7 +39,7 @@ ethereum = { workspace = true, features = ["std"] } [features] default = ["std"] std = [ - "codec/std", + "parity-scale-codec/std", "scale-info/std", "frame-support/std", "frame-system/std", diff --git a/test-utils/stability-tracing/Cargo.toml b/test-utils/stability-tracing/Cargo.toml index f079923e..353bb4c8 100644 --- a/test-utils/stability-tracing/Cargo.toml +++ b/test-utils/stability-tracing/Cargo.toml @@ -17,19 +17,19 @@ targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"] [dependencies] sp-std = { workspace = true } -codec = { default-features = false, features = ["derive"], workspace = true } +parity-scale-codec = { default-features = false, features = ["derive"], workspace = true } tracing = { workspace = true } tracing-core = { workspace = true } tracing-subscriber = { workspace = true, optional = true } [features] default = ["std"] -with-tracing = ["codec/derive", "codec/full"] +with-tracing = ["parity-scale-codec/derive", "parity-scale-codec/full"] std = [ "with-tracing", "tracing/std", "tracing-core/std", - "codec/std", + "parity-scale-codec/std", "sp-std/std", "tracing-subscriber", ] diff --git a/test-utils/stability-tracing/src/types.rs b/test-utils/stability-tracing/src/types.rs index b0d119d9..d1d2fea9 100644 --- a/test-utils/stability-tracing/src/types.rs +++ b/test-utils/stability-tracing/src/types.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use codec::{Decode, Encode}; +use parity_scale_codec::{Decode, Encode}; /// Types for wasm based tracing. Loosly inspired by `tracing-core` but /// optimised for the specific use case. use core::{fmt::Debug, format_args}; From b9bcff718921ead002a253df258a0e51bdcca874 Mon Sep 17 00:00:00 2001 From: Carlos Lostao Date: Wed, 15 Nov 2023 19:18:03 +0100 Subject: [PATCH 33/37] fix: test --- pallets/validator-keys-controller/src/mock.rs | 2 +- pallets/validator-set/src/mock.rs | 2 +- precompiles/fee-rewards-vault-controller/Cargo.toml | 2 +- precompiles/fee-rewards-vault-controller/src/mock.rs | 2 +- .../token-fee-controller/fee-token-selector/Cargo.toml | 4 ++-- .../token-fee-controller/supported-tokens-manager/Cargo.toml | 2 +- .../token-fee-controller/validator-fee-selector/Cargo.toml | 4 ++-- precompiles/upgrade-runtime-controller/Cargo.toml | 2 +- precompiles/validator-controller/Cargo.toml | 2 +- precompiles/validator-controller/src/mock.rs | 2 +- primitives/runner/Cargo.toml | 4 ++-- primitives/transaction-validator/Cargo.toml | 4 ++-- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pallets/validator-keys-controller/src/mock.rs b/pallets/validator-keys-controller/src/mock.rs index a91b1fec..cb122383 100644 --- a/pallets/validator-keys-controller/src/mock.rs +++ b/pallets/validator-keys-controller/src/mock.rs @@ -35,7 +35,7 @@ impl From for MockSessionKeys { pub const KEY_ID_A: KeyTypeId = KeyTypeId([4; 4]); pub const KEY_ID_B: KeyTypeId = KeyTypeId([9; 4]); -#[derive(Debug, Clone, codec::Encode, codec::Decode, PartialEq, Eq)] +#[derive(Debug, Clone, parity_scale_codec::Encode, parity_scale_codec::Decode, PartialEq, Eq)] pub struct PreUpgradeMockSessionKeys { pub a: [u8; 32], pub b: [u8; 64], diff --git a/pallets/validator-set/src/mock.rs b/pallets/validator-set/src/mock.rs index 202e1ad1..4b8f6d11 100644 --- a/pallets/validator-set/src/mock.rs +++ b/pallets/validator-set/src/mock.rs @@ -36,7 +36,7 @@ impl From for MockSessionKeys { pub const KEY_ID_A: KeyTypeId = KeyTypeId([4; 4]); pub const KEY_ID_B: KeyTypeId = KeyTypeId([9; 4]); -#[derive(Debug, Clone, codec::Encode, codec::Decode, PartialEq, Eq)] +#[derive(Debug, Clone, parity_scale_codec::Encode, parity_scale_codec::Decode, PartialEq, Eq)] pub struct PreUpgradeMockSessionKeys { pub a: [u8; 32], pub b: [u8; 64], diff --git a/precompiles/fee-rewards-vault-controller/Cargo.toml b/precompiles/fee-rewards-vault-controller/Cargo.toml index e6d7b1f0..e727b9e5 100644 --- a/precompiles/fee-rewards-vault-controller/Cargo.toml +++ b/precompiles/fee-rewards-vault-controller/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] # Substrate sp-core = { workspace = true } -codec = { workspace = true } +parity-scale-codec = { workspace = true } frame-system = { workspace = true } frame-support = { workspace = true } sp-std = { workspace = true } diff --git a/precompiles/fee-rewards-vault-controller/src/mock.rs b/precompiles/fee-rewards-vault-controller/src/mock.rs index 9eb2393d..2b8ee790 100644 --- a/precompiles/fee-rewards-vault-controller/src/mock.rs +++ b/precompiles/fee-rewards-vault-controller/src/mock.rs @@ -201,7 +201,7 @@ impl From for MockSessionKeys { pub const KEY_ID_A: KeyTypeId = KeyTypeId([4; 4]); pub const KEY_ID_B: KeyTypeId = KeyTypeId([9; 4]); -#[derive(Debug, Clone, codec::Encode, codec::Decode, PartialEq, Eq)] +#[derive(Debug, Clone, parity_scale_codec::Encode, parity_scale_codec::Decode, PartialEq, Eq)] pub struct PreUpgradeMockSessionKeys { pub a: [u8; 32], pub b: [u8; 64], diff --git a/precompiles/token-fee-controller/fee-token-selector/Cargo.toml b/precompiles/token-fee-controller/fee-token-selector/Cargo.toml index 40c999c3..5e0cd340 100644 --- a/precompiles/token-fee-controller/fee-token-selector/Cargo.toml +++ b/precompiles/token-fee-controller/fee-token-selector/Cargo.toml @@ -15,7 +15,7 @@ slices = "0.2.0" precompile-utils = { workspace = true } # Substrate -codec = { workspace = true, default-features = false, features = [ "max-encoded-len" ] } +parity-scale-codec = { workspace = true, default-features = false, features = [ "max-encoded-len" ] } frame-support = { workspace = true } frame-system = { workspace = true } pallet-balances = { workspace = true } @@ -49,7 +49,7 @@ sp-runtime = { workspace = true } [features] default = [ "std" ] std = [ - "codec/std", + "parity-scale-codec/std", "fp-evm/std", "frame-support/std", "frame-system/std", diff --git a/precompiles/token-fee-controller/supported-tokens-manager/Cargo.toml b/precompiles/token-fee-controller/supported-tokens-manager/Cargo.toml index 62577a41..ca58ba21 100644 --- a/precompiles/token-fee-controller/supported-tokens-manager/Cargo.toml +++ b/precompiles/token-fee-controller/supported-tokens-manager/Cargo.toml @@ -15,7 +15,7 @@ slices = "0.2.0" precompile-utils = { workspace = true } # Substrate -codec = { workspace = true, default-features = false, features = [ "max-encoded-len" ] } +parity-scale-codec = { workspace = true, default-features = false, features = [ "max-encoded-len" ] } frame-support = { workspace = true } frame-system = { workspace = true } pallet-balances = { workspace = true } diff --git a/precompiles/token-fee-controller/validator-fee-selector/Cargo.toml b/precompiles/token-fee-controller/validator-fee-selector/Cargo.toml index d35ffb9d..b89fd863 100644 --- a/precompiles/token-fee-controller/validator-fee-selector/Cargo.toml +++ b/precompiles/token-fee-controller/validator-fee-selector/Cargo.toml @@ -15,7 +15,7 @@ slices = "0.2.0" precompile-utils = { workspace = true } # Substrate -codec = { workspace = true, default-features = false, features = [ "max-encoded-len" ] } +parity-scale-codec = { workspace = true, default-features = false, features = [ "max-encoded-len" ] } frame-support = { workspace = true } frame-system = { workspace = true } pallet-balances = { workspace = true } @@ -49,7 +49,7 @@ sp-runtime = { workspace = true } [features] default = [ "std" ] std = [ - "codec/std", + "parity-scale-codec/std", "fp-evm/std", "frame-support/std", "frame-system/std", diff --git a/precompiles/upgrade-runtime-controller/Cargo.toml b/precompiles/upgrade-runtime-controller/Cargo.toml index 89fb1bde..66079f6a 100644 --- a/precompiles/upgrade-runtime-controller/Cargo.toml +++ b/precompiles/upgrade-runtime-controller/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] # Substrate sp-core = { workspace = true } -codec = { workspace = true } +parity-scale-codec = { workspace = true } frame-system = { workspace = true } frame-support = { workspace = true } sp-std = { workspace = true } diff --git a/precompiles/validator-controller/Cargo.toml b/precompiles/validator-controller/Cargo.toml index 19071a55..134c6fa0 100644 --- a/precompiles/validator-controller/Cargo.toml +++ b/precompiles/validator-controller/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] # Substrate sp-core = { workspace = true } -codec = { workspace = true } +parity-scale-codec = { workspace = true } frame-system = { workspace = true } frame-support = { workspace = true } sp-std = { workspace = true } diff --git a/precompiles/validator-controller/src/mock.rs b/precompiles/validator-controller/src/mock.rs index 7c9bc716..a0ba0b28 100644 --- a/precompiles/validator-controller/src/mock.rs +++ b/precompiles/validator-controller/src/mock.rs @@ -46,7 +46,7 @@ impl From for MockSessionKeys { pub const KEY_ID_A: KeyTypeId = KeyTypeId([4; 4]); pub const KEY_ID_B: KeyTypeId = KeyTypeId([9; 4]); -#[derive(Debug, Clone, codec::Encode, codec::Decode, PartialEq, Eq)] +#[derive(Debug, Clone, parity_scale_codec::Encode, parity_scale_codec::Decode, PartialEq, Eq)] pub struct PreUpgradeMockSessionKeys { pub a: [u8; 32], pub b: [u8; 64], diff --git a/primitives/runner/Cargo.toml b/primitives/runner/Cargo.toml index 4609341a..b64f7fbb 100644 --- a/primitives/runner/Cargo.toml +++ b/primitives/runner/Cargo.toml @@ -11,7 +11,7 @@ sp-runtime = { workspace = true } sp-std = { workspace = true } evm = { workspace = true, features = ["with-codec"] } sp-core = { workspace = true, default-features = false } -codec = { workspace = true } +parity-scale-codec = { workspace = true } scale-info = { workspace = true} frame-benchmarking = { workspace = true, optional = true } sp-io = { workspace = true } @@ -44,7 +44,7 @@ std = [ "evm/std", "evm/with-serde", "sp-core/std", - "codec/std", + "parity-scale-codec/std", "scale-info/std", "sp-io/std", "pallet-evm/std", diff --git a/primitives/transaction-validator/Cargo.toml b/primitives/transaction-validator/Cargo.toml index dc344e98..8757c44f 100644 --- a/primitives/transaction-validator/Cargo.toml +++ b/primitives/transaction-validator/Cargo.toml @@ -22,7 +22,7 @@ stbl-tools = { workspace = true } environmental = { workspace = true, optional = true } frame-support = { workspace = true } evm = { workspace = true, features = ["with-codec"] } -codec = { workspace = true } +parity-scale-codec = { workspace = true } scale-info = { workspace = true} frame-benchmarking = { workspace = true, optional = true } log = { workspace = true } @@ -53,7 +53,7 @@ std = [ "evm/std", "evm/with-serde", "sp-core/std", - "codec/std", + "parity-scale-codec/std", "scale-info/std", "sp-io/std", "pallet-evm/std", From 3a52826d4d9ba44418f432212a077ef9bb31f98c Mon Sep 17 00:00:00 2001 From: Carlos Lostao Date: Wed, 15 Nov 2023 19:28:27 +0100 Subject: [PATCH 34/37] fix: missing copy in dockerfiles --- docker/client/Dockerfile | 1 + docker/test/Dockerfile | 1 + 2 files changed, 2 insertions(+) diff --git a/docker/client/Dockerfile b/docker/client/Dockerfile index e8388d78..fe59b57a 100644 --- a/docker/client/Dockerfile +++ b/docker/client/Dockerfile @@ -20,6 +20,7 @@ COPY primitives ./primitives COPY client ./client COPY stability-rpc ./stability-rpc COPY test-utils ./test-utils +COPY vendor ./vendor COPY chain-specs ./chain-specs COPY Cargo.lock Cargo.toml rust-toolchain.toml ./ diff --git a/docker/test/Dockerfile b/docker/test/Dockerfile index a4ae54b9..043a4fc5 100644 --- a/docker/test/Dockerfile +++ b/docker/test/Dockerfile @@ -21,6 +21,7 @@ COPY primitives ./primitives COPY test-utils ./test-utils COPY client ./client COPY stability-rpc ./stability-rpc +COPY vendor ./vendor COPY Cargo.lock Cargo.toml rust-toolchain.toml ./ RUN cargo build --release --tests From a864efbdadec5f5ad387cc003cae07dee3ada730 Mon Sep 17 00:00:00 2001 From: Carlos Lostao Date: Wed, 15 Nov 2023 20:23:36 +0100 Subject: [PATCH 35/37] fix: txpool content rpc not hiding --- Cargo.lock | 51 +++++++++++------------------- Cargo.toml | 3 +- node/src/rpc/eth.rs | 7 +++- node/src/rpc/mod.rs | 5 ++- node/src/service.rs | 1 + vendor/client/rpc/debug/src/lib.rs | 2 +- vendor/client/rpc/trace/src/lib.rs | 2 +- 7 files changed, 33 insertions(+), 38 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 001a30bf..6de91a73 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2340,7 +2340,7 @@ dependencies = [ "log", "parking_lot 0.12.1", "sc-client-api", - "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", + "sc-utils", "sp-api", "sp-blockchain", "sp-consensus", @@ -2384,7 +2384,7 @@ dependencies = [ "sc-service", "sc-transaction-pool", "sc-transaction-pool-api", - "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", + "sc-utils", "serde", "sp-api", "sp-block-builder", @@ -4945,7 +4945,7 @@ dependencies = [ "moonbeam-rpc-core-types", "moonbeam-rpc-primitives-debug", "sc-client-api", - "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36)", + "sc-utils", "sp-api", "sp-block-builder", "sp-blockchain", @@ -5005,7 +5005,7 @@ dependencies = [ "moonbeam-rpc-primitives-debug", "sc-client-api", "sc-network", - "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36)", + "sc-utils", "serde", "sha3 0.9.1", "sp-api", @@ -7821,7 +7821,7 @@ dependencies = [ "sc-service", "sc-telemetry", "sc-tracing", - "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", + "sc-utils", "serde", "serde_json", "sp-blockchain", @@ -7848,7 +7848,7 @@ dependencies = [ "parking_lot 0.12.1", "sc-executor", "sc-transaction-pool-api", - "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", + "sc-utils", "sp-api", "sp-blockchain", "sp-consensus", @@ -7902,7 +7902,7 @@ dependencies = [ "mockall", "parking_lot 0.12.1", "sc-client-api", - "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", + "sc-utils", "serde", "sp-api", "sp-blockchain", @@ -8017,7 +8017,7 @@ dependencies = [ "sc-network-common", "sc-network-gossip", "sc-telemetry", - "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", + "sc-utils", "serde_json", "sp-api", "sp-application-crypto", @@ -8201,7 +8201,7 @@ dependencies = [ "sc-consensus", "sc-network-common", "sc-peerset", - "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", + "sc-utils", "serde", "serde_json", "smallvec", @@ -8254,7 +8254,7 @@ dependencies = [ "prost-build", "sc-consensus", "sc-peerset", - "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", + "sc-utils", "serde", "smallvec", "sp-blockchain", @@ -8331,7 +8331,7 @@ dependencies = [ "sc-network", "sc-network-common", "sc-peerset", - "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", + "sc-utils", "smallvec", "sp-arithmetic", "sp-blockchain", @@ -8357,7 +8357,7 @@ dependencies = [ "sc-network", "sc-network-common", "sc-peerset", - "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", + "sc-utils", "sp-consensus", "sp-runtime", "substrate-prometheus-endpoint", @@ -8385,7 +8385,7 @@ dependencies = [ "sc-network", "sc-network-common", "sc-peerset", - "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", + "sc-utils", "sp-api", "sp-core", "sp-offchain", @@ -8404,7 +8404,7 @@ dependencies = [ "log", "parking_lot 0.12.1", "partial_sort", - "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", + "sc-utils", "serde_json", "sp-arithmetic", "wasm-timer", @@ -8435,7 +8435,7 @@ dependencies = [ "sc-rpc-api", "sc-tracing", "sc-transaction-pool-api", - "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", + "sc-utils", "serde_json", "sp-api", "sp-blockchain", @@ -8550,7 +8550,7 @@ dependencies = [ "sc-tracing", "sc-transaction-pool", "sc-transaction-pool-api", - "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", + "sc-utils", "serde", "serde_json", "sp-api", @@ -8597,7 +8597,7 @@ dependencies = [ "futures 0.3.29", "log", "sc-client-db", - "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", + "sc-utils", "sp-core", "thiserror", "tokio", @@ -8634,7 +8634,7 @@ dependencies = [ "parking_lot 0.12.1", "pin-project", "rand 0.8.5", - "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", + "sc-utils", "serde", "serde_json", "thiserror", @@ -8698,7 +8698,7 @@ dependencies = [ "parking_lot 0.12.1", "sc-client-api", "sc-transaction-pool-api", - "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", + "sc-utils", "serde", "sp-api", "sp-blockchain", @@ -8724,19 +8724,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "sc-utils" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" -dependencies = [ - "futures 0.3.29", - "futures-timer", - "lazy_static", - "log", - "parking_lot 0.12.1", - "prometheus", -] - [[package]] name = "sc-utils" version = "4.0.0-dev" diff --git a/Cargo.toml b/Cargo.toml index dd89032d..d6f8cce3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -121,8 +121,7 @@ sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/parityt sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } sc-proposer-metrics = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43"} sc-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -sc-finality-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-utils = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sc-utils = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } # Substrate Primitive sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } diff --git a/node/src/rpc/eth.rs b/node/src/rpc/eth.rs index fd37f9d4..44f9219f 100644 --- a/node/src/rpc/eth.rs +++ b/node/src/rpc/eth.rs @@ -24,6 +24,7 @@ pub use fc_rpc::{EthBlockDataCacheTask, EthConfig, OverrideHandle, StorageOverri pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool}; pub use fc_storage::overrides_handle; use fp_rpc::{ConvertTransaction, ConvertTransactionRuntimeApi, EthereumRuntimeRPCApi}; +use crate::eth::{EthApi, EthConfiguration}; use super::TracingConfig; @@ -100,6 +101,7 @@ pub fn create_eth>( fc_mapping_sync::EthereumBlockNotification, >, >, + eth_config: &EthConfiguration, optional_tracing_config: Option, ) -> Result, Box> where @@ -215,7 +217,10 @@ where io.merge(Trace::new(client.clone(), trace_requester, 20).into_rpc())?; } } - io.merge(tx_pool.into_rpc())?; + + if eth_config.ethapi.contains(&EthApi::Txpool) { + io.merge(tx_pool.into_rpc())?; + } Ok(io) } diff --git a/node/src/rpc/mod.rs b/node/src/rpc/mod.rs index cca57894..62030bab 100644 --- a/node/src/rpc/mod.rs +++ b/node/src/rpc/mod.rs @@ -25,7 +25,8 @@ mod tracing; pub use self::tracing::*; mod eth; -pub use self::eth::{create_eth, overrides_handle, EthDeps}; +pub use self::eth::{create_eth, overrides_handle, EthDeps, }; +use crate::service::EthConfiguration; /// Full client dependencies. pub struct FullDeps { @@ -59,6 +60,7 @@ pub struct TracingConfig { /// Instantiate all Full RPC extensions. pub fn create_full( + eth_config: &EthConfiguration, deps: FullDeps, subscription_task_executor: SubscriptionTaskExecutor, pubsub_notification_sinks: Arc< @@ -119,6 +121,7 @@ where eth, subscription_task_executor, pubsub_notification_sinks, + eth_config, optional_tracing_config, )?; diff --git a/node/src/service.rs b/node/src/service.rs index 044f5868..30066a7e 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -440,6 +440,7 @@ where }; crate::rpc::create_full( + ð_config.clone(), deps, subscription_task_executor, pubsub_notification_sinks.clone(), diff --git a/vendor/client/rpc/debug/src/lib.rs b/vendor/client/rpc/debug/src/lib.rs index e8da6bf5..a4301e93 100644 --- a/vendor/client/rpc/debug/src/lib.rs +++ b/vendor/client/rpc/debug/src/lib.rs @@ -148,7 +148,7 @@ where raw_max_memory_usage: usize, ) -> (impl Future, DebugRequester) { let (tx, mut rx): (DebugRequester, _) = - sc_utils::mpsc::tracing_unbounded("debug-requester"); + sc_utils::mpsc::tracing_unbounded("debug-requester", 1000); let fut = async move { loop { diff --git a/vendor/client/rpc/trace/src/lib.rs b/vendor/client/rpc/trace/src/lib.rs index 6b60264d..e749ec87 100644 --- a/vendor/client/rpc/trace/src/lib.rs +++ b/vendor/client/rpc/trace/src/lib.rs @@ -447,7 +447,7 @@ where ) -> (impl Future, CacheRequester) { // Communication with the outside world : let (requester_tx, mut requester_rx) = - sc_utils::mpsc::tracing_unbounded("trace-filter-cache"); + sc_utils::mpsc::tracing_unbounded("trace-filter-cache", 1000); // Task running in the service. let task = async move { From 28147e57f76ae2d3ab49521bb92b4206fb86dbe1 Mon Sep 17 00:00:00 2001 From: Carlos Lostao Date: Wed, 15 Nov 2023 20:42:42 +0100 Subject: [PATCH 36/37] feat: default ethapis set to none --- docker/client/entrypoint.sh | 8 +++++++- node/src/eth.rs | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docker/client/entrypoint.sh b/docker/client/entrypoint.sh index 09639035..49086342 100644 --- a/docker/client/entrypoint.sh +++ b/docker/client/entrypoint.sh @@ -36,7 +36,7 @@ if [ -n "$SEED" ]; then --key-type gran fi -START_COMMAND="./target/release/stability --base-path /tmp/node --validator --unsafe-rpc-external --rpc-cors all --rpc-port 9933 --prometheus-external --chain=$CHAIN_TARGET" +START_COMMAND="./target/release/stability --base-path /tmp/node --validator --unsafe-rpc-external --rpc-cors all --rpc-port 9933 --prometheus-external --ethapi --chain=$CHAIN_TARGET" if [ "$MODE" = "archive" ]; then START_COMMAND="$START_COMMAND --pruning archive" @@ -54,6 +54,12 @@ if [ -n "$ZERO_GAS_TX_POOL" ]; then START_COMMAND="$START_COMMAND --zero-gas-tx-pool $ZERO_GAS_TX_POOL" fi +if [ -n "$CUSTOM_ETH_APIS" ]; then + START_COMMAND="$START_COMMAND $CUSTOM_ETH_APIS" +else + START_COMMAND="$START_COMMAND txpool,debug,trace" +fi + echo "Starting $CHAIN_TARGET chain" eval $START_COMMAND diff --git a/node/src/eth.rs b/node/src/eth.rs index 4a1b2028..40a9ffa3 100644 --- a/node/src/eth.rs +++ b/node/src/eth.rs @@ -136,7 +136,7 @@ pub struct EthConfiguration { #[arg(long, default_value = "300")] pub ethapi_trace_cache_duration: u64, - #[arg(long, value_delimiter = ',', default_value = "debug,trace")] + #[arg(long, value_delimiter = ',', default_value = "none")] pub ethapi: Vec, } From abb60f2bd362f3ea39d14bf037496d854d5f89b0 Mon Sep 17 00:00:00 2001 From: Daniel Blanco Parla Date: Wed, 15 Nov 2023 22:06:44 +0100 Subject: [PATCH 37/37] hotfix: ethapi param --- docker/client/entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/client/entrypoint.sh b/docker/client/entrypoint.sh index 49086342..46b5ef76 100644 --- a/docker/client/entrypoint.sh +++ b/docker/client/entrypoint.sh @@ -36,7 +36,7 @@ if [ -n "$SEED" ]; then --key-type gran fi -START_COMMAND="./target/release/stability --base-path /tmp/node --validator --unsafe-rpc-external --rpc-cors all --rpc-port 9933 --prometheus-external --ethapi --chain=$CHAIN_TARGET" +START_COMMAND="./target/release/stability --base-path /tmp/node --validator --unsafe-rpc-external --rpc-cors all --rpc-port 9933 --prometheus-external --chain=$CHAIN_TARGET" if [ "$MODE" = "archive" ]; then START_COMMAND="$START_COMMAND --pruning archive" @@ -55,9 +55,9 @@ if [ -n "$ZERO_GAS_TX_POOL" ]; then fi if [ -n "$CUSTOM_ETH_APIS" ]; then - START_COMMAND="$START_COMMAND $CUSTOM_ETH_APIS" + START_COMMAND="$START_COMMAND --ethapi=$CUSTOM_ETH_APIS" else - START_COMMAND="$START_COMMAND txpool,debug,trace" + START_COMMAND="$START_COMMAND --ethapi=txpool,debug,trace" fi echo "Starting $CHAIN_TARGET chain"

(); - if type_id == sp_std::any::TypeId::of::>() { - return Some(system::Pallet::::crate_version()); - } - if type_id == sp_std::any::TypeId::of::>() { - return Some(pallet_timestamp::Pallet::::crate_version()); - } - if type_id == sp_std::any::TypeId::of::>() { - return Some(pallet_babe::Pallet::::crate_version()); - } - - None - } -} - -parameter_types! { - pub const DbWeight: RuntimeDbWeight = RuntimeDbWeight { - read: 100, - write: 1000, - }; - pub RuntimeBlockLength: BlockLength = - BlockLength::max(4 * 1024 * 1024); - pub RuntimeBlockWeights: BlockWeights = - BlockWeights::with_sensible_defaults(Weight::from_ref_time(4 * 1024 * 1024), Perbill::from_percent(75)); -} - -impl From> for Extrinsic { - fn from(_: frame_system::Call) -> Self { - unimplemented!("Not required in tests!") - } -} - -impl frame_system::pallet::Config for Runtime { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = RuntimeBlockWeights; - type BlockLength = RuntimeBlockLength; - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = Extrinsic; - type Index = u64; - type BlockNumber = u64; - type Hash = H256; - type Hashing = Hashing; - type AccountId = u64; - type Lookup = IdentityLookup; - type Header = Header; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = ConstU64<2400>; - type DbWeight = (); - type Version = (); - type PalletInfo = Self; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = ConstU32<16>; -} - -impl system::Config for Runtime {} - -impl pallet_timestamp::Config for Runtime { - /// A timestamp: milliseconds since the unix epoch. - type Moment = u64; - type OnTimestampSet = (); - type MinimumPeriod = ConstU64<5>; - type WeightInfo = (); -} - -parameter_types! { - pub const EpochDuration: u64 = 6; -} - -impl pallet_babe::Config for Runtime { - type EpochDuration = EpochDuration; - type ExpectedBlockTime = ConstU64<10_000>; - // there is no actual runtime in this test-runtime, so testing crates - // are manually adding the digests. normally in this situation you'd use - // pallet_babe::SameAuthoritiesForever. - type EpochChangeTrigger = pallet_babe::ExternalTrigger; - type DisabledValidators = (); - - type WeightInfo = (); - - type MaxAuthorities = ConstU32<10>; - type KeyOwnerProof = sp_core::Void; - type EquivocationReportSystem = (); -} - -/// Adds one to the given input and returns the final result. -#[inline(never)] -fn benchmark_add_one(i: u64) -> u64 { - i + 1 -} - -/// The `benchmark_add_one` function as function pointer. -#[cfg(not(feature = "std"))] -static BENCHMARK_ADD_ONE: sp_runtime_interface::wasm::ExchangeableFunction u64> = - sp_runtime_interface::wasm::ExchangeableFunction::new(benchmark_add_one); - -fn code_using_trie() -> u64 { - let pairs = [ - (b"0103000000000000000464".to_vec(), b"0400000000".to_vec()), - (b"0103000000000000000469".to_vec(), b"0401000000".to_vec()), - ] - .to_vec(); - - let mut mdb = PrefixedMemoryDB::default(); - let mut root = sp_std::default::Default::default(); - { - let mut t = TrieDBMutBuilderV1::::new(&mut mdb, &mut root).build(); - for (key, value) in &pairs { - if t.insert(key, value).is_err() { - return 101; - } - } - } - - let trie = TrieDBBuilder::::new(&mdb, &root).build(); - let res = if let Ok(iter) = trie.iter() { - iter.flatten().count() as u64 - } else { - 102 - }; - - res -} - -impl_opaque_keys! { - pub struct SessionKeys { - pub ed25519: ed25519::AppPublic, - pub sr25519: sr25519::AppPublic, - pub ecdsa: ecdsa::AppPublic, - } -} - -cfg_if! { - if #[cfg(feature = "std")] { - impl_runtime_apis! { - impl sp_api::Core for Runtime { - fn version() -> RuntimeVersion { - version() - } - - fn execute_block(block: Block) { - system::execute_block(block); - } - - fn initialize_block(header: &::Header) { - system::initialize_block(header) - } - } - - impl sp_api::Metadata for Runtime { - fn metadata() -> OpaqueMetadata { - unimplemented!() - } - - fn metadata_at_version(_version: u32) -> Option { - unimplemented!() - } - - fn metadata_versions() -> sp_std::vec::Vec { - unimplemented!() - } - } - - impl sp_transaction_pool::runtime_api::TaggedTransactionQueue for Runtime { - fn validate_transaction( - _source: TransactionSource, - utx: ::Extrinsic, - _: ::Hash, - ) -> TransactionValidity { - if let Extrinsic::IncludeData(data) = utx { - return Ok(ValidTransaction { - priority: data.len() as u64, - requires: vec![], - provides: vec![data], - longevity: 1, - propagate: false, - }); - } - - system::validate_transaction(utx) - } - } - - impl sp_block_builder::BlockBuilder for Runtime { - fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyExtrinsicResult { - system::execute_transaction(extrinsic) - } - - fn finalize_block() -> ::Header { - system::finalize_block() - } - - fn inherent_extrinsics(_data: InherentData) -> Vec<::Extrinsic> { - vec![] - } - - fn check_inherents(_block: Block, _data: InherentData) -> CheckInherentsResult { - CheckInherentsResult::new() - } - } - - impl self::TestAPI for Runtime { - fn balance_of(id: AccountId) -> u64 { - system::balance_of(id) - } - - fn benchmark_add_one(val: &u64) -> u64 { - val + 1 - } - - fn benchmark_vector_add_one(vec: &Vec) -> Vec { - let mut vec = vec.clone(); - vec.iter_mut().for_each(|v| *v += 1); - vec - } - - fn fail_convert_parameter(_: DecodeFails) {} - - fn fail_convert_return_value() -> DecodeFails { - DecodeFails::default() - } - - fn function_signature_changed() -> u64 { - 1 - } - - fn fail_on_native() -> u64 { - panic!("Failing because we are on native") - } - fn fail_on_wasm() -> u64 { - 1 - } - - fn use_trie() -> u64 { - code_using_trie() - } - - fn benchmark_indirect_call() -> u64 { - let function = benchmark_add_one; - (0..1000).fold(0, |p, i| p + function(i)) - } - fn benchmark_direct_call() -> u64 { - (0..1000).fold(0, |p, i| p + benchmark_add_one(i)) - } - - fn vec_with_capacity(_size: u32) -> Vec { - unimplemented!("is not expected to be invoked from non-wasm builds"); - } - - fn get_block_number() -> u64 { - system::get_block_number().expect("Block number is initialized") - } - - fn take_block_number() -> Option { - system::take_block_number() - } - - fn test_ed25519_crypto() -> (ed25519::AppSignature, ed25519::AppPublic) { - test_ed25519_crypto() - } - - fn test_sr25519_crypto() -> (sr25519::AppSignature, sr25519::AppPublic) { - test_sr25519_crypto() - } - - fn test_ecdsa_crypto() -> (ecdsa::AppSignature, ecdsa::AppPublic) { - test_ecdsa_crypto() - } - - fn test_storage() { - test_read_storage(); - test_read_child_storage(); - } - - fn test_witness(proof: StorageProof, root: crate::Hash) { - test_witness(proof, root); - } - - fn test_multiple_arguments(data: Vec, other: Vec, num: u32) { - assert_eq!(&data[..], &other[..]); - assert_eq!(data.len(), num as usize); - } - - fn do_trace_log() { - log::trace!("Hey I'm runtime"); - } - - fn verify_ed25519(sig: ed25519::Signature, public: ed25519::Public, message: Vec) -> bool { - sp_io::crypto::ed25519_verify(&sig, &message, &public) - } - } - - impl sp_consensus_aura::AuraApi for Runtime { - fn slot_duration() -> sp_consensus_aura::SlotDuration { - sp_consensus_aura::SlotDuration::from_millis(1000) - } - - fn authorities() -> Vec { - system::authorities().into_iter().map(|a| { - let authority: sr25519::Public = a.into(); - AuraId::from(authority) - }).collect() - } - } - - impl sp_consensus_babe::BabeApi for Runtime { - fn configuration() -> sp_consensus_babe::BabeConfiguration { - sp_consensus_babe::BabeConfiguration { - slot_duration: 1000, - epoch_length: EpochDuration::get(), - c: (3, 10), - authorities: system::authorities() - .into_iter().map(|x|(x, 1)).collect(), - randomness: >::randomness(), - allowed_slots: AllowedSlots::PrimaryAndSecondaryPlainSlots, - } - } - - fn current_epoch_start() -> Slot { - >::current_epoch_start() - } - - fn current_epoch() -> sp_consensus_babe::Epoch { - >::current_epoch() - } - - fn next_epoch() -> sp_consensus_babe::Epoch { - >::next_epoch() - } - - fn submit_report_equivocation_unsigned_extrinsic( - _equivocation_proof: sp_consensus_babe::EquivocationProof< - ::Header, - >, - _key_owner_proof: sp_consensus_babe::OpaqueKeyOwnershipProof, - ) -> Option<()> { - None - } - - fn generate_key_ownership_proof( - _slot: sp_consensus_babe::Slot, - _authority_id: sp_consensus_babe::AuthorityId, - ) -> Option { - None - } - } - - impl sp_offchain::OffchainWorkerApi for Runtime { - fn offchain_worker(header: &::Header) { - let ex = Extrinsic::IncludeData(header.number.encode()); - sp_io::offchain::submit_transaction(ex.encode()).unwrap(); - } - } - - impl sp_session::SessionKeys for Runtime { - fn generate_session_keys(_: Option>) -> Vec { - SessionKeys::generate(None) - } - - fn decode_session_keys( - encoded: Vec, - ) -> Option, sp_core::crypto::KeyTypeId)>> { - SessionKeys::decode_into_raw_public_keys(&encoded) - } - } - - impl sp_consensus_grandpa::GrandpaApi for Runtime { - fn grandpa_authorities() -> sp_consensus_grandpa::AuthorityList { - Vec::new() - } - - fn current_set_id() -> sp_consensus_grandpa::SetId { - 0 - } - - fn submit_report_equivocation_unsigned_extrinsic( - _equivocation_proof: sp_consensus_grandpa::EquivocationProof< - ::Hash, - NumberFor, - >, - _key_owner_proof: sp_consensus_grandpa::OpaqueKeyOwnershipProof, - ) -> Option<()> { - None - } - - fn generate_key_ownership_proof( - _set_id: sp_consensus_grandpa::SetId, - _authority_id: sp_consensus_grandpa::AuthorityId, - ) -> Option { - None - } - } - - impl sp_consensus_beefy::BeefyApi for Runtime { - fn beefy_genesis() -> Option { - None - } - - fn validator_set() -> Option> { - None - } - - fn submit_report_equivocation_unsigned_extrinsic( - _equivocation_proof: sp_consensus_beefy::EquivocationProof< - NumberFor, - sp_consensus_beefy::crypto::AuthorityId, - sp_consensus_beefy::crypto::Signature - >, - _key_owner_proof: sp_consensus_beefy::OpaqueKeyOwnershipProof, - ) -> Option<()> { None } - - fn generate_key_ownership_proof( - _set_id: sp_consensus_beefy::ValidatorSetId, - _authority_id: sp_consensus_beefy::crypto::AuthorityId, - ) -> Option { None } - - } - - impl pallet_beefy_mmr::BeefyMmrApi for Runtime { - fn authority_set_proof() -> sp_consensus_beefy::mmr::BeefyAuthoritySet { - Default::default() - } - - fn next_authority_set_proof() -> sp_consensus_beefy::mmr::BeefyNextAuthoritySet { - Default::default() - } - } - - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(_account: AccountId) -> Index { - 0 - } - } - - impl stbl_primitives_fee_compatible_api::CompatibleFeeApi for Runtime { - fn is_compatible_fee(tx: ::Extrinsic, _: RealAccountiD) -> bool { - if let Extrinsic::Skipped(_) = tx { - return false; - } - true - } - } - - impl stbl_primitives_zero_gas_transactions_api::ZeroGasTransactionApi for Runtime { - fn convert_zero_gas_transaction(_transaction: EthereumTransaction, _validator_signature: Vec) -> ::Extrinsic { - return Extrinsic::Skipped(0); - } - } - } - } else { - impl_runtime_apis! { - impl sp_api::Core for Runtime { - fn version() -> RuntimeVersion { - version() - } - - fn execute_block(block: Block) { - system::execute_block(block); - } - - fn initialize_block(header: &::Header) { - system::initialize_block(header) - } - } - - impl sp_api::Metadata for Runtime { - fn metadata() -> OpaqueMetadata { - unimplemented!() - } - - fn metadata_at_version(_version: u32) -> Option { - unimplemented!() - } - - fn metadata_versions() -> sp_std::vec::Vec { - unimplemented!() - } - } - - impl sp_transaction_pool::runtime_api::TaggedTransactionQueue for Runtime { - fn validate_transaction( - _source: TransactionSource, - utx: ::Extrinsic, - _: ::Hash, - ) -> TransactionValidity { - if let Extrinsic::IncludeData(data) = utx { - return Ok(ValidTransaction{ - priority: data.len() as u64, - requires: vec![], - provides: vec![data], - longevity: 1, - propagate: false, - }); - } - - system::validate_transaction(utx) - } - } - - impl sp_block_builder::BlockBuilder for Runtime { - fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyExtrinsicResult { - system::execute_transaction(extrinsic) - } - - fn finalize_block() -> ::Header { - system::finalize_block() - } - - fn inherent_extrinsics(_data: InherentData) -> Vec<::Extrinsic> { - vec![] - } - - fn check_inherents(_block: Block, _data: InherentData) -> CheckInherentsResult { - CheckInherentsResult::new() - } - } - - impl self::TestAPI for Runtime { - fn balance_of(id: AccountId) -> u64 { - system::balance_of(id) - } - - fn benchmark_add_one(val: &u64) -> u64 { - val + 1 - } - - fn benchmark_vector_add_one(vec: &Vec) -> Vec { - let mut vec = vec.clone(); - vec.iter_mut().for_each(|v| *v += 1); - vec - } - - fn fail_convert_parameter(_: DecodeFails) {} - - fn fail_convert_return_value() -> DecodeFails { - DecodeFails::default() - } - - fn function_signature_changed() -> Vec { - let mut vec = Vec::new(); - vec.push(1); - vec.push(2); - vec - } - - fn fail_on_native() -> u64 { - 1 - } - - fn fail_on_wasm() -> u64 { - panic!("Failing because we are on wasm") - } - - fn use_trie() -> u64 { - code_using_trie() - } - - fn benchmark_indirect_call() -> u64 { - (0..10000).fold(0, |p, i| p + BENCHMARK_ADD_ONE.get()(i)) - } - - fn benchmark_direct_call() -> u64 { - (0..10000).fold(0, |p, i| p + benchmark_add_one(i)) - } - - fn vec_with_capacity(size: u32) -> Vec { - Vec::with_capacity(size as usize) - } - - fn get_block_number() -> u64 { - system::get_block_number().expect("Block number is initialized") - } - - fn take_block_number() -> Option { - system::take_block_number() - } - - fn test_ed25519_crypto() -> (ed25519::AppSignature, ed25519::AppPublic) { - test_ed25519_crypto() - } - - fn test_sr25519_crypto() -> (sr25519::AppSignature, sr25519::AppPublic) { - test_sr25519_crypto() - } - - fn test_ecdsa_crypto() -> (ecdsa::AppSignature, ecdsa::AppPublic) { - test_ecdsa_crypto() - } - - fn test_storage() { - test_read_storage(); - test_read_child_storage(); - } - - fn test_witness(proof: StorageProof, root: crate::Hash) { - test_witness(proof, root); - } - - fn test_multiple_arguments(data: Vec, other: Vec, num: u32) { - assert_eq!(&data[..], &other[..]); - assert_eq!(data.len(), num as usize); - } - - fn do_trace_log() { - log::trace!("Hey I'm runtime: {}", log::STATIC_MAX_LEVEL); - } - - fn verify_ed25519(sig: ed25519::Signature, public: ed25519::Public, message: Vec) -> bool { - sp_io::crypto::ed25519_verify(&sig, &message, &public) - } - } - - impl sp_consensus_aura::AuraApi for Runtime { - fn slot_duration() -> sp_consensus_aura::SlotDuration { - sp_consensus_aura::SlotDuration::from_millis(1000) - } - - fn authorities() -> Vec { - system::authorities().into_iter().map(|a| { - let authority: sr25519::Public = a.into(); - AuraId::from(authority) - }).collect() - } - } - - impl sp_consensus_babe::BabeApi for Runtime { - fn configuration() -> sp_consensus_babe::BabeConfiguration { - sp_consensus_babe::BabeConfiguration { - slot_duration: 1000, - epoch_length: EpochDuration::get(), - c: (3, 10), - authorities: system::authorities() - .into_iter().map(|x|(x, 1)).collect(), - randomness: >::randomness(), - allowed_slots: AllowedSlots::PrimaryAndSecondaryPlainSlots, - } - } - - fn current_epoch_start() -> Slot { - >::current_epoch_start() - } - - fn current_epoch() -> sp_consensus_babe::Epoch { - >::current_epoch() - } - - fn next_epoch() -> sp_consensus_babe::Epoch { - >::next_epoch() - } - - fn submit_report_equivocation_unsigned_extrinsic( - _equivocation_proof: sp_consensus_babe::EquivocationProof< - ::Header, - >, - _key_owner_proof: sp_consensus_babe::OpaqueKeyOwnershipProof, - ) -> Option<()> { - None - } - - fn generate_key_ownership_proof( - _slot: sp_consensus_babe::Slot, - _authority_id: sp_consensus_babe::AuthorityId, - ) -> Option { - None - } - } - - impl sp_offchain::OffchainWorkerApi for Runtime { - fn offchain_worker(header: &::Header) { - let ex = Extrinsic::IncludeData(header.number.encode()); - sp_io::offchain::submit_transaction(ex.encode()).unwrap() - } - } - - impl sp_session::SessionKeys for Runtime { - fn generate_session_keys(_: Option>) -> Vec { - SessionKeys::generate(None) - } - - fn decode_session_keys( - encoded: Vec, - ) -> Option, sp_core::crypto::KeyTypeId)>> { - SessionKeys::decode_into_raw_public_keys(&encoded) - } - } - - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(_account: AccountId) -> Index { - 0 - } - } - - impl stbl_primitives_fee_compatible_api::CompatibleFeeApi for Runtime { - fn is_compatible_fee(tx: ::Extrinsic, validator: RealAccountiD) -> bool { - if let Extrinsic::Skipped(_) = tx { - return false; - } - true - } - } - - impl stbl_primitives_zero_gas_transactions_api::ZeroGasTransactionApi for Runtime { - fn convert_zero_gas_transaction(transaction: EthereumTransaction, validator_signature: Vec) -> ::Extrinsic { - return Extrinsic::Skipped(0); - } - } - } - } -} - -fn test_ed25519_crypto() -> (ed25519::AppSignature, ed25519::AppPublic) { - let public0 = ed25519::AppPublic::generate_pair(None); - let public1 = ed25519::AppPublic::generate_pair(None); - let public2 = ed25519::AppPublic::generate_pair(None); - - let all = ed25519::AppPublic::all(); - assert!(all.contains(&public0)); - assert!(all.contains(&public1)); - assert!(all.contains(&public2)); - - let signature = public0 - .sign(&"ed25519") - .expect("Generates a valid `ed25519` signature."); - assert!(public0.verify(&"ed25519", &signature)); - (signature, public0) -} - -fn test_sr25519_crypto() -> (sr25519::AppSignature, sr25519::AppPublic) { - let public0 = sr25519::AppPublic::generate_pair(None); - let public1 = sr25519::AppPublic::generate_pair(None); - let public2 = sr25519::AppPublic::generate_pair(None); - - let all = sr25519::AppPublic::all(); - assert!(all.contains(&public0)); - assert!(all.contains(&public1)); - assert!(all.contains(&public2)); - - let signature = public0 - .sign(&"sr25519") - .expect("Generates a valid `sr25519` signature."); - assert!(public0.verify(&"sr25519", &signature)); - (signature, public0) -} - -fn test_ecdsa_crypto() -> (ecdsa::AppSignature, ecdsa::AppPublic) { - let public0 = ecdsa::AppPublic::generate_pair(None); - let public1 = ecdsa::AppPublic::generate_pair(None); - let public2 = ecdsa::AppPublic::generate_pair(None); - - let all = ecdsa::AppPublic::all(); - assert!(all.contains(&public0)); - assert!(all.contains(&public1)); - assert!(all.contains(&public2)); - - let signature = public0 - .sign(&"ecdsa") - .expect("Generates a valid `ecdsa` signature."); - - assert!(public0.verify(&"ecdsa", &signature)); - (signature, public0) -} - -fn test_read_storage() { - const KEY: &[u8] = b":read_storage"; - sp_io::storage::set(KEY, b"test"); - - let mut v = [0u8; 4]; - let r = sp_io::storage::read(KEY, &mut v, 0); - assert_eq!(r, Some(4)); - assert_eq!(&v, b"test"); - - let mut v = [0u8; 4]; - let r = sp_io::storage::read(KEY, &mut v, 4); - assert_eq!(r, Some(0)); - assert_eq!(&v, &[0, 0, 0, 0]); -} - -fn test_read_child_storage() { - const STORAGE_KEY: &[u8] = b"unique_id_1"; - const KEY: &[u8] = b":read_child_storage"; - sp_io::default_child_storage::set(STORAGE_KEY, KEY, b"test"); - - let mut v = [0u8; 4]; - let r = sp_io::default_child_storage::read(STORAGE_KEY, KEY, &mut v, 0); - assert_eq!(r, Some(4)); - assert_eq!(&v, b"test"); - - let mut v = [0u8; 4]; - let r = sp_io::default_child_storage::read(STORAGE_KEY, KEY, &mut v, 8); - assert_eq!(r, Some(0)); - assert_eq!(&v, &[0, 0, 0, 0]); -} - -fn test_witness(proof: StorageProof, root: crate::Hash) { - use sp_externalities::Externalities; - let db: sp_trie::MemoryDB = proof.into_memory_db(); - let backend = sp_state_machine::TrieBackendBuilder::<_, crate::Hashing>::new(db, root).build(); - let mut overlay = sp_state_machine::OverlayedChanges::default(); - let mut cache = sp_state_machine::StorageTransactionCache::<_, _>::default(); - let mut ext = sp_state_machine::Ext::new( - &mut overlay, - &mut cache, - &backend, - #[cfg(feature = "std")] - None, - ); - assert!(ext.storage(b"value3").is_some()); - assert!(ext.storage_root(Default::default()).as_slice() == &root[..]); - ext.place_storage(vec![0], Some(vec![1])); - assert!(ext.storage_root(Default::default()).as_slice() != &root[..]); -} - -#[cfg(test)] -mod tests { - use codec::Encode; - use sc_block_builder::BlockBuilderProvider; - use sp_api::ProvideRuntimeApi; - use sp_consensus::BlockOrigin; - use sp_core::{storage::well_known_keys::HEAP_PAGES, ExecutionContext}; - use sp_runtime::generic::BlockId; - use sp_state_machine::ExecutionStrategy; - use stability_test_runtime_client::{ - prelude::*, runtime::TestAPI, DefaultTestClientBuilderExt, TestClientBuilder, - }; - - #[test] - fn heap_pages_is_respected() { - // This tests that the on-chain HEAP_PAGES parameter is respected. - - // Create a client devoting only 8 pages of wasm memory. This gives us ~512k of heap memory. - let mut client = TestClientBuilder::new() - .set_execution_strategy(ExecutionStrategy::AlwaysWasm) - .set_heap_pages(8) - .build(); - let best_hash = client.chain_info().best_hash; - - // Try to allocate 1024k of memory on heap. This is going to fail since it is twice larger - // than the heap. - let ret = client.runtime_api().vec_with_capacity_with_context( - best_hash, - // Use `BlockImport` to ensure we use the on chain heap pages as configured above. - ExecutionContext::Importing, - 1048576, - ); - assert!(ret.is_err()); - - // Create a block that sets the `:heap_pages` to 32 pages of memory which corresponds to - // ~2048k of heap memory. - let (new_at_hash, block) = { - let mut builder = client.new_block(Default::default()).unwrap(); - builder - .push_storage_change(HEAP_PAGES.to_vec(), Some(32u64.encode())) - .unwrap(); - let block = builder.build().unwrap().block; - let hash = block.header.hash(); - (hash, block) - }; - - futures::executor::block_on(client.import(BlockOrigin::Own, block)).unwrap(); - - // Allocation of 1024k while having ~2048k should succeed. - let ret = client - .runtime_api() - .vec_with_capacity(new_at_hash, 1048576); - assert!(ret.is_ok()); - } - - #[test] - fn test_storage() { - let client = TestClientBuilder::new() - .set_execution_strategy(ExecutionStrategy::Both) - .build(); - let runtime_api = client.runtime_api(); - let best_hash = client.chain_info().best_hash; - - runtime_api.test_storage(best_hash).unwrap(); - } - - fn witness_backend() -> (sp_trie::MemoryDB, crate::Hash) { - use sp_trie::TrieMut; - let mut root = crate::Hash::default(); - let mut mdb = sp_trie::MemoryDB::::default(); - { - let mut trie = - sp_trie::trie_types::TrieDBMutBuilderV1::new(&mut mdb, &mut root).build(); - trie.insert(b"value3", &[142]).expect("insert failed"); - trie.insert(b"value4", &[124]).expect("insert failed"); - }; - (mdb, root) - } - - #[test] - fn witness_backend_works() { - let (db, root) = witness_backend(); - let backend = - sp_state_machine::TrieBackendBuilder::<_, crate::Hashing>::new(db, root).build(); - let proof = sp_state_machine::prove_read(backend, vec![b"value3"]).unwrap(); - let client = TestClientBuilder::new() - .set_execution_strategy(ExecutionStrategy::Both) - .build(); - let runtime_api = client.runtime_api(); - let best_hash = client.chain_info().best_hash; - - runtime_api.test_witness(best_hash, proof, root).unwrap(); - } -} diff --git a/test-utils/stability-runtime/src/system.rs b/test-utils/stability-runtime/src/system.rs deleted file mode 100644 index fdad2d52..00000000 --- a/test-utils/stability-runtime/src/system.rs +++ /dev/null @@ -1,617 +0,0 @@ -// This file is part of Stability. - -// Copyright 2023 Stability Solutions. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! System manager: Handles all of the top-level stuff; executing block/transaction, setting code -//! and depositing logs. - -use crate::{ - AccountId, AuthorityId, Block, BlockNumber, Digest, Extrinsic, Header, Runtime, Transfer, - H256 as Hash, -}; -use codec::{Decode, Encode, KeyedVec}; -use frame_support::storage; -use sp_core::storage::well_known_keys; -use sp_io::{hashing::blake2_256, storage::root as storage_root, trie}; -use sp_runtime::{ - generic, - traits::Header as _, - transaction_validity::{ - InvalidTransaction, TransactionValidity, TransactionValidityError, ValidTransaction, - }, - ApplyExtrinsicResult, -}; -use sp_std::prelude::*; - -const NONCE_OF: &[u8] = b"nonce:"; -const BALANCE_OF: &[u8] = b"balance:"; - -pub use self::pallet::*; - -#[frame_support::pallet] -mod pallet { - use super::*; - use frame_support::pallet_prelude::*; - - #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] - #[pallet::without_storage_info] - pub struct Pallet(PhantomData); - - #[pallet::config] - pub trait Config: frame_system::Config {} - - #[pallet::storage] - pub type ExtrinsicData = StorageMap<_, Blake2_128Concat, u32, Vec, ValueQuery>; - - // The current block number being processed. Set by `execute_block`. - #[pallet::storage] - pub type Number = StorageValue<_, BlockNumber, OptionQuery>; - - #[pallet::storage] - pub type ParentHash = StorageValue<_, Hash, ValueQuery>; - - #[pallet::storage] - pub type NewAuthorities = StorageValue<_, Vec, OptionQuery>; - - #[pallet::storage] - pub type StorageDigest = StorageValue<_, Digest, OptionQuery>; - - #[pallet::storage] - pub type Authorities = StorageValue<_, Vec, ValueQuery>; - - #[pallet::genesis_config] - #[cfg_attr(feature = "std", derive(Default))] - pub struct GenesisConfig { - pub authorities: Vec, - } - - #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { - fn build(&self) { - >::put(self.authorities.clone()); - } - } -} - -pub fn balance_of_key(who: AccountId) -> Vec { - who.to_keyed_vec(BALANCE_OF) -} - -pub fn balance_of(who: AccountId) -> u64 { - storage::hashed::get_or(&blake2_256, &balance_of_key(who), 0) -} - -pub fn nonce_of(who: AccountId) -> u64 { - storage::hashed::get_or(&blake2_256, &who.to_keyed_vec(NONCE_OF), 0) -} - -pub fn initialize_block(header: &Header) { - // populate environment. - >::put(&header.number); - >::put(&header.parent_hash); - >::put(header.digest()); - storage::unhashed::put(well_known_keys::EXTRINSIC_INDEX, &0u32); - - // try to read something that depends on current header digest - // so that it'll be included in execution proof - if let Some(generic::DigestItem::Other(v)) = header.digest().logs().iter().next() { - let _: Option = storage::unhashed::get(v); - } -} - -pub fn authorities() -> Vec { - >::get() -} - -pub fn get_block_number() -> Option { - >::get() -} - -pub fn take_block_number() -> Option { - >::take() -} - -#[derive(Copy, Clone)] -enum Mode { - Verify, - Overwrite, -} - -/// Actually execute all transitioning for `block`. -pub fn polish_block(block: &mut Block) { - execute_block_with_state_root_handler(block, Mode::Overwrite); -} - -pub fn execute_block(mut block: Block) -> Header { - execute_block_with_state_root_handler(&mut block, Mode::Verify) -} - -fn execute_block_with_state_root_handler(block: &mut Block, mode: Mode) -> Header { - let header = &mut block.header; - - initialize_block(header); - - // execute transactions - block.extrinsics.iter().for_each(|e| { - let _ = execute_transaction(e.clone()).unwrap_or_else(|_| panic!("Invalid transaction")); - }); - - let new_header = finalize_block(); - - if let Mode::Overwrite = mode { - header.state_root = new_header.state_root; - } else { - info_expect_equal_hash(&new_header.state_root, &header.state_root); - assert_eq!( - new_header.state_root, header.state_root, - "Storage root must match that calculated.", - ); - } - - if let Mode::Overwrite = mode { - header.extrinsics_root = new_header.extrinsics_root; - } else { - info_expect_equal_hash(&new_header.extrinsics_root, &header.extrinsics_root); - assert_eq!( - new_header.extrinsics_root, header.extrinsics_root, - "Transaction trie root must be valid.", - ); - } - - new_header -} - -/// The block executor. -pub struct BlockExecutor; - -impl frame_support::traits::ExecuteBlock for BlockExecutor { - fn execute_block(block: Block) { - execute_block(block); - } -} - -/// Execute a transaction outside of the block execution function. -/// This doesn't attempt to validate anything regarding the block. -pub fn validate_transaction(utx: Extrinsic) -> TransactionValidity { - if check_signature(&utx).is_err() { - return InvalidTransaction::BadProof.into(); - } - - let tx = utx.transfer(); - let nonce_key = tx.from.to_keyed_vec(NONCE_OF); - let expected_nonce: u64 = storage::hashed::get_or(&blake2_256, &nonce_key, 0); - if tx.nonce < expected_nonce { - return InvalidTransaction::Stale.into(); - } - if tx.nonce > expected_nonce + 64 { - return InvalidTransaction::Future.into(); - } - - let encode = |from: &AccountId, nonce: u64| (from, nonce).encode(); - let requires = if tx.nonce != expected_nonce && tx.nonce > 0 { - vec![encode(&tx.from, tx.nonce - 1)] - } else { - vec![] - }; - - let provides = vec![encode(&tx.from, tx.nonce)]; - - Ok(ValidTransaction { - priority: tx.amount, - requires, - provides, - longevity: 64, - propagate: true, - }) -} - -/// Execute a transaction outside of the block execution function. -/// This doesn't attempt to validate anything regarding the block. -pub fn execute_transaction(utx: Extrinsic) -> ApplyExtrinsicResult { - let extrinsic_index: u32 = - storage::unhashed::get(well_known_keys::EXTRINSIC_INDEX).unwrap_or_default(); - let result = execute_transaction_backend(&utx, extrinsic_index); - >::insert(extrinsic_index, utx.encode()); - storage::unhashed::put(well_known_keys::EXTRINSIC_INDEX, &(extrinsic_index + 1)); - result -} - -/// Finalize the block. -pub fn finalize_block() -> Header { - use sp_core::storage::StateVersion; - let extrinsic_index: u32 = storage::unhashed::take(well_known_keys::EXTRINSIC_INDEX).unwrap(); - let txs: Vec<_> = (0..extrinsic_index) - .map(>::take) - .collect(); - let extrinsics_root = trie::blake2_256_ordered_root(txs, StateVersion::V0); - let number = >::take().expect("Number is set by `initialize_block`"); - let parent_hash = >::take(); - let mut digest = - >::take().expect("StorageDigest is set by `initialize_block`"); - - let o_new_authorities = >::take(); - - // This MUST come after all changes to storage are done. Otherwise we will fail the - // “Storage root does not match that calculated” assertion. - let storage_root = Hash::decode(&mut &storage_root(StateVersion::V1)[..]) - .expect("`storage_root` is a valid hash"); - - if let Some(new_authorities) = o_new_authorities { - digest.push(generic::DigestItem::Consensus( - *b"aura", - new_authorities.encode(), - )); - digest.push(generic::DigestItem::Consensus( - *b"babe", - new_authorities.encode(), - )); - } - - Header { - number, - extrinsics_root, - state_root: storage_root, - parent_hash, - digest, - } -} - -#[inline(always)] -fn check_signature(utx: &Extrinsic) -> Result<(), TransactionValidityError> { - use sp_runtime::traits::BlindCheckable; - utx.clone() - .check() - .map_err(|_| InvalidTransaction::BadProof.into()) - .map(|_| ()) -} - -fn execute_transaction_backend(utx: &Extrinsic, extrinsic_index: u32) -> ApplyExtrinsicResult { - check_signature(utx)?; - match utx { - Extrinsic::Transfer { - exhaust_resources_when_not_first: true, - .. - } if extrinsic_index != 0 => Err(InvalidTransaction::ExhaustsResources.into()), - Extrinsic::Transfer { ref transfer, .. } => execute_transfer_backend(transfer), - Extrinsic::AuthoritiesChange(ref new_auth) => execute_new_authorities_backend(new_auth), - Extrinsic::IncludeData(_) => Ok(Ok(())), - Extrinsic::StorageChange(key, value) => { - execute_storage_change(key, value.as_ref().map(|v| &**v)) - } - Extrinsic::Skipped(_) => Ok(Ok(())), - Extrinsic::OffchainIndexSet(key, value) => { - sp_io::offchain_index::set(key, value); - Ok(Ok(())) - } - Extrinsic::OffchainIndexClear(key) => { - sp_io::offchain_index::clear(key); - Ok(Ok(())) - } - Extrinsic::Store(data) => execute_store(data.clone()), - Extrinsic::ReadAndPanic(i) => execute_read(*i, true), - Extrinsic::Read(i) => execute_read(*i, false), - } -} - -fn execute_read(read: u32, panic_at_end: bool) -> ApplyExtrinsicResult { - let mut next_key = vec![]; - for _ in 0..(read as usize) { - if let Some(next) = sp_io::storage::next_key(&next_key) { - // Read the value - sp_io::storage::get(&next); - - next_key = next; - } else { - if panic_at_end { - return Ok(Ok(())) - } else { - panic!("Could not read {read} times from the state"); - } - } - } - - if panic_at_end { - panic!("BYE") - } else { - Ok(Ok(())) - } -} - -fn execute_transfer_backend(tx: &Transfer) -> ApplyExtrinsicResult { - // check nonce - let nonce_key = tx.from.to_keyed_vec(NONCE_OF); - let expected_nonce: u64 = storage::hashed::get_or(&blake2_256, &nonce_key, 0); - if tx.nonce != expected_nonce { - return Err(InvalidTransaction::Stale.into()); - } - - // increment nonce in storage - storage::hashed::put(&blake2_256, &nonce_key, &(expected_nonce + 1)); - - // check sender balance - let from_balance_key = tx.from.to_keyed_vec(BALANCE_OF); - let from_balance: u64 = storage::hashed::get_or(&blake2_256, &from_balance_key, 0); - - // enact transfer - if tx.amount > from_balance { - return Err(InvalidTransaction::Payment.into()); - } - let to_balance_key = tx.to.to_keyed_vec(BALANCE_OF); - let to_balance: u64 = storage::hashed::get_or(&blake2_256, &to_balance_key, 0); - storage::hashed::put(&blake2_256, &from_balance_key, &(from_balance - tx.amount)); - storage::hashed::put(&blake2_256, &to_balance_key, &(to_balance + tx.amount)); - Ok(Ok(())) -} - -fn execute_store(data: Vec) -> ApplyExtrinsicResult { - let content_hash = sp_io::hashing::blake2_256(&data); - let extrinsic_index: u32 = storage::unhashed::get(well_known_keys::EXTRINSIC_INDEX).unwrap(); - sp_io::transaction_index::index(extrinsic_index, data.len() as u32, content_hash); - Ok(Ok(())) -} - -fn execute_new_authorities_backend(new_authorities: &[AuthorityId]) -> ApplyExtrinsicResult { - >::put(new_authorities.to_vec()); - Ok(Ok(())) -} - -fn execute_storage_change(key: &[u8], value: Option<&[u8]>) -> ApplyExtrinsicResult { - match value { - Some(value) => storage::unhashed::put_raw(key, value), - None => storage::unhashed::kill(key), - } - Ok(Ok(())) -} - -#[cfg(feature = "std")] -fn info_expect_equal_hash(given: &Hash, expected: &Hash) { - use sp_core::hexdisplay::HexDisplay; - if given != expected { - println!( - "Hash: given={}, expected={}", - HexDisplay::from(given.as_fixed_bytes()), - HexDisplay::from(expected.as_fixed_bytes()), - ); - } -} - -#[cfg(not(feature = "std"))] -fn info_expect_equal_hash(given: &Hash, expected: &Hash) { - if given != expected { - sp_runtime::print("Hash not equal"); - sp_runtime::print(given.as_bytes()); - sp_runtime::print(expected.as_bytes()); - } -} - -#[cfg(test)] -mod tests { - use super::*; - - use crate::{wasm_binary_unwrap, Header, Transfer}; - use sc_executor::{NativeElseWasmExecutor, WasmExecutor}; - use sp_core::{ - map, - traits::{CallContext, CodeExecutor, RuntimeCode}, - }; - use sp_io::{hashing::twox_128, TestExternalities}; - use stability_test_runtime_client::{AccountKeyring, Sr25519Keyring}; - - // Declare an instance of the native executor dispatch for the test runtime. - pub struct NativeDispatch; - - impl sc_executor::NativeExecutionDispatch for NativeDispatch { - type ExtendHostFunctions = (); - - fn dispatch(method: &str, data: &[u8]) -> Option> { - crate::api::dispatch(method, data) - } - - fn native_version() -> sc_executor::NativeVersion { - crate::native_version() - } - } - - fn executor() -> NativeElseWasmExecutor { - NativeElseWasmExecutor::new_with_wasm_executor(WasmExecutor::builder().build()) - } - - fn new_test_ext() -> TestExternalities { - let authorities = vec![ - Sr25519Keyring::Alice.to_raw_public(), - Sr25519Keyring::Bob.to_raw_public(), - Sr25519Keyring::Charlie.to_raw_public(), - ]; - - TestExternalities::new_with_code( - wasm_binary_unwrap(), - sp_core::storage::Storage { - top: map![ - twox_128(b"latest").to_vec() => vec![69u8; 32], - twox_128(b"sys:auth").to_vec() => authorities.encode(), - blake2_256(&AccountKeyring::Alice.to_raw_public().to_keyed_vec(b"balance:")).to_vec() => { - vec![111u8, 0, 0, 0, 0, 0, 0, 0] - }, - ], - children_default: map![], - }, - ) - } - - fn block_import_works(block_executor: F) - where - F: Fn(Block, &mut TestExternalities), - { - let h = Header { - parent_hash: [69u8; 32].into(), - number: 1, - state_root: Default::default(), - extrinsics_root: Default::default(), - digest: Default::default(), - }; - let mut b = Block { - header: h, - extrinsics: vec![], - }; - - new_test_ext().execute_with(|| polish_block(&mut b)); - - block_executor(b, &mut new_test_ext()); - } - - #[test] - fn block_import_works_native() { - block_import_works(|b, ext| { - ext.execute_with(|| { - execute_block(b); - }) - }); - } - - #[test] - fn block_import_works_wasm() { - block_import_works(|b, ext| { - let mut ext = ext.ext(); - let runtime_code = RuntimeCode { - code_fetcher: &sp_core::traits::WrappedRuntimeCode(wasm_binary_unwrap().into()), - hash: Vec::new(), - heap_pages: None, - }; - - executor() - .call( - &mut ext, - &runtime_code, - "Core_execute_block", - &b.encode(), - false, - CallContext::Offchain, - ) - .0 - .unwrap(); - }) - } - - fn block_import_with_transaction_works(block_executor: F) - where - F: Fn(Block, &mut TestExternalities), - { - let mut b1 = Block { - header: Header { - parent_hash: [69u8; 32].into(), - number: 1, - state_root: Default::default(), - extrinsics_root: Default::default(), - digest: Default::default(), - }, - extrinsics: vec![Transfer { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Bob.into(), - amount: 69, - nonce: 0, - } - .into_signed_tx()], - }; - - let mut dummy_ext = new_test_ext(); - dummy_ext.execute_with(|| polish_block(&mut b1)); - - let mut b2 = Block { - header: Header { - parent_hash: b1.header.hash(), - number: 2, - state_root: Default::default(), - extrinsics_root: Default::default(), - digest: Default::default(), - }, - extrinsics: vec![ - Transfer { - from: AccountKeyring::Bob.into(), - to: AccountKeyring::Alice.into(), - amount: 27, - nonce: 0, - } - .into_signed_tx(), - Transfer { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Charlie.into(), - amount: 69, - nonce: 1, - } - .into_signed_tx(), - ], - }; - - dummy_ext.execute_with(|| polish_block(&mut b2)); - drop(dummy_ext); - - let mut t = new_test_ext(); - - t.execute_with(|| { - assert_eq!(balance_of(AccountKeyring::Alice.into()), 111); - assert_eq!(balance_of(AccountKeyring::Bob.into()), 0); - }); - - block_executor(b1, &mut t); - - t.execute_with(|| { - assert_eq!(balance_of(AccountKeyring::Alice.into()), 42); - assert_eq!(balance_of(AccountKeyring::Bob.into()), 69); - }); - - block_executor(b2, &mut t); - - t.execute_with(|| { - assert_eq!(balance_of(AccountKeyring::Alice.into()), 0); - assert_eq!(balance_of(AccountKeyring::Bob.into()), 42); - assert_eq!(balance_of(AccountKeyring::Charlie.into()), 69); - }); - } - - #[test] - fn block_import_with_transaction_works_native() { - block_import_with_transaction_works(|b, ext| { - ext.execute_with(|| { - execute_block(b); - }) - }); - } - - #[test] - fn block_import_with_transaction_works_wasm() { - block_import_with_transaction_works(|b, ext| { - let mut ext = ext.ext(); - let runtime_code = RuntimeCode { - code_fetcher: &sp_core::traits::WrappedRuntimeCode(wasm_binary_unwrap().into()), - hash: Vec::new(), - heap_pages: None, - }; - - executor() - .call( - &mut ext, - &runtime_code, - "Core_execute_block", - &b.encode(), - false, - CallContext::Offchain, - ) - .0 - .unwrap(); - }) - } -} From 54f844acca54ded172aac2eacf9d4d0d0fb8f588 Mon Sep 17 00:00:00 2001 From: GabrielMartinezRodriguez Date: Fri, 3 Nov 2023 14:12:36 +0100 Subject: [PATCH 07/37] chore: test compile --- pallets/custom-balances/src/mock.rs | 7 ++++++- pallets/custom-balances/src/tests.rs | 10 +++++---- pallets/dnt-fee-controller/src/mock.rs | 11 +++++++++- pallets/erc20-manager/src/mock.rs | 11 +++++++++- pallets/erc20-manager/src/tests.rs | 2 ++ pallets/sponsored-transactions/src/mock.rs | 20 ++++++++++++++++-- .../supported-tokens-manager/src/mock.rs | 6 +++++- .../user-fee-selector/src/mock.rs | 6 +++++- .../validator-fee-selector/src/mock.rs | 21 +++++++++++++++++-- pallets/upgrade-runtime-proposal/src/tests.rs | 16 +++++++------- pallets/zero-gas-transactions/src/mock.rs | 19 ++++++++++++++++- .../fee-rewards-vault-controller/src/mock.rs | 11 +++++++++- .../fee-rewards-vault-controller/src/tests.rs | 2 ++ .../fee-token-selector/src/mock.rs | 11 +++++++++- .../supported-tokens-manager/src/mock.rs | 10 ++++++++- .../supported-tokens-manager/src/tests.rs | 3 ++- .../validator-fee-selector/src/mock.rs | 11 +++++++++- .../validator-fee-selector/src/tests.rs | 1 + .../upgrade-runtime-controller/src/mock.rs | 11 +++++++++- .../upgrade-runtime-controller/src/tests.rs | 8 +++---- precompiles/utils/tests-external/lib.rs | 4 ++++ precompiles/validator-controller/src/mock.rs | 11 +++++++++- primitives/runner/src/mock.rs | 11 +++++++++- primitives/runner/src/tests.rs | 10 +++++++++ primitives/transaction-validator/src/mock.rs | 19 +++++++++++++++-- stability-rpc/src/mock.rs | 4 ++-- 26 files changed, 218 insertions(+), 38 deletions(-) diff --git a/pallets/custom-balances/src/mock.rs b/pallets/custom-balances/src/mock.rs index 00873631..d47f3cd3 100644 --- a/pallets/custom-balances/src/mock.rs +++ b/pallets/custom-balances/src/mock.rs @@ -64,12 +64,13 @@ impl pallet_timestamp::Config for Test { } parameter_types! { - pub const ExistentialDeposit: u128 = 0; + pub const ExistentialDeposit: u128 = 1; } parameter_types! { pub BlockGasLimit: U256 = U256::max_value(); pub const WeightPerGas: Weight = Weight::from_ref_time(1); + pub const GasLimitPovSizeRatio: u64 = 15; } impl pallet_evm_chain_id::Config for Test {} @@ -98,6 +99,10 @@ impl pallet_evm::Config for Test { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; + type Timestamp = Timestamp; + type WeightInfo = pallet_evm::weights::SubstrateWeight; } pub struct AccountIdToH160Mapping; diff --git a/pallets/custom-balances/src/tests.rs b/pallets/custom-balances/src/tests.rs index c0715eb6..a88ca5c1 100644 --- a/pallets/custom-balances/src/tests.rs +++ b/pallets/custom-balances/src/tests.rs @@ -403,7 +403,8 @@ fn inspect_reducible_balance_returns_actual_balance_for_zero_address() { assert_eq!( >::reducible_balance( &ZeroAddress::get().into(), - true + frame_support::traits::tokens::Preservation::Preserve, + frame_support::traits::tokens::Fortitude::Polite ), 1u128 ); @@ -418,7 +419,8 @@ fn inspect_reducible_balance_returns_actual_balance_for_one_address() { assert_eq!( >::reducible_balance( &OneAddress::get().into(), - true + frame_support::traits::tokens::Preservation::Preserve, + frame_support::traits::tokens::Fortitude::Polite ), 0u128 ); @@ -434,7 +436,7 @@ fn inspect_can_deposit_returns_error() { >::can_deposit( &OneAddress::get().into(), 10u128, - false + frame_support::traits::tokens::Provenance::Extant ), DepositConsequence::UnknownAsset ); @@ -451,7 +453,7 @@ fn inspect_can_withdraw_returns_error_when_not_enough_balance() { &ZeroAddress::get().into(), 10u128 ), - WithdrawConsequence::NoFunds + WithdrawConsequence::BalanceLow ); }); } diff --git a/pallets/dnt-fee-controller/src/mock.rs b/pallets/dnt-fee-controller/src/mock.rs index a0f9995d..e6f9afb5 100644 --- a/pallets/dnt-fee-controller/src/mock.rs +++ b/pallets/dnt-fee-controller/src/mock.rs @@ -77,7 +77,7 @@ impl pallet_timestamp::Config for Test { } parameter_types! { - pub const ExistentialDeposit: u128 = 0; + pub const ExistentialDeposit: u128 = 1; } impl pallet_balances::Config for Test { @@ -90,11 +90,16 @@ impl pallet_balances::Config for Test { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type MaxHolds = (); + type HoldIdentifier = (); + type FreezeIdentifier = (); + type MaxFreezes = (); } parameter_types! { pub BlockGasLimit: U256 = U256::max_value(); pub const WeightPerGas: Weight = Weight::from_ref_time(1); + pub const GasLimitPovSizeRatio: u64 = 15; } impl pallet_evm_chain_id::Config for Test {} @@ -116,6 +121,10 @@ impl pallet_evm::Config for Test { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; + type Timestamp = Timestamp; + type WeightInfo = pallet_evm::weights::SubstrateWeight; } impl pallet_fee_rewards_vault::Config for Test {} diff --git a/pallets/erc20-manager/src/mock.rs b/pallets/erc20-manager/src/mock.rs index 84a5fe0b..2dc54be0 100644 --- a/pallets/erc20-manager/src/mock.rs +++ b/pallets/erc20-manager/src/mock.rs @@ -77,7 +77,7 @@ impl pallet_timestamp::Config for Test { } parameter_types! { - pub const ExistentialDeposit: u128 = 0; + pub const ExistentialDeposit: u128 = 1; } impl pallet_balances::Config for Test { @@ -90,11 +90,16 @@ impl pallet_balances::Config for Test { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type MaxHolds = (); + type HoldIdentifier = (); + type FreezeIdentifier = (); + type MaxFreezes = (); } parameter_types! { pub BlockGasLimit: U256 = U256::max_value(); pub const WeightPerGas: Weight = Weight::from_ref_time(1); + pub const GasLimitPovSizeRatio: u64 = 15; } impl pallet_evm_chain_id::Config for Test {} @@ -116,6 +121,10 @@ impl pallet_evm::Config for Test { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; + type Timestamp = Timestamp; + type WeightInfo = pallet_evm::weights::SubstrateWeight; } parameter_types! { diff --git a/pallets/erc20-manager/src/tests.rs b/pallets/erc20-manager/src/tests.rs index c8d8d701..06f5afed 100644 --- a/pallets/erc20-manager/src/tests.rs +++ b/pallets/erc20-manager/src/tests.rs @@ -17,6 +17,8 @@ fn get_balance_of(erc20: H160, address: H160) -> U256 { Default::default(), false, false, + None, + None, &pallet_evm::EvmConfig::istanbul(), ) .unwrap() diff --git a/pallets/sponsored-transactions/src/mock.rs b/pallets/sponsored-transactions/src/mock.rs index be3497e2..3fcc8a8e 100644 --- a/pallets/sponsored-transactions/src/mock.rs +++ b/pallets/sponsored-transactions/src/mock.rs @@ -12,7 +12,7 @@ use frame_support::{ weights::Weight, }; use pallet_evm::{EnsureAddressNever, EnsureAddressRoot}; -use sp_core::{H160, H256, U256}; +use sp_core::{H160, H256, U256, ConstU32}; use sp_runtime::{ traits::{BlakeTwo256, IdentifyAccount, IdentityLookup, Verify}, MultiSignature, @@ -77,7 +77,7 @@ impl frame_system::Config for Runtime { } parameter_types! { - pub const ExistentialDeposit: u128 = 0; + pub const ExistentialDeposit: u128 = 1; } impl pallet_balances::Config for Runtime { @@ -90,6 +90,10 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type MaxHolds = (); + type HoldIdentifier = (); + type FreezeIdentifier = (); + type MaxFreezes = (); } parameter_types! { @@ -162,7 +166,9 @@ parameter_types! { parameter_types! { pub const ChainId: u64 = 20180428; + pub const GasLimitPovSizeRatio: u64 = 15; } + impl pallet_evm::Config for Runtime { type FeeCalculator = (); type GasWeightMapping = pallet_evm::FixedGasWeightMapping; @@ -180,12 +186,22 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; + type Timestamp = Timestamp; + type WeightInfo = pallet_evm::weights::SubstrateWeight; +} + +parameter_types! { + pub const PostBlockAndTxnHashes: pallet_ethereum::PostLogContent = pallet_ethereum::PostLogContent::BlockAndTxnHashes; } impl pallet_ethereum::Config for Runtime { type RuntimeEvent = RuntimeEvent; type StateRoot = (); + type PostLogContent = PostBlockAndTxnHashes; + type ExtraDataLength = ConstU32<30>; } pub struct MockPrefix; diff --git a/pallets/token-fee-controller/supported-tokens-manager/src/mock.rs b/pallets/token-fee-controller/supported-tokens-manager/src/mock.rs index 7d2b3e69..b17048a0 100644 --- a/pallets/token-fee-controller/supported-tokens-manager/src/mock.rs +++ b/pallets/token-fee-controller/supported-tokens-manager/src/mock.rs @@ -80,7 +80,7 @@ impl pallet_timestamp::Config for Runtime { } parameter_types! { - pub const ExistentialDeposit: u128 = 0; + pub const ExistentialDeposit: u128 = 1; } impl pallet_balances::Config for Runtime { @@ -93,6 +93,10 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type MaxHolds = (); + type HoldIdentifier = (); + type FreezeIdentifier = (); + type MaxFreezes = (); } parameter_types! { diff --git a/pallets/token-fee-controller/user-fee-selector/src/mock.rs b/pallets/token-fee-controller/user-fee-selector/src/mock.rs index c758fe0a..e78b9c19 100644 --- a/pallets/token-fee-controller/user-fee-selector/src/mock.rs +++ b/pallets/token-fee-controller/user-fee-selector/src/mock.rs @@ -80,7 +80,7 @@ impl pallet_timestamp::Config for Runtime { } parameter_types! { - pub const ExistentialDeposit: u128 = 0; + pub const ExistentialDeposit: u128 = 1; } impl pallet_balances::Config for Runtime { @@ -93,6 +93,10 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type MaxHolds = (); + type HoldIdentifier = (); + type FreezeIdentifier = (); + type MaxFreezes = (); } parameter_types! { diff --git a/pallets/token-fee-controller/validator-fee-selector/src/mock.rs b/pallets/token-fee-controller/validator-fee-selector/src/mock.rs index 96de3418..7cc78c81 100644 --- a/pallets/token-fee-controller/validator-fee-selector/src/mock.rs +++ b/pallets/token-fee-controller/validator-fee-selector/src/mock.rs @@ -29,7 +29,7 @@ use frame_support::{ }; use frame_system::{EnsureSigned, RawOrigin}; use pallet_evm::{EvmConfig, IdentityAddressMapping}; -use sp_core::{H160, H256}; +use sp_core::{H160, H256, ConstU32}; use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; use sp_std::vec; use std::collections::BTreeMap; @@ -84,7 +84,7 @@ impl pallet_timestamp::Config for Runtime { } parameter_types! { - pub const ExistentialDeposit: u128 = 0; + pub const ExistentialDeposit: u128 = 1; } impl pallet_balances::Config for Runtime { @@ -97,6 +97,10 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type MaxHolds = (); + type HoldIdentifier = (); + type FreezeIdentifier = (); + type MaxFreezes = (); } parameter_types! { @@ -184,7 +188,9 @@ parameter_types! { pub WeightPerGas : Weight = Weight::from_ref_time(1); pub EVMChainId: u64 = 1; pub BlockGasLimit: U256 = U256::MAX; + pub const GasLimitPovSizeRatio: u64 = 15; } + impl pallet_evm::Config for Runtime { type FeeCalculator = (); type GasWeightMapping = pallet_evm::FixedGasWeightMapping; @@ -201,7 +207,11 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type Runner = pallet_evm::runner::stack::Runner; type OnChargeTransaction = (); + type OnCreate = (); + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; + type Timestamp = Timestamp; type FindAuthor = (); + type WeightInfo = pallet_evm::weights::SubstrateWeight; fn config() -> &'static pallet_evm::EvmConfig { &LONDON_CONFIG @@ -214,9 +224,16 @@ impl pallet_root_controller::Config for Runtime { type RuntimeEvent = RuntimeEvent; } +parameter_types! { + pub const PostBlockAndTxnHashes: pallet_ethereum::PostLogContent = pallet_ethereum::PostLogContent::BlockAndTxnHashes; +} + + impl pallet_ethereum::Config for Runtime { type RuntimeEvent = RuntimeEvent; type StateRoot = pallet_ethereum::IntermediateStateRoot; + type PostLogContent = PostBlockAndTxnHashes; + type ExtraDataLength = ConstU32<30>; } // Configure a mock runtime to test the pallet. diff --git a/pallets/upgrade-runtime-proposal/src/tests.rs b/pallets/upgrade-runtime-proposal/src/tests.rs index 902ab6b0..c3f6f428 100644 --- a/pallets/upgrade-runtime-proposal/src/tests.rs +++ b/pallets/upgrade-runtime-proposal/src/tests.rs @@ -17,7 +17,7 @@ fn test_setup_works() { #[test] fn test_propose_code_works() { - let executor = substrate_test_runtime_client::new_native_executor(); + let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); let mut ext = new_test_ext(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); @@ -52,7 +52,7 @@ fn test_propose_code_fails_if_bad_origin() { #[test] fn test_propose_code_fails_if_there_are_already_a_proposed_code() { - let executor = substrate_test_runtime_client::new_native_executor(); + let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); let mut ext = new_test_ext(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); @@ -73,7 +73,7 @@ fn test_propose_code_fails_if_there_are_already_a_proposed_code() { #[test] fn test_propose_code_fails_invalid_proposed_code() { - let executor = substrate_test_runtime_client::new_native_executor(); + let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); let mut ext = new_test_ext(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); @@ -90,7 +90,7 @@ fn test_propose_code_fails_invalid_proposed_code() { #[test] fn test_set_block_application() { - let executor = substrate_test_runtime_client::new_native_executor(); + let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); let mut ext = new_test_ext(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); @@ -122,7 +122,7 @@ fn test_set_block_application_fails_if_bad_origin() { #[test] fn test_set_block_application_fails_block_is_older() { - let executor = substrate_test_runtime_client::new_native_executor(); + let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); let mut ext = new_test_ext(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); @@ -140,7 +140,7 @@ fn test_set_block_application_fails_block_is_older() { #[test] fn test_set_block_application_fails_if_not_proposed_code() { - let executor = substrate_test_runtime_client::new_native_executor(); + let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); let mut ext = new_test_ext(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); @@ -154,7 +154,7 @@ fn test_set_block_application_fails_if_not_proposed_code() { #[test] fn test_reject_proposed_code() { - let executor = substrate_test_runtime_client::new_native_executor(); + let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); let mut ext = new_test_ext(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); @@ -197,7 +197,7 @@ fn test_fails_reject_proposed_code_if_no_proposed_code() { #[test] fn test_scheduled_update_runtime() { - let executor = substrate_test_runtime_client::new_native_executor(); + let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); let mut ext = new_test_ext(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); diff --git a/pallets/zero-gas-transactions/src/mock.rs b/pallets/zero-gas-transactions/src/mock.rs index be3497e2..8464e838 100644 --- a/pallets/zero-gas-transactions/src/mock.rs +++ b/pallets/zero-gas-transactions/src/mock.rs @@ -77,7 +77,7 @@ impl frame_system::Config for Runtime { } parameter_types! { - pub const ExistentialDeposit: u128 = 0; + pub const ExistentialDeposit: u128 = 1; } impl pallet_balances::Config for Runtime { @@ -90,6 +90,10 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type MaxHolds = (); + type HoldIdentifier = (); + type FreezeIdentifier = (); + type MaxFreezes = (); } parameter_types! { @@ -162,7 +166,9 @@ parameter_types! { parameter_types! { pub const ChainId: u64 = 20180428; + pub const GasLimitPovSizeRatio: u64 = 15; } + impl pallet_evm::Config for Runtime { type FeeCalculator = (); type GasWeightMapping = pallet_evm::FixedGasWeightMapping; @@ -180,12 +186,23 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; + type Timestamp = Timestamp; + type WeightInfo = pallet_evm::weights::SubstrateWeight; + +} + +parameter_types! { + pub const PostBlockAndTxnHashes: pallet_ethereum::PostLogContent = pallet_ethereum::PostLogContent::BlockAndTxnHashes; } impl pallet_ethereum::Config for Runtime { type RuntimeEvent = RuntimeEvent; type StateRoot = (); + type PostLogContent = PostBlockAndTxnHashes; + type ExtraDataLength = ConstU32<30>; } pub struct MockPrefix; diff --git a/precompiles/fee-rewards-vault-controller/src/mock.rs b/precompiles/fee-rewards-vault-controller/src/mock.rs index 32e46c24..0602e9af 100644 --- a/precompiles/fee-rewards-vault-controller/src/mock.rs +++ b/precompiles/fee-rewards-vault-controller/src/mock.rs @@ -108,6 +108,7 @@ parameter_types! { pub BlockGasLimit: U256 = U256::max_value(); pub PrecompilesValue: Precompiles = Precompiles::new(); pub const WeightPerGas: Weight = Weight::from_ref_time(1); + pub const GasLimitPovSizeRatio: u64 = 15; } impl pallet_evm::Config for Test { @@ -127,10 +128,14 @@ impl pallet_evm::Config for Test { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; + type Timestamp = Timestamp; + type WeightInfo = pallet_evm::weights::SubstrateWeight; } parameter_types! { - pub const ExistentialDeposit: u128 = 0; + pub const ExistentialDeposit: u128 = 1; } pub type Balance = u128; @@ -145,6 +150,10 @@ impl pallet_balances::Config for Test { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type MaxHolds = (); + type HoldIdentifier = (); + type FreezeIdentifier = (); + type MaxFreezes = (); } impl pallet_fee_rewards_vault::Config for Test {} diff --git a/precompiles/fee-rewards-vault-controller/src/tests.rs b/precompiles/fee-rewards-vault-controller/src/tests.rs index e9e5159d..0460e191 100644 --- a/precompiles/fee-rewards-vault-controller/src/tests.rs +++ b/precompiles/fee-rewards-vault-controller/src/tests.rs @@ -1,5 +1,7 @@ use crate::{mock::*, *}; +use precompile_utils::prelude::*; + use precompile_utils::testing::*; use sha3::{Digest, Keccak256}; diff --git a/precompiles/token-fee-controller/fee-token-selector/src/mock.rs b/precompiles/token-fee-controller/fee-token-selector/src/mock.rs index d4beb0b1..efe8d93a 100644 --- a/precompiles/token-fee-controller/fee-token-selector/src/mock.rs +++ b/precompiles/token-fee-controller/fee-token-selector/src/mock.rs @@ -76,7 +76,7 @@ impl pallet_timestamp::Config for Runtime { } parameter_types! { - pub const ExistentialDeposit: u128 = 0; + pub const ExistentialDeposit: u128 = 1; } impl pallet_balances::Config for Runtime { @@ -89,6 +89,10 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type MaxHolds = (); + type HoldIdentifier = (); + type FreezeIdentifier = (); + type MaxFreezes = (); } parameter_types! { @@ -172,6 +176,7 @@ parameter_types! { pub BlockGasLimit: U256 = U256::max_value(); pub PrecompilesValue: Precompiles = Precompiles::new(); pub const WeightPerGas: Weight = Weight::from_ref_time(1); + pub const GasLimitPovSizeRatio: u64 = 15; } impl pallet_evm::Config for Runtime { @@ -191,6 +196,10 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; + type Timestamp = Timestamp; + type WeightInfo = pallet_evm::weights::SubstrateWeight; } // Configure a mock runtime to test the pallet. diff --git a/precompiles/token-fee-controller/supported-tokens-manager/src/mock.rs b/precompiles/token-fee-controller/supported-tokens-manager/src/mock.rs index 83c408f2..00d8f5ce 100644 --- a/precompiles/token-fee-controller/supported-tokens-manager/src/mock.rs +++ b/precompiles/token-fee-controller/supported-tokens-manager/src/mock.rs @@ -78,7 +78,7 @@ impl pallet_timestamp::Config for Runtime { } parameter_types! { - pub const ExistentialDeposit: u128 = 0; + pub const ExistentialDeposit: u128 = 1; } impl pallet_balances::Config for Runtime { @@ -91,6 +91,10 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type MaxHolds = (); + type HoldIdentifier = (); + type FreezeIdentifier = (); + type MaxFreezes = (); } parameter_types! { @@ -125,6 +129,7 @@ parameter_types! { pub BlockGasLimit: U256 = U256::max_value(); pub PrecompilesValue: Precompiles = Precompiles::new(); pub const WeightPerGas: Weight = Weight::from_ref_time(1); + pub const GasLimitPovSizeRatio: u64 = 15; } impl pallet_evm::Config for Runtime { @@ -145,6 +150,9 @@ impl pallet_evm::Config for Runtime { type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); type OnCreate = (); + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; + type Timestamp = Timestamp; + type WeightInfo = pallet_evm::weights::SubstrateWeight; } // Configure a mock runtime to test the pallet. diff --git a/precompiles/token-fee-controller/supported-tokens-manager/src/tests.rs b/precompiles/token-fee-controller/supported-tokens-manager/src/tests.rs index 8788abdb..bb423ce8 100644 --- a/precompiles/token-fee-controller/supported-tokens-manager/src/tests.rs +++ b/precompiles/token-fee-controller/supported-tokens-manager/src/tests.rs @@ -6,6 +6,7 @@ use precompile_utils::{ prelude::{log1, Address}, testing::{Precompile1, PrecompileTesterExt}, }; +use precompile_utils::prelude::*; use sp_core::{H160, H256}; use crate::{ @@ -318,7 +319,7 @@ fn update_default_controller() { token: MeaninglessTokenAddress::get().into(), }, ) - .execute_returns(Default::default()); + .execute_returns(()); }) } diff --git a/precompiles/token-fee-controller/validator-fee-selector/src/mock.rs b/precompiles/token-fee-controller/validator-fee-selector/src/mock.rs index dd5e4529..8925c9f3 100644 --- a/precompiles/token-fee-controller/validator-fee-selector/src/mock.rs +++ b/precompiles/token-fee-controller/validator-fee-selector/src/mock.rs @@ -101,7 +101,7 @@ impl pallet_timestamp::Config for Runtime { } parameter_types! { - pub const ExistentialDeposit: u128 = 0; + pub const ExistentialDeposit: u128 = 1; } impl pallet_balances::Config for Runtime { @@ -114,6 +114,10 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type MaxHolds = (); + type HoldIdentifier = (); + type FreezeIdentifier = (); + type MaxFreezes = (); } parameter_types! { @@ -185,6 +189,7 @@ parameter_types! { pub BlockGasLimit: U256 = U256::max_value(); pub PrecompilesValue: Precompiles = Precompiles::new(); pub const WeightPerGas: Weight = Weight::from_ref_time(1); + pub const GasLimitPovSizeRatio: u64 = 15; } impl pallet_evm::Config for Runtime { @@ -204,6 +209,10 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; + type Timestamp = Timestamp; + type WeightInfo = pallet_evm::weights::SubstrateWeight; } pub struct TestSessionHandler; diff --git a/precompiles/token-fee-controller/validator-fee-selector/src/tests.rs b/precompiles/token-fee-controller/validator-fee-selector/src/tests.rs index 705f92fd..b8be3d36 100644 --- a/precompiles/token-fee-controller/validator-fee-selector/src/tests.rs +++ b/precompiles/token-fee-controller/validator-fee-selector/src/tests.rs @@ -3,6 +3,7 @@ use precompile_utils::{ testing::{CryptoAlith, Precompile1, PrecompileTesterExt}, }; use sp_core::{H160, H256}; +use precompile_utils::prelude::*; use crate::{ mock::{ diff --git a/precompiles/upgrade-runtime-controller/src/mock.rs b/precompiles/upgrade-runtime-controller/src/mock.rs index d54d40c3..dc768512 100644 --- a/precompiles/upgrade-runtime-controller/src/mock.rs +++ b/precompiles/upgrade-runtime-controller/src/mock.rs @@ -108,6 +108,7 @@ parameter_types! { pub BlockGasLimit: U256 = U256::max_value(); pub PrecompilesValue: Precompiles = Precompiles::new(); pub const WeightPerGas: Weight = Weight::from_ref_time(1); + pub const GasLimitPovSizeRatio: u64 = 15; } impl pallet_evm::Config for Test { @@ -127,10 +128,14 @@ impl pallet_evm::Config for Test { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; + type Timestamp = Timestamp; + type WeightInfo = pallet_evm::weights::SubstrateWeight; } parameter_types! { - pub const ExistentialDeposit: u128 = 0; + pub const ExistentialDeposit: u128 = 1; } pub type Balance = u128; @@ -145,6 +150,10 @@ impl pallet_balances::Config for Test { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type MaxHolds = (); + type HoldIdentifier = (); + type FreezeIdentifier = (); + type MaxFreezes = (); } frame_support::construct_runtime!( diff --git a/precompiles/upgrade-runtime-controller/src/tests.rs b/precompiles/upgrade-runtime-controller/src/tests.rs index acee9348..da3d17e6 100644 --- a/precompiles/upgrade-runtime-controller/src/tests.rs +++ b/precompiles/upgrade-runtime-controller/src/tests.rs @@ -157,7 +157,7 @@ fn claim_ownership_if_claimable() { #[test] fn test_set_block_application() { - let executor = substrate_test_runtime_client::new_native_executor(); + let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); let mut ext = ExtBuilder::default().build(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); @@ -190,7 +190,7 @@ fn test_set_block_application() { #[test] fn test_fail_set_block_application_if_not_owner() { - let executor = substrate_test_runtime_client::new_native_executor(); + let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); let mut ext = ExtBuilder::default().build(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); @@ -216,7 +216,7 @@ fn test_fail_set_block_application_if_not_owner() { #[test] fn test_reject_proposed_code() { - let executor = substrate_test_runtime_client::new_native_executor(); + let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); let mut ext = ExtBuilder::default().build(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); @@ -246,7 +246,7 @@ fn test_reject_proposed_code() { #[test] fn test_fail_reject_proposed_code_if_not_owner() { - let executor = substrate_test_runtime_client::new_native_executor(); + let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); let mut ext = ExtBuilder::default().build(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); diff --git a/precompiles/utils/tests-external/lib.rs b/precompiles/utils/tests-external/lib.rs index a5b9ed25..5537e534 100644 --- a/precompiles/utils/tests-external/lib.rs +++ b/precompiles/utils/tests-external/lib.rs @@ -104,6 +104,10 @@ mod tests { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type MaxHolds = (); + type HoldIdentifier = (); + type FreezeIdentifier = (); + type MaxFreezes = (); } #[derive(Debug, Clone)] diff --git a/precompiles/validator-controller/src/mock.rs b/precompiles/validator-controller/src/mock.rs index 9f1575e9..7c9bc716 100644 --- a/precompiles/validator-controller/src/mock.rs +++ b/precompiles/validator-controller/src/mock.rs @@ -119,7 +119,7 @@ impl pallet_timestamp::Config for Runtime { } parameter_types! { - pub const ExistentialDeposit: u128 = 0; + pub const ExistentialDeposit: u128 = 1; } impl pallet_balances::Config for Runtime { @@ -132,12 +132,17 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type MaxHolds = (); + type HoldIdentifier = (); + type FreezeIdentifier = (); + type MaxFreezes = (); } parameter_types! { pub BlockGasLimit: U256 = U256::max_value(); pub PrecompilesValue: Precompiles = Precompiles::new(); pub const WeightPerGas: Weight = Weight::from_ref_time(1); + pub const GasLimitPovSizeRatio: u64 = 15; } pub struct IdentityAddressMapping; @@ -190,6 +195,10 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; + type Timestamp = Timestamp; + type WeightInfo = pallet_evm::weights::SubstrateWeight; } impl frame_system::offchain::SendTransactionTypes for Runtime diff --git a/primitives/runner/src/mock.rs b/primitives/runner/src/mock.rs index 8878cb31..25d07bc0 100644 --- a/primitives/runner/src/mock.rs +++ b/primitives/runner/src/mock.rs @@ -94,7 +94,7 @@ impl frame_system::Config for Runtime { } parameter_types! { - pub const ExistentialDeposit: u128 = 0; + pub const ExistentialDeposit: u128 = 1; } impl pallet_balances::Config for Runtime { @@ -107,6 +107,10 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type MaxHolds = (); + type HoldIdentifier = (); + type FreezeIdentifier = (); + type MaxFreezes = (); } parameter_types! { @@ -175,6 +179,7 @@ parameter_types! { pub const WeightPerGas: Weight = Weight::from_ref_time(1); pub ERC20SlotZero: H160 = H160::from_str("0x22D598E0a9a1b474CdC7c6fBeA0B4F83E12046a9").unwrap(); pub ZeroSlot : H256 = H256::from_low_u64_be(0); + pub const GasLimitPovSizeRatio: u64 = 15; } impl pallet_evm::Config for Runtime { @@ -194,6 +199,10 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; + type Timestamp = Timestamp; + type WeightInfo = pallet_evm::weights::SubstrateWeight; } // Configure a mock runtime to test the pallet. diff --git a/primitives/runner/src/tests.rs b/primitives/runner/src/tests.rs index dc654eff..0e9f1bf5 100644 --- a/primitives/runner/src/tests.rs +++ b/primitives/runner/src/tests.rs @@ -30,6 +30,8 @@ fn test_forwards_a_call_op() { vec![], false, false, + None, + None, &config, ); let account_id = pallet_evm::HashedAddressMapping::::into_account_id(acc); @@ -59,6 +61,8 @@ fn test_sends_users_token_on_call() { vec![], false, false, + None, + None, &config, ); assert!(res.is_ok()); @@ -80,6 +84,8 @@ fn test_sends_users_token_on_call() { vec![], false, false, + None, + None, &config, ); assert!(target.is_ok()); @@ -113,6 +119,8 @@ fn test_forwards_a_create_op() { vec![], false, true, + None, + None, &config ); let account_id = pallet_evm::HashedAddressMapping::::into_account_id(acc); @@ -142,6 +150,8 @@ fn transaction_fee_log_emitted() { vec![], false, false, + None, + None, &config, ); diff --git a/primitives/transaction-validator/src/mock.rs b/primitives/transaction-validator/src/mock.rs index 026a4e91..6cbb73f6 100644 --- a/primitives/transaction-validator/src/mock.rs +++ b/primitives/transaction-validator/src/mock.rs @@ -27,7 +27,7 @@ use frame_support::{ }; use hex::FromHex; use pallet_evm::{EnsureAddressNever, EnsureAddressRoot}; -use sp_core::{H160, H256, U256}; +use sp_core::{H160, H256, U256, ConstU32}; use sp_runtime::{ traits::{BlakeTwo256, IdentifyAccount, IdentityLookup, Verify}, MultiSignature, @@ -92,7 +92,7 @@ impl frame_system::Config for Runtime { } parameter_types! { - pub const ExistentialDeposit: u128 = 0; + pub const ExistentialDeposit: u128 = 1; } parameter_types! { @@ -111,6 +111,7 @@ parameter_types! { pub const WeightPerGas: Weight = Weight::from_ref_time(1); pub ERC20SlotZero: H160 = H160::from_str("0x22D598E0a9a1b474CdC7c6fBeA0B4F83E12046a9").unwrap(); pub ZeroSlot : H256 = H256::from_low_u64_be(0); + pub const GasLimitPovSizeRatio: u64 = 15; } pub struct FixedBaseFee; impl FeeCalculator for FixedBaseFee { @@ -138,6 +139,10 @@ impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type OnCreate = (); + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; + type Timestamp = Timestamp; + type WeightInfo = pallet_evm::weights::SubstrateWeight; } impl pallet_balances::Config for Runtime { @@ -150,11 +155,21 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type MaxHolds = (); + type HoldIdentifier = (); + type FreezeIdentifier = (); + type MaxFreezes = (); +} + +parameter_types! { + pub const PostBlockAndTxnHashes: pallet_ethereum::PostLogContent = pallet_ethereum::PostLogContent::BlockAndTxnHashes; } impl pallet_ethereum::Config for Runtime { type RuntimeEvent = RuntimeEvent; type StateRoot = pallet_ethereum::IntermediateStateRoot; + type PostLogContent = PostBlockAndTxnHashes; + type ExtraDataLength = ConstU32<30>; } // Configure a mock runtime to test the pallet. diff --git a/stability-rpc/src/mock.rs b/stability-rpc/src/mock.rs index 04cd30a9..72bdc731 100644 --- a/stability-rpc/src/mock.rs +++ b/stability-rpc/src/mock.rs @@ -182,7 +182,7 @@ impl sc_service::TransactionPool for MockedMempool { impl HeaderBackend for TestApi { fn header( &self, - _id: BlockId, + _id: Block::Hash, ) -> std::result::Result, sp_blockchain::Error> { Ok(None) } @@ -202,7 +202,7 @@ impl HeaderBackend for TestApi { fn status( &self, - _id: BlockId, + _id: Block::Hash, ) -> std::result::Result { Ok(sc_client_api::blockchain::BlockStatus::Unknown) } From ccfede99d1ff23f45ec7dbc6247cb3288ec17aa3 Mon Sep 17 00:00:00 2001 From: GabrielMartinezRodriguez Date: Mon, 6 Nov 2023 15:44:24 +0100 Subject: [PATCH 08/37] fix: tests --- .../fee-rewards-vault-controller/Cargo.toml | 2 +- .../fee-rewards-vault-controller/src/mock.rs | 11 +++- .../fee-rewards-vault-controller/src/tests.rs | 10 ++-- precompiles/utils/src/precompile_set.rs | 57 +------------------ precompiles/utils/src/testing/execution.rs | 24 -------- precompiles/utils/src/testing/handle.rs | 5 +- 6 files changed, 19 insertions(+), 90 deletions(-) diff --git a/precompiles/fee-rewards-vault-controller/Cargo.toml b/precompiles/fee-rewards-vault-controller/Cargo.toml index 47894e1b..fc38dca9 100644 --- a/precompiles/fee-rewards-vault-controller/Cargo.toml +++ b/precompiles/fee-rewards-vault-controller/Cargo.toml @@ -30,7 +30,7 @@ pallet-supported-tokens-manager = { workspace = true } pallet-validator-fee-selector = { workspace = true } pallet-user-fee-selector = { workspace = true } pallet-validator-set = { workspace = true } - +sp-io = { workspace = true } [dev-dependencies] hex = { workspace = true } pallet-balances = { workspace = true } diff --git a/precompiles/fee-rewards-vault-controller/src/mock.rs b/precompiles/fee-rewards-vault-controller/src/mock.rs index 0602e9af..9eb2393d 100644 --- a/precompiles/fee-rewards-vault-controller/src/mock.rs +++ b/precompiles/fee-rewards-vault-controller/src/mock.rs @@ -104,11 +104,16 @@ impl AddressMapping for NumberAddressMapping { } } +const MAX_POV_SIZE: u64 = 5 * 1024 * 1024; + parameter_types! { - pub BlockGasLimit: U256 = U256::max_value(); + pub BlockGasLimit: U256 = U256::from(u64::MAX); pub PrecompilesValue: Precompiles = Precompiles::new(); - pub const WeightPerGas: Weight = Weight::from_ref_time(1); - pub const GasLimitPovSizeRatio: u64 = 15; + pub const WeightPerGas: Weight = Weight::from_parts(1, 0); + pub GasLimitPovSizeRatio: u64 = { + let block_gas_limit = BlockGasLimit::get().min(u64::MAX.into()).low_u64(); + block_gas_limit.saturating_div(MAX_POV_SIZE) + }; } impl pallet_evm::Config for Test { diff --git a/precompiles/fee-rewards-vault-controller/src/tests.rs b/precompiles/fee-rewards-vault-controller/src/tests.rs index 0460e191..3ef00016 100644 --- a/precompiles/fee-rewards-vault-controller/src/tests.rs +++ b/precompiles/fee-rewards-vault-controller/src/tests.rs @@ -9,6 +9,7 @@ fn precompiles() -> Precompiles { PrecompilesValue::get() } + #[test] fn selectors() { assert!(PCall::owner_selectors().contains(&0x8da5cb5b)); @@ -349,10 +350,9 @@ fn test_can_claim_reward_should_return_true_if_claimant_are_the_owner_of_the_dap output.extend_from_slice(&OwnerOfDapp::get().as_bytes()); SubcallOutput { - reason: ExitReason::Succeed(ExitSucceed::Returned), output: output, cost: 1, - logs: vec![], + ..SubcallOutput::succeed() } }) .execute_returns(true); @@ -403,10 +403,9 @@ fn test_can_claim_reward_should_return_false_if_claimant_are_not_the_owner_of_th output.extend_from_slice(&OwnerOfDapp::get().as_bytes()); SubcallOutput { - reason: ExitReason::Succeed(ExitSucceed::Returned), output: output, cost: 1, - logs: vec![], + ..SubcallOutput::succeed() } }) .execute_returns(false); @@ -542,10 +541,9 @@ fn test_claim_reward() { let output = vec![]; SubcallOutput { - reason: ExitReason::Succeed(ExitSucceed::Returned), output: output, cost: 1, - logs: vec![], + ..SubcallOutput::succeed() } }) .expect_log(log3( diff --git a/precompiles/utils/src/precompile_set.rs b/precompiles/utils/src/precompile_set.rs index 758b5ae2..344e163d 100644 --- a/precompiles/utils/src/precompile_set.rs +++ b/precompiles/utils/src/precompile_set.rs @@ -352,44 +352,6 @@ fn is_address_eoa_or_precompile( } } -/// Common checks for precompile and precompile sets. -/// Don't contain recursion check as precompile sets have recursion check for each member. -fn common_checks( - handle: &mut impl PrecompileHandle, -) -> EvmResult<()> { - let code_address = handle.code_address(); - let caller = handle.context().caller; - - // Check DELEGATECALL config. - let accept_delegate_call = C::accept_delegate_call().unwrap_or(false); - if !accept_delegate_call && code_address != handle.context().address { - return Err(revert("Cannot be called with DELEGATECALL or CALLCODE")); - } - - // Extract which selector is called. - let selector = handle.input().get(0..4).map(|bytes| { - let mut buffer = [0u8; 4]; - buffer.copy_from_slice(bytes); - u32::from_be_bytes(buffer) - }); - - // Is this selector callable from a smart contract? - let callable_by_smart_contract = - C::callable_by_smart_contract(caller, selector).unwrap_or(false); - if !callable_by_smart_contract { - if !is_address_eoa_or_precompile::(handle, caller)? { - return Err(revert("Function not callable by smart contracts")); - } - } - - // Is this selector callable from a precompile? - let callable_by_precompile = C::callable_by_precompile(caller, selector).unwrap_or(false); - if !callable_by_precompile && is_precompile_or_fail::(caller, handle.remaining_gas())? { - return Err(revert("Function not callable by precompiles")); - } - - Ok(()) -} pub fn is_precompile_or_fail(address: H160, gas: u64) -> EvmResult { match ::PrecompilesValue::get().is_precompile(address, gas) { @@ -555,10 +517,6 @@ where return None; } - // Perform common checks. - if let Err(err) = common_checks::(handle) { - return Some(Err(err)); - } // Check and increase recursion level if needed. let recursion_limit = C::recursion_limit().unwrap_or(Some(0)); @@ -580,10 +538,9 @@ where } // Subcall protection. - let allow_subcalls = C::allow_subcalls().unwrap_or(false); let mut handle = RestrictiveHandle { handle, - allow_subcalls, + allow_subcalls: true, }; let res = P::execute(&mut handle); @@ -678,10 +635,6 @@ where if !is_precompile_or_fail::(code_address, handle.remaining_gas()).ok()? { return None; } - // Perform common checks. - if let Err(err) = common_checks::(handle) { - return Some(Err(err)); - } // Check and increase recursion level if needed. let recursion_limit = C::recursion_limit().unwrap_or(Some(0)); @@ -1085,12 +1038,8 @@ impl PrecompileSetBuilder } /// Return the list of addresses contained in this PrecompileSet. - pub fn used_addresses() -> impl Iterator { - Self::new() - .inner - .used_addresses() - .into_iter() - .map(|x| R::AddressMapping::into_account_id(x)) + pub fn used_addresses() -> impl Iterator { + Self::new().inner.used_addresses().into_iter() } pub fn summarize_checks(&self) -> Vec { diff --git a/precompiles/utils/src/testing/execution.rs b/precompiles/utils/src/testing/execution.rs index 8e45aaa7..ae9f0ff2 100644 --- a/precompiles/utils/src/testing/execution.rs +++ b/precompiles/utils/src/testing/execution.rs @@ -159,14 +159,6 @@ impl<'p, P: PrecompileSet> PrecompilesTester<'p, P> { match res { Some(Err(PrecompileFailure::Revert { output, .. })) => { let decoded = decode_revert_message(&output); - eprintln!( - "Revert message (bytes): {:?}", - sp_core::hexdisplay::HexDisplay::from(&decoded) - ); - eprintln!( - "Revert message (string): {:?}", - core::str::from_utf8(decoded).ok() - ); panic!("Shouldn't have reverted"); } Some(Ok(PrecompileOutput { @@ -174,14 +166,6 @@ impl<'p, P: PrecompileSet> PrecompilesTester<'p, P> { output: execution_output, })) => { if execution_output != output { - eprintln!( - "Output (bytes): {:?}", - sp_core::hexdisplay::HexDisplay::from(&execution_output) - ); - eprintln!( - "Output (string): {:?}", - core::str::from_utf8(&execution_output).ok() - ); panic!("Output doesn't match"); } } @@ -205,14 +189,6 @@ impl<'p, P: PrecompileSet> PrecompilesTester<'p, P> { Some(Err(PrecompileFailure::Revert { output, .. })) => { let decoded = decode_revert_message(&output); if !check(decoded) { - eprintln!( - "Revert message (bytes): {:?}", - sp_core::hexdisplay::HexDisplay::from(&decoded) - ); - eprintln!( - "Revert message (string): {:?}", - core::str::from_utf8(decoded).ok() - ); panic!("Revert reason doesn't match !"); } } diff --git a/precompiles/utils/src/testing/handle.rs b/precompiles/utils/src/testing/handle.rs index 45291410..6962342b 100644 --- a/precompiles/utils/src/testing/handle.rs +++ b/precompiles/utils/src/testing/handle.rs @@ -148,10 +148,11 @@ impl PrecompileHandle for MockHandle { self.log(log.address, log.topics, log.data) .expect("cannot fail"); } - (reason, output) } - None => panic!("no subcall handle registered"), + None => { + panic!("no subcall handle registered"); + } } } From 8653fe7ae75604a9a5ad5387089319349874181d Mon Sep 17 00:00:00 2001 From: GabrielMartinezRodriguez Date: Wed, 8 Nov 2023 17:00:33 +0100 Subject: [PATCH 09/37] chore: added test for authorship and test utils --- Cargo.lock | 253 ++-- Cargo.toml | 20 +- client/authorship/Cargo.toml | 1 + client/authorship/src/authorship.rs | 651 +++++++++ pallets/upgrade-runtime-proposal/Cargo.toml | 2 +- pallets/upgrade-runtime-proposal/src/tests.rs | 30 +- .../fee-rewards-vault-controller/Cargo.toml | 2 +- .../upgrade-runtime-controller/Cargo.toml | 2 +- .../upgrade-runtime-controller/src/tests.rs | 18 +- precompiles/utils/Cargo.toml | 2 +- precompiles/utils/macro/src/derive_codec.rs | 8 +- .../macro/src/generate_function_selector.rs | 8 +- precompiles/utils/macro/src/lib.rs | 8 +- .../utils/macro/src/precompile/attr.rs | 8 +- .../utils/macro/src/precompile/expand.rs | 8 +- precompiles/utils/macro/src/precompile/mod.rs | 8 +- .../utils/macro/src/precompile/parse.rs | 8 +- .../macro/src/precompile_name_from_address.rs | 8 +- .../compile-fail/derive_codec/empty_struct.rs | 8 +- .../tests/compile-fail/derive_codec/enum.rs | 8 +- .../precompile/codec/arg-dont-impl-codec.rs | 8 +- .../precompile/codec/no-output.rs | 8 +- .../codec/output-dont-impl-codec.rs | 8 +- .../precompile/codec/output-not-result.rs | 8 +- .../codec/output-wrong-error-result.rs | 8 +- .../discriminant/dont-return-option.rs | 8 +- .../precompile/discriminant/missing-fn.rs | 8 +- .../precompile/discriminant/missing-param.rs | 8 +- .../discriminant/return-incomplete-option.rs | 8 +- .../discriminant/too-many-arguments.rs | 8 +- .../discriminant/type-mismatch-1.rs | 8 +- .../discriminant/type-mismatch-2.rs | 8 +- .../fn-modifiers/discriminant-multiple.rs | 8 +- .../fn-modifiers/multiple-modifiers.rs | 8 +- .../fn-modifiers/pre-check-multiple.rs | 8 +- .../compile-fail/precompile/handle/missing.rs | 8 +- .../precompile/handle/set-missing.rs | 8 +- .../precompile/handle/set-wrong-type.rs | 8 +- .../precompile/handle/wrong-type.rs | 8 +- .../precompile/pre-check/no-parameter.rs | 8 +- .../pre-check/too-many-parameters.rs | 8 +- .../precompile/pre-check/wrong-parameter.rs | 8 +- .../precompile/test-gen/generic-arg.rs | 8 +- .../compile-fail/precompile_name/not_tuple.rs | 8 +- .../utils/macro/tests/expand/precompile.rs | 8 +- .../macro/tests/expand/precompile_name.rs | 8 +- .../utils/macro/tests/expand/precompileset.rs | 8 +- .../utils/macro/tests/expand/returns_tuple.rs | 8 +- .../utils/macro/tests/pass/derive_codec.rs | 8 +- .../tests/pass/precompile_fn_modifiers.rs | 6 +- precompiles/utils/macro/tests/tests.rs | 8 +- precompiles/utils/src/evm/costs.rs | 8 +- precompiles/utils/src/evm/handle.rs | 8 +- precompiles/utils/src/evm/logs.rs | 8 +- precompiles/utils/src/evm/mod.rs | 8 +- precompiles/utils/src/lib.rs | 8 +- precompiles/utils/src/precompile_set.rs | 8 +- precompiles/utils/src/solidity/codec/bytes.rs | 8 +- precompiles/utils/src/solidity/codec/mod.rs | 8 +- .../utils/src/solidity/codec/native.rs | 8 +- precompiles/utils/src/solidity/codec/xcm.rs | 8 +- precompiles/utils/src/solidity/mod.rs | 8 +- precompiles/utils/src/solidity/modifier.rs | 8 +- precompiles/utils/src/solidity/revert.rs | 8 +- precompiles/utils/src/substrate.rs | 8 +- precompiles/utils/src/testing/account.rs | 8 +- precompiles/utils/src/testing/execution.rs | 8 +- precompiles/utils/src/testing/handle.rs | 8 +- precompiles/utils/src/testing/mod.rs | 8 +- precompiles/utils/src/testing/modifier.rs | 8 +- precompiles/utils/src/testing/solidity.rs | 8 +- precompiles/utils/src/tests.rs | 8 +- precompiles/utils/tests-external/lib.rs | 8 +- stability-rpc/Cargo.toml | 2 +- stability-rpc/src/mock.rs | 2 +- stability-rpc/src/tests.rs | 2 +- test-utils/stability-client/Cargo.toml | 36 + test-utils/stability-client/src/client_ext.rs | 209 +++ test-utils/stability-client/src/lib.rs | 476 +++++++ test-utils/stability-debug-derive/Cargo.toml | 29 + .../stability-debug-derive/src/impls.rs | 187 +++ test-utils/stability-debug-derive/src/lib.rs | 42 + .../stability-debug-derive/tests/tests.rs | 48 + test-utils/stability-root-testing/Cargo.toml | 31 + test-utils/stability-root-testing/README.md | 5 + test-utils/stability-root-testing/src/lib.rs | 54 + .../stability-runtime-client/Cargo.toml | 25 + .../src/block_builder_ext.rs | 80 ++ .../stability-runtime-client/src/lib.rs | 244 ++++ .../src/trait_tests.rs | 421 ++++++ test-utils/stability-runtime/Cargo.toml | 118 ++ test-utils/stability-runtime/build.rs | 42 + test-utils/stability-runtime/src/extrinsic.rs | 207 +++ .../stability-runtime/src/genesismap.rs | 172 +++ test-utils/stability-runtime/src/lib.rs | 1197 +++++++++++++++++ .../src/substrate_test_pallet.rs | 250 ++++ test-utils/stability-tracing/Cargo.toml | 35 + test-utils/stability-tracing/README.md | 15 + test-utils/stability-tracing/src/lib.rs | 252 ++++ test-utils/stability-tracing/src/types.rs | 669 +++++++++ 100 files changed, 5936 insertions(+), 397 deletions(-) create mode 100644 test-utils/stability-client/Cargo.toml create mode 100644 test-utils/stability-client/src/client_ext.rs create mode 100644 test-utils/stability-client/src/lib.rs create mode 100644 test-utils/stability-debug-derive/Cargo.toml create mode 100644 test-utils/stability-debug-derive/src/impls.rs create mode 100644 test-utils/stability-debug-derive/src/lib.rs create mode 100644 test-utils/stability-debug-derive/tests/tests.rs create mode 100644 test-utils/stability-root-testing/Cargo.toml create mode 100644 test-utils/stability-root-testing/README.md create mode 100644 test-utils/stability-root-testing/src/lib.rs create mode 100644 test-utils/stability-runtime-client/Cargo.toml create mode 100644 test-utils/stability-runtime-client/src/block_builder_ext.rs create mode 100644 test-utils/stability-runtime-client/src/lib.rs create mode 100644 test-utils/stability-runtime-client/src/trait_tests.rs create mode 100644 test-utils/stability-runtime/Cargo.toml create mode 100644 test-utils/stability-runtime/build.rs create mode 100644 test-utils/stability-runtime/src/extrinsic.rs create mode 100644 test-utils/stability-runtime/src/genesismap.rs create mode 100644 test-utils/stability-runtime/src/lib.rs create mode 100644 test-utils/stability-runtime/src/substrate_test_pallet.rs create mode 100644 test-utils/stability-tracing/Cargo.toml create mode 100644 test-utils/stability-tracing/README.md create mode 100644 test-utils/stability-tracing/src/lib.rs create mode 100644 test-utils/stability-tracing/src/types.rs diff --git a/Cargo.lock b/Cargo.lock index fe7e2c05..11bf6dd1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5727,21 +5727,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "pallet-root-testing" -version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - [[package]] name = "pallet-session" version = "4.0.0-dev" @@ -5901,8 +5886,8 @@ dependencies = [ "sp-runtime", "sp-std", "sp-version", + "stability-test-runtime-client", "stbl-tools", - "substrate-test-runtime-client", "syn 1.0.109", ] @@ -6418,8 +6403,8 @@ dependencies = [ "sp-staking", "sp-std", "sp-version", + "stability-test-runtime-client", "stbl-tools", - "substrate-test-runtime-client", ] [[package]] @@ -6504,7 +6489,7 @@ dependencies = [ "sp-runtime", "sp-std", "sp-version", - "substrate-test-runtime-client", + "stability-test-runtime-client", ] [[package]] @@ -10004,6 +9989,20 @@ dependencies = [ "substrate-prometheus-endpoint", ] +[[package]] +name = "stability-pallet-root-testing" +version = "1.0.0-dev" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "stability-rpc" version = "0.1.0" @@ -10030,8 +10029,8 @@ dependencies = [ "sp-core", "sp-runtime", "stability-rpc-api", + "stability-test-runtime-client", "stbl-primitives-zero-gas-transactions-api", - "substrate-test-runtime-client", "tokio", ] @@ -10129,6 +10128,127 @@ dependencies = [ "substrate-wasm-builder", ] +[[package]] +name = "stability-sp-debug-derive" +version = "5.0.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "stability-sp-tracing" +version = "6.0.0" +dependencies = [ + "parity-scale-codec", + "sp-std", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "stability-test-client" +version = "2.0.1" +dependencies = [ + "array-bytes 6.1.0", + "async-trait", + "futures", + "parity-scale-codec", + "sc-client-api", + "sc-client-db", + "sc-consensus", + "sc-executor", + "sc-offchain", + "sc-service", + "serde", + "serde_json", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-keyring", + "sp-keystore", + "sp-runtime", + "sp-state-machine", +] + +[[package]] +name = "stability-test-runtime" +version = "1.0.0" +dependencies = [ + "array-bytes 6.1.0", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-rpc-runtime-api", + "futures", + "log", + "memory-db", + "pallet-babe", + "pallet-balances", + "pallet-beefy-mmr", + "pallet-ethereum", + "pallet-sudo", + "pallet-timestamp", + "parity-scale-codec", + "sc-block-builder", + "sc-executor", + "sc-service", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-block-builder", + "sp-consensus", + "sp-consensus-aura", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-consensus-grandpa", + "sp-core", + "sp-externalities", + "sp-inherents", + "sp-io", + "sp-keyring", + "sp-offchain", + "sp-runtime", + "sp-runtime-interface", + "sp-session", + "sp-state-machine", + "sp-std", + "sp-transaction-pool", + "sp-trie", + "sp-version", + "stability-pallet-root-testing", + "stability-sp-debug-derive", + "stability-sp-tracing", + "stability-test-runtime-client", + "stbl-core-primitives", + "stbl-primitives-fee-compatible-api", + "stbl-primitives-zero-gas-transactions-api", + "substrate-wasm-builder", + "trie-db", +] + +[[package]] +name = "stability-test-runtime-client" +version = "2.0.0" +dependencies = [ + "futures", + "parity-scale-codec", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-consensus", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-runtime", + "stability-test-client", + "stability-test-runtime", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -10200,6 +10320,7 @@ dependencies = [ "sp-keystore", "sp-runtime", "stability-runtime", + "stability-test-runtime-client", "stbl-primitives-fee-compatible-api", "stbl-primitives-zero-gas-transactions-api", "stbl-tools", @@ -10398,100 +10519,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "substrate-test-client" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" -dependencies = [ - "array-bytes 4.2.0", - "async-trait", - "futures", - "parity-scale-codec", - "sc-client-api", - "sc-client-db", - "sc-consensus", - "sc-executor", - "sc-offchain", - "sc-service", - "serde", - "serde_json", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-keyring", - "sp-keystore", - "sp-runtime", - "sp-state-machine", -] - -[[package]] -name = "substrate-test-runtime" -version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" -dependencies = [ - "array-bytes 6.1.0", - "frame-executive", - "frame-support", - "frame-system", - "frame-system-rpc-runtime-api", - "log", - "memory-db", - "pallet-babe", - "pallet-balances", - "pallet-beefy-mmr", - "pallet-root-testing", - "pallet-sudo", - "pallet-timestamp", - "parity-scale-codec", - "sc-service", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto", - "sp-block-builder", - "sp-consensus-aura", - "sp-consensus-babe", - "sp-consensus-beefy", - "sp-consensus-grandpa", - "sp-core", - "sp-debug-derive", - "sp-externalities", - "sp-inherents", - "sp-io", - "sp-keyring", - "sp-offchain", - "sp-runtime", - "sp-runtime-interface", - "sp-session", - "sp-state-machine", - "sp-std", - "sp-transaction-pool", - "sp-trie", - "sp-version", - "substrate-wasm-builder", - "trie-db", -] - -[[package]] -name = "substrate-test-runtime-client" -version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" -dependencies = [ - "futures", - "parity-scale-codec", - "sc-block-builder", - "sc-chain-spec", - "sc-client-api", - "sc-consensus", - "sp-api", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-runtime", - "substrate-test-client", - "substrate-test-runtime", -] - [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" diff --git a/Cargo.toml b/Cargo.toml index 8891475a..e8135ec5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,6 +36,12 @@ members = [ 'primitives/core', 'primitives/account', 'primitives/transaction-validator', + 'test-utils/stability-runtime-client', + 'test-utils/stability-runtime', + 'test-utils/stability-client', + 'test-utils/stability-root-testing', + 'test-utils/stability-debug-derive', + 'test-utils/stability-tracing' ] [workspace.package] @@ -49,6 +55,11 @@ repository = "https://github.com/stabilityprotocol/stability/" [workspace.dependencies] clap = { version = "4.3", features = ["derive", "deprecated"] } affix = "0.1.2" +quote = "1.0.26" +proc-macro2 = "1.0.56" +tracing = "0.1.29" +tracing-core = "0.1.28" +tracing-subscriber = "0.2.19" derive_more = "0.99" impl-trait-for-tuples = "0.2.1" num_enum = { version = "0.5.3", default-features = false } @@ -74,7 +85,7 @@ futures = "0.3.28" futures-timer = "3.0.1" log = "0.4.17" parking_lot = "0.12.1" -array-bytes = "4.1" +array-bytes = "6.1" bytes = "1.0" async-trait = "0.1.57" cfg-if = "1.0" @@ -165,7 +176,6 @@ frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/pari prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } -substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } sp-staking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } # Frontier Client @@ -225,6 +235,12 @@ pallet-validator-set = { path = "./pallets/validator-set", default-features = fa pallet-validator-keys-controller = { path = "./pallets/validator-keys-controller", default-features = false } pallet-custom-balances = { path = './pallets/custom-balances', default-features = false } runner = { path = "./primitives/runner", default-features = false } +stability-test-runtime-client = { path = "./test-utils/stability-runtime-client", default-features = false } +stability-test-runtime = { path = "./test-utils/stability-runtime", default-features = false } +stability-test-client = { path = "./test-utils/stability-client", default-features = false } +stability-pallet-root-testing = { path = "./test-utils/stability-root-testing", default-features = false } +stability-sp-debug-derive = { path = "./test-utils/stability-debug-derive", default-features = false } +stability-sp-tracing = { path = "./test-utils/stability-tracing", default-features = false} stbl-core-primitives = { path = "primitives/core", default-features = false } account = { path = "primitives/account", default-features = false } diff --git a/client/authorship/Cargo.toml b/client/authorship/Cargo.toml index 7ffdb84b..b39c3bbe 100644 --- a/client/authorship/Cargo.toml +++ b/client/authorship/Cargo.toml @@ -41,6 +41,7 @@ reqwest = { workspace = true, features = ["json"] } serde = { workspace = true, features = ["derive"] } bytes = { workspace = true } hex = { workspace = true } +stability-test-runtime-client = { workspace = true } [dev-dependencies] parking_lot = { workspace = true } diff --git a/client/authorship/src/authorship.rs b/client/authorship/src/authorship.rs index 74ab187f..2c3c1f01 100644 --- a/client/authorship/src/authorship.rs +++ b/client/authorship/src/authorship.rs @@ -796,4 +796,655 @@ where storage_changes, }) } +} + +#[cfg(test)] +mod tests { + use super::*; + + use futures::executor::block_on; + use parking_lot::Mutex; + use sc_client_api::Backend; + use sc_transaction_pool::BasicPool; + use sc_transaction_pool_api::{ChainEvent, MaintainedTransactionPool, TransactionSource}; + use sp_api::Core; + use sp_blockchain::HeaderBackend; + use sp_consensus::{BlockOrigin, Environment, Proposer}; + use sp_runtime::{generic::BlockId, traits::NumberFor, Perbill}; + use stability_test_runtime_client::{ + prelude::*, + runtime::{Block as TestBlock, Extrinsic, ExtrinsicBuilder, Transfer}, + TestClientBuilder, TestClientBuilderExt, + }; + + const SOURCE: TransactionSource = TransactionSource::External; + + // Note: + // Maximum normal extrinsic size for `substrate_test_runtime` is ~65% of max_block (refer to + // `substrate_test_runtime::RuntimeBlockWeights` for details). + // This extrinsic sizing allows for: + // - one huge xts + a lot of tiny dust + // - one huge, no medium, + // - two medium xts + // This is widely exploited in following tests. + const HUGE: u32 = 649000000; + const MEDIUM: u32 = 250000000; + const TINY: u32 = 1000; + + fn extrinsic(nonce: u64) -> Extrinsic { + ExtrinsicBuilder::new_fill_block(Perbill::from_parts(TINY)).nonce(nonce).build() + } + + fn chain_event(header: B::Header) -> ChainEvent + where + NumberFor: From, + { + ChainEvent::NewBestBlock { hash: header.hash(), tree_route: None } + } + + #[test] + fn should_cease_building_block_when_deadline_is_reached() { + // given + let client = Arc::new(stability_test_runtime_client::new()); + let spawner = sp_core::testing::TaskExecutor::new(); + let txpool = BasicPool::new_full( + Default::default(), + true.into(), + None, + spawner.clone(), + client.clone(), + ); + + block_on(txpool.submit_at(&BlockId::number(0), SOURCE, vec![extrinsic(0), extrinsic(1)])) + .unwrap(); + + block_on( + txpool.maintain(chain_event( + client + .expect_header(client.info().genesis_hash) + .expect("there should be header"), + )), + ); + + let keystore_config = sc_service::config::KeystoreConfig::InMemory; + let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); + + Keystore::ecdsa_generate_new( + &*keystore_container.keystore().clone(), + KeyTypeId::try_from("aura").unwrap(), + Some("//Alice"), + ) + .expect("Creates authority key"); + + let mut proposer_factory = + ProposerFactory::new(spawner.clone(), client.clone(), txpool.clone(),keystore_container.keystore(), None, None, None); + + let cell = Mutex::new((false, time::Instant::now())); + let proposer = proposer_factory.init_with_now( + &client.expect_header(client.info().genesis_hash).unwrap(), + Box::new(move || { + let mut value = cell.lock(); + if !value.0 { + value.0 = true; + return value.1 + } + let old = value.1; + let new = old + time::Duration::from_secs(1); + *value = (true, new); + old + }), + ); + + // when + let deadline = time::Duration::from_secs(3); + let block = + block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) + .map(|r| r.block) + .unwrap(); + + // then + // block should have some extrinsics although we have some more in the pool. + assert_eq!(block.extrinsics().len(), 1); + assert_eq!(txpool.ready().count(), 2); + } + + #[test] + fn should_not_panic_when_deadline_is_reached() { + let client = Arc::new(stability_test_runtime_client::new()); + let spawner = sp_core::testing::TaskExecutor::new(); + let txpool = BasicPool::new_full( + Default::default(), + true.into(), + None, + spawner.clone(), + client.clone(), + ); + + let keystore_config = sc_service::config::KeystoreConfig::InMemory; + let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); + + + Keystore::ecdsa_generate_new( + &*keystore_container.keystore().clone(), + KeyTypeId::try_from("aura").unwrap(), + Some("//Alice"), + ) + .expect("Creates authority key"); + + let mut proposer_factory = + ProposerFactory::new(spawner.clone(), client.clone(), txpool.clone(), keystore_container.keystore(), None, None, None); + + let cell = Mutex::new((false, time::Instant::now())); + let proposer = proposer_factory.init_with_now( + &client.expect_header(client.info().genesis_hash).unwrap(), + Box::new(move || { + let mut value = cell.lock(); + if !value.0 { + value.0 = true; + return value.1 + } + let new = value.1 + time::Duration::from_secs(160); + *value = (true, new); + new + }), + ); + + let deadline = time::Duration::from_secs(1); + block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) + .map(|r| r.block) + .unwrap(); + } + + #[test] + fn proposed_storage_changes_should_match_execute_block_storage_changes() { + let (client, backend) = TestClientBuilder::new().build_with_backend(); + let client = Arc::new(client); + let spawner = sp_core::testing::TaskExecutor::new(); + let txpool = BasicPool::new_full( + Default::default(), + true.into(), + None, + spawner.clone(), + client.clone(), + ); + + let genesis_hash = client.info().best_hash; + + block_on(txpool.submit_at(&BlockId::number(0), SOURCE, vec![extrinsic(0)])).unwrap(); + + block_on( + txpool.maintain(chain_event( + client + .expect_header(client.info().genesis_hash) + .expect("there should be header"), + )), + ); + + + let keystore_config = sc_service::config::KeystoreConfig::InMemory; + let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); + + Keystore::ecdsa_generate_new( + &*keystore_container.keystore().clone(), + KeyTypeId::try_from("aura").unwrap(), + Some("//Alice"), + ) + .expect("Creates authority key"); + + let mut proposer_factory = + ProposerFactory::new(spawner.clone(), client.clone(), txpool.clone(), keystore_container.keystore(), None, None, None); + + let proposer = proposer_factory.init_with_now( + &client.header(genesis_hash).unwrap().unwrap(), + Box::new(move || time::Instant::now()), + ); + + let deadline = time::Duration::from_secs(9); + let proposal = + block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) + .unwrap(); + + assert_eq!(proposal.block.extrinsics().len(), 1); + + let api = client.runtime_api(); + api.execute_block(genesis_hash, proposal.block).unwrap(); + + let state = backend.state_at(genesis_hash).unwrap(); + + let storage_changes = api.into_storage_changes(&state, genesis_hash).unwrap(); + + assert_eq!( + proposal.storage_changes.transaction_storage_root, + storage_changes.transaction_storage_root, + ); + } + + // This test ensures that if one transaction of a user was rejected, because for example + // the weight limit was hit, we don't mark the other transactions of the user as invalid because + // the nonce is not matching. + #[test] + fn should_not_remove_invalid_transactions_from_the_same_sender_after_one_was_invalid() { + // given + let client = Arc::new(stability_test_runtime_client::new()); + let spawner = sp_core::testing::TaskExecutor::new(); + let txpool = BasicPool::new_full( + Default::default(), + true.into(), + None, + spawner.clone(), + client.clone(), + ); + + let medium = |nonce| { + ExtrinsicBuilder::new_fill_block(Perbill::from_parts(MEDIUM)) + .nonce(nonce) + .build() + }; + let huge = |nonce| { + ExtrinsicBuilder::new_fill_block(Perbill::from_parts(HUGE)).nonce(nonce).build() + }; + + block_on(txpool.submit_at( + &BlockId::number(0), + SOURCE, + vec![medium(0), medium(1), huge(2), medium(3), huge(4), medium(5), medium(6)], + )) + .unwrap(); + + let keystore_config = sc_service::config::KeystoreConfig::InMemory; + let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); + + Keystore::ecdsa_generate_new( + &*keystore_container.keystore().clone(), + KeyTypeId::try_from("aura").unwrap(), + Some("//Alice"), + ) + .expect("Creates authority key"); + + let mut proposer_factory = + ProposerFactory::new(spawner.clone(), client.clone(), txpool.clone(),keystore_container.keystore(), None, None, None); + let mut propose_block = |client: &TestClient, + parent_number, + expected_block_extrinsics, + expected_pool_transactions| { + let hash = client.expect_block_hash_from_id(&BlockId::Number(parent_number)).unwrap(); + let proposer = proposer_factory.init_with_now( + &client.expect_header(hash).unwrap(), + Box::new(move || time::Instant::now()), + ); + + // when + let deadline = time::Duration::from_secs(900); + let block = + block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) + .map(|r| r.block) + .unwrap(); + + // then + // block should have some extrinsics although we have some more in the pool. + assert_eq!( + txpool.ready().count(), + expected_pool_transactions, + "at block: {}", + block.header.number + ); + assert_eq!( + block.extrinsics().len(), + expected_block_extrinsics, + "at block: {}", + block.header.number + ); + + block + }; + + let import_and_maintain = |mut client: Arc, block: TestBlock| { + let hash = block.hash(); + block_on(client.import(BlockOrigin::Own, block)).unwrap(); + block_on(txpool.maintain(chain_event( + client.expect_header(hash).expect("there should be header"), + ))); + }; + + block_on( + txpool.maintain(chain_event( + client + .expect_header(client.info().genesis_hash) + .expect("there should be header"), + )), + ); + assert_eq!(txpool.ready().count(), 7); + + // let's create one block and import it + let block = propose_block(&client, 0, 2, 7); + import_and_maintain(client.clone(), block); + assert_eq!(txpool.ready().count(), 5); + + // now let's make sure that we can still make some progress + let block = propose_block(&client, 1, 1, 5); + import_and_maintain(client.clone(), block); + assert_eq!(txpool.ready().count(), 4); + + // again let's make sure that we can still make some progress + let block = propose_block(&client, 2, 1, 4); + import_and_maintain(client.clone(), block); + assert_eq!(txpool.ready().count(), 3); + + // again let's make sure that we can still make some progress + let block = propose_block(&client, 3, 1, 3); + import_and_maintain(client.clone(), block); + assert_eq!(txpool.ready().count(), 2); + + // again let's make sure that we can still make some progress + let block = propose_block(&client, 4, 2, 2); + import_and_maintain(client.clone(), block); + assert_eq!(txpool.ready().count(), 0); + } + + #[test] + fn should_cease_building_block_when_block_limit_is_reached() { + let client = Arc::new(stability_test_runtime_client::new()); + let spawner = sp_core::testing::TaskExecutor::new(); + let txpool = BasicPool::new_full( + Default::default(), + true.into(), + None, + spawner.clone(), + client.clone(), + ); + let genesis_header = client + .expect_header(client.info().genesis_hash) + .expect("there should be header"); + + let extrinsics_num = 5; + let extrinsics = std::iter::once( + Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Bob.into(), + amount: 100, + nonce: 0, + } + .into_unchecked_extrinsic(), + ) + .chain((1..extrinsics_num as u64).map(extrinsic)) + .collect::>(); + + let block_limit = genesis_header.encoded_size() + + extrinsics + .iter() + .take(extrinsics_num - 1) + .map(Encode::encoded_size) + .sum::() + + Vec::::new().encoded_size(); + + block_on(txpool.submit_at(&BlockId::number(0), SOURCE, extrinsics.clone())).unwrap(); + + block_on(txpool.maintain(chain_event(genesis_header.clone()))); + + let keystore_config = sc_service::config::KeystoreConfig::InMemory; + let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); + + + Keystore::ecdsa_generate_new( + &*keystore_container.keystore().clone(), + KeyTypeId::try_from("aura").unwrap(), + Some("//Alice"), + ) + .expect("Creates authority key"); + + let mut proposer_factory = + ProposerFactory::new(spawner.clone(), client.clone(), txpool.clone(), keystore_container.keystore(), None, None, None); + + let proposer = block_on(proposer_factory.init(&genesis_header)).unwrap(); + + // Give it enough time + let deadline = time::Duration::from_secs(300); + let block = block_on(proposer.propose( + Default::default(), + Default::default(), + deadline, + Some(block_limit), + )) + .map(|r| r.block) + .unwrap(); + + // Based on the block limit, one transaction shouldn't be included. + assert_eq!(block.extrinsics().len(), extrinsics_num - 1); + + let proposer = block_on(proposer_factory.init(&genesis_header)).unwrap(); + + let block = + block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) + .map(|r| r.block) + .unwrap(); + + // Without a block limit we should include all of them + assert_eq!(block.extrinsics().len(), extrinsics_num); + + let keystore_config = sc_service::config::KeystoreConfig::InMemory; + let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); + + Keystore::ecdsa_generate_new( + &*keystore_container.keystore().clone(), + KeyTypeId::try_from("aura").unwrap(), + Some("//Alice"), + ) + .expect("Creates authority key"); + + let mut proposer_factory = ProposerFactory::with_proof_recording( + spawner.clone(), + client.clone(), + txpool.clone(), + keystore_container.keystore(), + None, + None, + None, + ); + + let proposer = block_on(proposer_factory.init(&genesis_header)).unwrap(); + + // Exact block_limit, which includes: + // 99 (header_size) + 718 (proof@initialize_block) + 246 (one Transfer extrinsic) + let block_limit = { + let builder = + client.new_block_at(genesis_header.hash(), Default::default(), true).unwrap(); + builder.estimate_block_size(true) + extrinsics[0].encoded_size() + }; + let block = block_on(proposer.propose( + Default::default(), + Default::default(), + deadline, + Some(block_limit), + )) + .map(|r| r.block) + .unwrap(); + + // The block limit was increased, but we now include the proof in the estimation of the + // block size and thus, only the `Transfer` will fit into the block. It reads more data + // than we have reserved in the block limit. + assert_eq!(block.extrinsics().len(), 1); + } + + #[test] + fn should_keep_adding_transactions_after_exhausts_resources_before_soft_deadline() { + // given + let client = Arc::new(stability_test_runtime_client::new()); + let spawner = sp_core::testing::TaskExecutor::new(); + let txpool = BasicPool::new_full( + Default::default(), + true.into(), + None, + spawner.clone(), + client.clone(), + ); + + let tiny = |nonce| { + ExtrinsicBuilder::new_fill_block(Perbill::from_parts(TINY)).nonce(nonce).build() + }; + let huge = |who| { + ExtrinsicBuilder::new_fill_block(Perbill::from_parts(HUGE)) + .signer(AccountKeyring::numeric(who)) + .build() + }; + + block_on( + txpool.submit_at( + &BlockId::number(0), + SOURCE, + // add 2 * MAX_SKIPPED_TRANSACTIONS that exhaust resources + (0..MAX_SKIPPED_TRANSACTIONS * 2) + .into_iter() + .map(huge) + // and some transactions that are okay. + .chain((0..MAX_SKIPPED_TRANSACTIONS as u64).into_iter().map(tiny)) + .collect(), + ), + ) + .unwrap(); + + block_on( + txpool.maintain(chain_event( + client + .expect_header(client.info().genesis_hash) + .expect("there should be header"), + )), + ); + assert_eq!(txpool.ready().count(), MAX_SKIPPED_TRANSACTIONS * 3); + + let keystore_config = sc_service::config::KeystoreConfig::InMemory; + let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); + + Keystore::ecdsa_generate_new( + &*keystore_container.keystore().clone(), + KeyTypeId::try_from("aura").unwrap(), + Some("//Alice"), + ) + .expect("Creates authority key"); + + + let mut proposer_factory = + ProposerFactory::new(spawner.clone(), client.clone(), txpool.clone(), keystore_container.keystore(), None, None, None); + + let cell = Mutex::new(time::Instant::now()); + let proposer = proposer_factory.init_with_now( + &client.expect_header(client.info().genesis_hash).unwrap(), + Box::new(move || { + let mut value = cell.lock(); + let old = *value; + *value = old + time::Duration::from_secs(1); + old + }), + ); + + // when + // give it enough time so that deadline is never triggered. + let deadline = time::Duration::from_secs(900); + let block = + block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) + .map(|r| r.block) + .unwrap(); + + // then block should have all non-exhaust resources extrinsics (+ the first one). + assert_eq!(block.extrinsics().len(), MAX_SKIPPED_TRANSACTIONS + 1); + } + + #[test] + fn should_only_skip_up_to_some_limit_after_soft_deadline() { + // given + let client = Arc::new(stability_test_runtime_client::new()); + let spawner = sp_core::testing::TaskExecutor::new(); + let txpool = BasicPool::new_full( + Default::default(), + true.into(), + None, + spawner.clone(), + client.clone(), + ); + + let tiny = |who| { + ExtrinsicBuilder::new_fill_block(Perbill::from_parts(TINY)) + .signer(AccountKeyring::numeric(who)) + .nonce(1) + .build() + }; + let huge = |who| { + ExtrinsicBuilder::new_fill_block(Perbill::from_parts(HUGE)) + .signer(AccountKeyring::numeric(who)) + .build() + }; + + block_on( + txpool.submit_at( + &BlockId::number(0), + SOURCE, + (0..MAX_SKIPPED_TRANSACTIONS + 2) + .into_iter() + .map(huge) + // and some transactions that are okay. + .chain((0..MAX_SKIPPED_TRANSACTIONS + 2).into_iter().map(tiny)) + .collect(), + ), + ) + .unwrap(); + + block_on( + txpool.maintain(chain_event( + client + .expect_header(client.info().genesis_hash) + .expect("there should be header"), + )), + ); + assert_eq!(txpool.ready().count(), MAX_SKIPPED_TRANSACTIONS * 2 + 4); + + let keystore_config = sc_service::config::KeystoreConfig::InMemory; + let keystore_container = sc_service::KeystoreContainer::new(&keystore_config).unwrap(); + + Keystore::ecdsa_generate_new( + &*keystore_container.keystore().clone(), + KeyTypeId::try_from("aura").unwrap(), + Some("//Alice"), + ) + .expect("Creates authority key"); + + let mut proposer_factory = + ProposerFactory::new(spawner.clone(), client.clone(), txpool.clone(), keystore_container.keystore(), None, None, None); + + let deadline = time::Duration::from_secs(600); + let cell = Arc::new(Mutex::new((0, time::Instant::now()))); + let cell2 = cell.clone(); + let proposer = proposer_factory.init_with_now( + &client.expect_header(client.info().genesis_hash).unwrap(), + Box::new(move || { + let mut value = cell.lock(); + let (called, old) = *value; + // add time after deadline is calculated internally (hence 1) + let increase = if called == 1 { + // we start after the soft_deadline should have already been reached. + deadline / 2 + } else { + // but we make sure to never reach the actual deadline + time::Duration::from_millis(0) + }; + *value = (called + 1, old + increase); + old + }), + ); + + let block = + block_on(proposer.propose(Default::default(), Default::default(), deadline, None)) + .map(|r| r.block) + .unwrap(); + + // then the block should have one or two transactions. This maybe random as they are + // processed in parallel. The same signer and consecutive nonces for huge and tiny + // transactions guarantees that max two transactions will get to the block. + assert!( + (1..3).contains(&block.extrinsics().len()), + "Block shall contain one or two extrinsics." + ); + assert!( + cell2.lock().0 > MAX_SKIPPED_TRANSACTIONS, + "Not enough calls to current time, which indicates the test might have ended because of deadline, not soft deadline" + ); + } } \ No newline at end of file diff --git a/pallets/upgrade-runtime-proposal/Cargo.toml b/pallets/upgrade-runtime-proposal/Cargo.toml index 9baddd9c..878a82b8 100644 --- a/pallets/upgrade-runtime-proposal/Cargo.toml +++ b/pallets/upgrade-runtime-proposal/Cargo.toml @@ -19,7 +19,7 @@ stbl-tools = { workspace = true } log = { workspace = true } [dev-dependencies] -substrate-test-runtime-client = { workspace = true } +stability-test-runtime-client = { workspace = true } sp-version = { workspace = true } [features] diff --git a/pallets/upgrade-runtime-proposal/src/tests.rs b/pallets/upgrade-runtime-proposal/src/tests.rs index c3f6f428..2d6eba02 100644 --- a/pallets/upgrade-runtime-proposal/src/tests.rs +++ b/pallets/upgrade-runtime-proposal/src/tests.rs @@ -17,12 +17,12 @@ fn test_setup_works() { #[test] fn test_propose_code_works() { - let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); + let executor = stability_test_runtime_client::new_native_or_wasm_executor(); let mut ext = new_test_ext(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); ext.execute_with(|| { - let proposed_code = substrate_test_runtime_client::runtime::wasm_binary_unwrap().to_vec(); + let proposed_code = stability_test_runtime_client::runtime::wasm_binary_unwrap().to_vec(); assert!(UpgradeRuntimeProposal::get_proposed_code().is_none()); assert_ok!(UpgradeRuntimeProposal::propose_code( frame_system::RawOrigin::Root.into(), @@ -52,19 +52,19 @@ fn test_propose_code_fails_if_bad_origin() { #[test] fn test_propose_code_fails_if_there_are_already_a_proposed_code() { - let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); + let executor = stability_test_runtime_client::new_native_or_wasm_executor(); let mut ext = new_test_ext(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); ext.execute_with(|| { assert_ok!(UpgradeRuntimeProposal::propose_code( frame_system::RawOrigin::Root.into(), - substrate_test_runtime_client::runtime::wasm_binary_unwrap().to_vec() + stability_test_runtime_client::runtime::wasm_binary_unwrap().to_vec() )); assert_noop!( UpgradeRuntimeProposal::propose_code( frame_system::RawOrigin::Root.into(), - substrate_test_runtime_client::runtime::wasm_binary_unwrap().to_vec() + stability_test_runtime_client::runtime::wasm_binary_unwrap().to_vec() ), Error::::ProposalInProgress ); @@ -73,7 +73,7 @@ fn test_propose_code_fails_if_there_are_already_a_proposed_code() { #[test] fn test_propose_code_fails_invalid_proposed_code() { - let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); + let executor = stability_test_runtime_client::new_native_or_wasm_executor(); let mut ext = new_test_ext(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); @@ -90,14 +90,14 @@ fn test_propose_code_fails_invalid_proposed_code() { #[test] fn test_set_block_application() { - let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); + let executor = stability_test_runtime_client::new_native_or_wasm_executor(); let mut ext = new_test_ext(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); ext.execute_with(|| { assert_ok!(UpgradeRuntimeProposal::propose_code( frame_system::RawOrigin::Root.into(), - substrate_test_runtime_client::runtime::wasm_binary_unwrap().to_vec() + stability_test_runtime_client::runtime::wasm_binary_unwrap().to_vec() )); assert_ok!(UpgradeRuntimeProposal::set_block_application( frame_system::RawOrigin::Root.into(), @@ -122,14 +122,14 @@ fn test_set_block_application_fails_if_bad_origin() { #[test] fn test_set_block_application_fails_block_is_older() { - let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); + let executor = stability_test_runtime_client::new_native_or_wasm_executor(); let mut ext = new_test_ext(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); ext.execute_with(|| { assert_ok!(UpgradeRuntimeProposal::propose_code( frame_system::RawOrigin::Root.into(), - substrate_test_runtime_client::runtime::wasm_binary_unwrap().to_vec() + stability_test_runtime_client::runtime::wasm_binary_unwrap().to_vec() )); assert_noop!( UpgradeRuntimeProposal::set_block_application(frame_system::RawOrigin::Root.into(), 0), @@ -140,7 +140,7 @@ fn test_set_block_application_fails_block_is_older() { #[test] fn test_set_block_application_fails_if_not_proposed_code() { - let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); + let executor = stability_test_runtime_client::new_native_or_wasm_executor(); let mut ext = new_test_ext(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); @@ -154,14 +154,14 @@ fn test_set_block_application_fails_if_not_proposed_code() { #[test] fn test_reject_proposed_code() { - let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); + let executor = stability_test_runtime_client::new_native_or_wasm_executor(); let mut ext = new_test_ext(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); ext.execute_with(|| { assert_ok!(UpgradeRuntimeProposal::propose_code( frame_system::RawOrigin::Root.into(), - substrate_test_runtime_client::runtime::wasm_binary_unwrap().to_vec() + stability_test_runtime_client::runtime::wasm_binary_unwrap().to_vec() )); assert_ok!(UpgradeRuntimeProposal::set_block_application( frame_system::RawOrigin::Root.into(), @@ -197,14 +197,14 @@ fn test_fails_reject_proposed_code_if_no_proposed_code() { #[test] fn test_scheduled_update_runtime() { - let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); + let executor = stability_test_runtime_client::new_native_or_wasm_executor(); let mut ext = new_test_ext(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); ext.execute_with(|| { assert_ok!(UpgradeRuntimeProposal::propose_code( frame_system::RawOrigin::Root.into(), - substrate_test_runtime_client::runtime::wasm_binary_unwrap().to_vec() + stability_test_runtime_client::runtime::wasm_binary_unwrap().to_vec() )); assert_ok!(UpgradeRuntimeProposal::set_block_application( frame_system::RawOrigin::Root.into(), diff --git a/precompiles/fee-rewards-vault-controller/Cargo.toml b/precompiles/fee-rewards-vault-controller/Cargo.toml index fc38dca9..5b82174d 100644 --- a/precompiles/fee-rewards-vault-controller/Cargo.toml +++ b/precompiles/fee-rewards-vault-controller/Cargo.toml @@ -40,7 +40,7 @@ precompile-utils = { path = "../utils", features = [ "testing" ] } scale-info = { version = "2.0", default-features = false, features = [ "derive" ] } sha3 = "0.10" sp-io = { workspace = true } -substrate-test-runtime-client = { workspace = true } +stability-test-runtime-client = { workspace = true } sp-staking = { workspace = true } [features] diff --git a/precompiles/upgrade-runtime-controller/Cargo.toml b/precompiles/upgrade-runtime-controller/Cargo.toml index 878870e7..294b8d5f 100644 --- a/precompiles/upgrade-runtime-controller/Cargo.toml +++ b/precompiles/upgrade-runtime-controller/Cargo.toml @@ -31,7 +31,7 @@ precompile-utils = { path = "../utils", features = [ "testing" ] } scale-info = { version = "2.0", default-features = false, features = [ "derive" ] } sha3 = "0.10" sp-io = { workspace = true } -substrate-test-runtime-client = { workspace = true } +stability-test-runtime-client = { workspace = true } [features] default = [ "std" ] diff --git a/precompiles/upgrade-runtime-controller/src/tests.rs b/precompiles/upgrade-runtime-controller/src/tests.rs index da3d17e6..df119f2c 100644 --- a/precompiles/upgrade-runtime-controller/src/tests.rs +++ b/precompiles/upgrade-runtime-controller/src/tests.rs @@ -2,7 +2,7 @@ use crate::{mock::*, *}; use precompile_utils::testing::*; use sha3::{Digest, Keccak256}; -use substrate_test_runtime_client::runtime::BlockNumber; +use stability_test_runtime_client::runtime::BlockNumber; fn precompiles() -> Precompiles { PrecompilesValue::get() @@ -157,7 +157,7 @@ fn claim_ownership_if_claimable() { #[test] fn test_set_block_application() { - let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); + let executor = stability_test_runtime_client::new_native_or_wasm_executor(); let mut ext = ExtBuilder::default().build(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); @@ -165,7 +165,7 @@ fn test_set_block_application() { ext.execute_with(|| { UpgradeRuntimeProposal::propose_code( frame_system::RawOrigin::Root.into(), - substrate_test_runtime_client::runtime::wasm_binary_unwrap().to_vec() + stability_test_runtime_client::runtime::wasm_binary_unwrap().to_vec() ).unwrap(); let block_number = 100u32; @@ -190,7 +190,7 @@ fn test_set_block_application() { #[test] fn test_fail_set_block_application_if_not_owner() { - let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); + let executor = stability_test_runtime_client::new_native_or_wasm_executor(); let mut ext = ExtBuilder::default().build(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); @@ -198,7 +198,7 @@ fn test_fail_set_block_application_if_not_owner() { ext.execute_with(|| { UpgradeRuntimeProposal::propose_code( frame_system::RawOrigin::Root.into(), - substrate_test_runtime_client::runtime::wasm_binary_unwrap().to_vec() + stability_test_runtime_client::runtime::wasm_binary_unwrap().to_vec() ).unwrap(); let block_number = 100u32; @@ -216,7 +216,7 @@ fn test_fail_set_block_application_if_not_owner() { #[test] fn test_reject_proposed_code() { - let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); + let executor = stability_test_runtime_client::new_native_or_wasm_executor(); let mut ext = ExtBuilder::default().build(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); @@ -224,7 +224,7 @@ fn test_reject_proposed_code() { ext.execute_with(|| { UpgradeRuntimeProposal::propose_code( frame_system::RawOrigin::Root.into(), - substrate_test_runtime_client::runtime::wasm_binary_unwrap().to_vec() + stability_test_runtime_client::runtime::wasm_binary_unwrap().to_vec() ).unwrap(); precompiles() @@ -246,7 +246,7 @@ fn test_reject_proposed_code() { #[test] fn test_fail_reject_proposed_code_if_not_owner() { - let executor = substrate_test_runtime_client::new_native_or_wasm_executor(); + let executor = stability_test_runtime_client::new_native_or_wasm_executor(); let mut ext = ExtBuilder::default().build(); ext.register_extension(sp_core::traits::ReadRuntimeVersionExt::new(executor)); @@ -254,7 +254,7 @@ fn test_fail_reject_proposed_code_if_not_owner() { ext.execute_with(|| { UpgradeRuntimeProposal::propose_code( frame_system::RawOrigin::Root.into(), - substrate_test_runtime_client::runtime::wasm_binary_unwrap().to_vec() + stability_test_runtime_client::runtime::wasm_binary_unwrap().to_vec() ).unwrap(); precompiles() diff --git a/precompiles/utils/Cargo.toml b/precompiles/utils/Cargo.toml index 4a2550db..2b9e0e2a 100644 --- a/precompiles/utils/Cargo.toml +++ b/precompiles/utils/Cargo.toml @@ -20,7 +20,7 @@ serde = { workspace = true, optional = true } sha3 = { workspace = true } similar-asserts = { workspace = true, optional = true } -# Moonbeam +# Stability precompile-utils-macro = { path = "macro" } # Substrate diff --git a/precompiles/utils/macro/src/derive_codec.rs b/precompiles/utils/macro/src/derive_codec.rs index e988e380..ee716129 100644 --- a/precompiles/utils/macro/src/derive_codec.rs +++ b/precompiles/utils/macro/src/derive_codec.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use proc_macro::TokenStream; use proc_macro2::Span; diff --git a/precompiles/utils/macro/src/generate_function_selector.rs b/precompiles/utils/macro/src/generate_function_selector.rs index 405db1e0..be2f1ff4 100644 --- a/precompiles/utils/macro/src/generate_function_selector.rs +++ b/precompiles/utils/macro/src/generate_function_selector.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use super::*; diff --git a/precompiles/utils/macro/src/lib.rs b/precompiles/utils/macro/src/lib.rs index 92144828..92abf473 100644 --- a/precompiles/utils/macro/src/lib.rs +++ b/precompiles/utils/macro/src/lib.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . #![crate_type = "proc-macro"] extern crate proc_macro; diff --git a/precompiles/utils/macro/src/precompile/attr.rs b/precompiles/utils/macro/src/precompile/attr.rs index db29087b..7d3b8ee2 100644 --- a/precompiles/utils/macro/src/precompile/attr.rs +++ b/precompiles/utils/macro/src/precompile/attr.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use proc_macro2::Span; use quote::ToTokens; diff --git a/precompiles/utils/macro/src/precompile/expand.rs b/precompiles/utils/macro/src/precompile/expand.rs index e12eba6f..58b84e78 100644 --- a/precompiles/utils/macro/src/precompile/expand.rs +++ b/precompiles/utils/macro/src/precompile/expand.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use super::*; diff --git a/precompiles/utils/macro/src/precompile/mod.rs b/precompiles/utils/macro/src/precompile/mod.rs index 4cd63ed2..29810500 100644 --- a/precompiles/utils/macro/src/precompile/mod.rs +++ b/precompiles/utils/macro/src/precompile/mod.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . #![doc = include_str!("../../docs/precompile_macro.md")] diff --git a/precompiles/utils/macro/src/precompile/parse.rs b/precompiles/utils/macro/src/precompile/parse.rs index 3a644912..ea2ca1ce 100644 --- a/precompiles/utils/macro/src/precompile/parse.rs +++ b/precompiles/utils/macro/src/precompile/parse.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use super::*; diff --git a/precompiles/utils/macro/src/precompile_name_from_address.rs b/precompiles/utils/macro/src/precompile_name_from_address.rs index 27ce5f11..fe467743 100644 --- a/precompiles/utils/macro/src/precompile_name_from_address.rs +++ b/precompiles/utils/macro/src/precompile_name_from_address.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use super::*; use syn::{GenericArgument, Type}; diff --git a/precompiles/utils/macro/tests/compile-fail/derive_codec/empty_struct.rs b/precompiles/utils/macro/tests/compile-fail/derive_codec/empty_struct.rs index ea2cd462..7222ba44 100644 --- a/precompiles/utils/macro/tests/compile-fail/derive_codec/empty_struct.rs +++ b/precompiles/utils/macro/tests/compile-fail/derive_codec/empty_struct.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use precompile_utils::prelude::*; diff --git a/precompiles/utils/macro/tests/compile-fail/derive_codec/enum.rs b/precompiles/utils/macro/tests/compile-fail/derive_codec/enum.rs index de0a7a61..5c51144f 100644 --- a/precompiles/utils/macro/tests/compile-fail/derive_codec/enum.rs +++ b/precompiles/utils/macro/tests/compile-fail/derive_codec/enum.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use precompile_utils::prelude::*; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/codec/arg-dont-impl-codec.rs b/precompiles/utils/macro/tests/compile-fail/precompile/codec/arg-dont-impl-codec.rs index d37fda0e..56763d42 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/codec/arg-dont-impl-codec.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/codec/arg-dont-impl-codec.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; use fp_evm::PrecompileHandle; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/codec/no-output.rs b/precompiles/utils/macro/tests/compile-fail/precompile/codec/no-output.rs index 1f0ab2ae..c2689a33 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/codec/no-output.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/codec/no-output.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-dont-impl-codec.rs b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-dont-impl-codec.rs index bb7ffb72..24ad70d2 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-dont-impl-codec.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-dont-impl-codec.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; use fp_evm::PrecompileHandle; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-not-result.rs b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-not-result.rs index 686f3bd0..6f57aa01 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-not-result.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-not-result.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; use fp_evm::PrecompileHandle; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-wrong-error-result.rs b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-wrong-error-result.rs index df90aadd..b58c71aa 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-wrong-error-result.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-wrong-error-result.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; use fp_evm::PrecompileHandle; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/dont-return-option.rs b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/dont-return-option.rs index ca9faeaf..b0cdb3fa 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/dont-return-option.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/dont-return-option.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-fn.rs b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-fn.rs index 9eb81c8d..a143e44a 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-fn.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-fn.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-param.rs b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-param.rs index 534c9b2a..b1be68dd 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-param.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-param.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/return-incomplete-option.rs b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/return-incomplete-option.rs index 8d08a6af..b3f23b19 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/return-incomplete-option.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/return-incomplete-option.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/too-many-arguments.rs b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/too-many-arguments.rs index 63281a7a..be16a8d9 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/too-many-arguments.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/too-many-arguments.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-1.rs b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-1.rs index 9a392560..21c694b2 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-1.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-1.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-2.rs b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-2.rs index 4ebfdd84..5ead80a8 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-2.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-2.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/discriminant-multiple.rs b/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/discriminant-multiple.rs index 6aac2cd2..ee68820b 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/discriminant-multiple.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/discriminant-multiple.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/multiple-modifiers.rs b/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/multiple-modifiers.rs index 70d5ea92..61b6f627 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/multiple-modifiers.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/multiple-modifiers.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/pre-check-multiple.rs b/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/pre-check-multiple.rs index f80194ee..7fce4628 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/pre-check-multiple.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/fn-modifiers/pre-check-multiple.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/handle/missing.rs b/precompiles/utils/macro/tests/compile-fail/precompile/handle/missing.rs index 50bee5b9..21dc1ee1 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/handle/missing.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/handle/missing.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/handle/set-missing.rs b/precompiles/utils/macro/tests/compile-fail/precompile/handle/set-missing.rs index 14477da6..3c897ff7 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/handle/set-missing.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/handle/set-missing.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/handle/set-wrong-type.rs b/precompiles/utils/macro/tests/compile-fail/precompile/handle/set-wrong-type.rs index 0c33d150..43ca3e99 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/handle/set-wrong-type.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/handle/set-wrong-type.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/handle/wrong-type.rs b/precompiles/utils/macro/tests/compile-fail/precompile/handle/wrong-type.rs index 39efe052..ace58170 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/handle/wrong-type.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/handle/wrong-type.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/no-parameter.rs b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/no-parameter.rs index 0c40d715..231b0166 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/no-parameter.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/no-parameter.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/too-many-parameters.rs b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/too-many-parameters.rs index 1ad09c62..08f692b6 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/too-many-parameters.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/too-many-parameters.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/wrong-parameter.rs b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/wrong-parameter.rs index d081415b..97d7b26d 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/wrong-parameter.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/wrong-parameter.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/test-gen/generic-arg.rs b/precompiles/utils/macro/tests/compile-fail/precompile/test-gen/generic-arg.rs index c5670db2..47ef5b6a 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/test-gen/generic-arg.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile/test-gen/generic-arg.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use core::marker::PhantomData; diff --git a/precompiles/utils/macro/tests/compile-fail/precompile_name/not_tuple.rs b/precompiles/utils/macro/tests/compile-fail/precompile_name/not_tuple.rs index 838e53d2..95aeadc8 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile_name/not_tuple.rs +++ b/precompiles/utils/macro/tests/compile-fail/precompile_name/not_tuple.rs @@ -1,18 +1,18 @@ // Copyright 2019-2023 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . struct Dummy; diff --git a/precompiles/utils/macro/tests/expand/precompile.rs b/precompiles/utils/macro/tests/expand/precompile.rs index fc1d76e7..0d625c9c 100644 --- a/precompiles/utils/macro/tests/expand/precompile.rs +++ b/precompiles/utils/macro/tests/expand/precompile.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use { core::marker::PhantomData, diff --git a/precompiles/utils/macro/tests/expand/precompile_name.rs b/precompiles/utils/macro/tests/expand/precompile_name.rs index 3e14f9fb..6afca508 100644 --- a/precompiles/utils/macro/tests/expand/precompile_name.rs +++ b/precompiles/utils/macro/tests/expand/precompile_name.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . // Few mock structs to check the macro. struct PrecompileAt(PhantomData<(T, U, V)>); diff --git a/precompiles/utils/macro/tests/expand/precompileset.rs b/precompiles/utils/macro/tests/expand/precompileset.rs index 8edb5edd..d9110f4b 100644 --- a/precompiles/utils/macro/tests/expand/precompileset.rs +++ b/precompiles/utils/macro/tests/expand/precompileset.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use { core::marker::PhantomData, diff --git a/precompiles/utils/macro/tests/expand/returns_tuple.rs b/precompiles/utils/macro/tests/expand/returns_tuple.rs index b87fe122..783c271c 100644 --- a/precompiles/utils/macro/tests/expand/returns_tuple.rs +++ b/precompiles/utils/macro/tests/expand/returns_tuple.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use { precompile_utils::{EvmResult, prelude::*}, diff --git a/precompiles/utils/macro/tests/pass/derive_codec.rs b/precompiles/utils/macro/tests/pass/derive_codec.rs index c23f5611..678b7274 100644 --- a/precompiles/utils/macro/tests/pass/derive_codec.rs +++ b/precompiles/utils/macro/tests/pass/derive_codec.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use precompile_utils::solidity::codec::{Address, Codec, Reader, Writer}; use sp_core::H160; diff --git a/precompiles/utils/macro/tests/pass/precompile_fn_modifiers.rs b/precompiles/utils/macro/tests/pass/precompile_fn_modifiers.rs index 7437a11e..b9509163 100644 --- a/precompiles/utils/macro/tests/pass/precompile_fn_modifiers.rs +++ b/precompiles/utils/macro/tests/pass/precompile_fn_modifiers.rs @@ -1,12 +1,12 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. diff --git a/precompiles/utils/macro/tests/tests.rs b/precompiles/utils/macro/tests/tests.rs index b392fd02..921656f5 100644 --- a/precompiles/utils/macro/tests/tests.rs +++ b/precompiles/utils/macro/tests/tests.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use sha3::{Digest, Keccak256}; diff --git a/precompiles/utils/src/evm/costs.rs b/precompiles/utils/src/evm/costs.rs index 5f2abd25..9720c093 100644 --- a/precompiles/utils/src/evm/costs.rs +++ b/precompiles/utils/src/evm/costs.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . //! Cost calculations. //! TODO: PR EVM to make those cost calculations public. diff --git a/precompiles/utils/src/evm/handle.rs b/precompiles/utils/src/evm/handle.rs index 0b08e37c..726ea66e 100644 --- a/precompiles/utils/src/evm/handle.rs +++ b/precompiles/utils/src/evm/handle.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use { crate::{ diff --git a/precompiles/utils/src/evm/logs.rs b/precompiles/utils/src/evm/logs.rs index 2dde6ff1..40d71cca 100644 --- a/precompiles/utils/src/evm/logs.rs +++ b/precompiles/utils/src/evm/logs.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use { crate::EvmResult, diff --git a/precompiles/utils/src/evm/mod.rs b/precompiles/utils/src/evm/mod.rs index 6b4cc27f..4c04e4a7 100644 --- a/precompiles/utils/src/evm/mod.rs +++ b/precompiles/utils/src/evm/mod.rs @@ -1,18 +1,18 @@ // Copyright 2019-2023 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . pub mod costs; pub mod handle; diff --git a/precompiles/utils/src/lib.rs b/precompiles/utils/src/lib.rs index 7c847654..9b8febdb 100644 --- a/precompiles/utils/src/lib.rs +++ b/precompiles/utils/src/lib.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . #![cfg_attr(not(feature = "std"), no_std)] diff --git a/precompiles/utils/src/precompile_set.rs b/precompiles/utils/src/precompile_set.rs index 344e163d..10be190c 100644 --- a/precompiles/utils/src/precompile_set.rs +++ b/precompiles/utils/src/precompile_set.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . //! Provide utils to assemble precompiles and precompilesets into a //! final precompile set with security checks. All security checks are enabled by diff --git a/precompiles/utils/src/solidity/codec/bytes.rs b/precompiles/utils/src/solidity/codec/bytes.rs index c3c72b8f..b38b2b3f 100644 --- a/precompiles/utils/src/solidity/codec/bytes.rs +++ b/precompiles/utils/src/solidity/codec/bytes.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use super::*; use alloc::borrow::ToOwned; diff --git a/precompiles/utils/src/solidity/codec/mod.rs b/precompiles/utils/src/solidity/codec/mod.rs index ea27fb63..ce2d30c1 100644 --- a/precompiles/utils/src/solidity/codec/mod.rs +++ b/precompiles/utils/src/solidity/codec/mod.rs @@ -1,18 +1,18 @@ // Copyright 2019-2023 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . //! Solidity encoding following the //! [Contract ABI Specification](https://docs.soliditylang.org/en/v0.8.19/abi-spec.html#abi) diff --git a/precompiles/utils/src/solidity/codec/native.rs b/precompiles/utils/src/solidity/codec/native.rs index 1ad1d1eb..53b9b595 100644 --- a/precompiles/utils/src/solidity/codec/native.rs +++ b/precompiles/utils/src/solidity/codec/native.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use super::*; use crate::solidity::revert::InjectBacktrace; diff --git a/precompiles/utils/src/solidity/codec/xcm.rs b/precompiles/utils/src/solidity/codec/xcm.rs index e1c7a058..54bfe28b 100644 --- a/precompiles/utils/src/solidity/codec/xcm.rs +++ b/precompiles/utils/src/solidity/codec/xcm.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . //! Encoding of XCM types for solidity diff --git a/precompiles/utils/src/solidity/mod.rs b/precompiles/utils/src/solidity/mod.rs index 13d6d656..e03a795a 100644 --- a/precompiles/utils/src/solidity/mod.rs +++ b/precompiles/utils/src/solidity/mod.rs @@ -1,18 +1,18 @@ // Copyright 2019-2023 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . //! Provides utilities for compatibility with Solidity tooling. diff --git a/precompiles/utils/src/solidity/modifier.rs b/precompiles/utils/src/solidity/modifier.rs index 80e4d33e..123c58da 100644 --- a/precompiles/utils/src/solidity/modifier.rs +++ b/precompiles/utils/src/solidity/modifier.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . //! Provide checks related to function modifiers (view/payable). diff --git a/precompiles/utils/src/solidity/revert.rs b/precompiles/utils/src/solidity/revert.rs index 0b7aa8f5..6e03f7ad 100644 --- a/precompiles/utils/src/solidity/revert.rs +++ b/precompiles/utils/src/solidity/revert.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . //! Utilities to work with revert messages with support for backtraces and //! consistent formatting. diff --git a/precompiles/utils/src/substrate.rs b/precompiles/utils/src/substrate.rs index 889369b7..54dc3302 100644 --- a/precompiles/utils/src/substrate.rs +++ b/precompiles/utils/src/substrate.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . //! Utils related to Substrate features: //! - Substrate call dispatch. diff --git a/precompiles/utils/src/testing/account.rs b/precompiles/utils/src/testing/account.rs index a75886cb..9e5b40cd 100644 --- a/precompiles/utils/src/testing/account.rs +++ b/precompiles/utils/src/testing/account.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use { pallet_evm::AddressMapping, diff --git a/precompiles/utils/src/testing/execution.rs b/precompiles/utils/src/testing/execution.rs index ae9f0ff2..e7f87a8f 100644 --- a/precompiles/utils/src/testing/execution.rs +++ b/precompiles/utils/src/testing/execution.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use { crate::{ diff --git a/precompiles/utils/src/testing/handle.rs b/precompiles/utils/src/testing/handle.rs index 6962342b..975956e7 100644 --- a/precompiles/utils/src/testing/handle.rs +++ b/precompiles/utils/src/testing/handle.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use { crate::testing::PrettyLog, diff --git a/precompiles/utils/src/testing/mod.rs b/precompiles/utils/src/testing/mod.rs index 89a10b64..b010452a 100644 --- a/precompiles/utils/src/testing/mod.rs +++ b/precompiles/utils/src/testing/mod.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . pub mod account; pub mod execution; diff --git a/precompiles/utils/src/testing/modifier.rs b/precompiles/utils/src/testing/modifier.rs index 41e3c56f..f004f9c4 100644 --- a/precompiles/utils/src/testing/modifier.rs +++ b/precompiles/utils/src/testing/modifier.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use { crate::{ diff --git a/precompiles/utils/src/testing/solidity.rs b/precompiles/utils/src/testing/solidity.rs index fb3e24dd..f8554b68 100644 --- a/precompiles/utils/src/testing/solidity.rs +++ b/precompiles/utils/src/testing/solidity.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . //! Utility module to interact with solidity file. diff --git a/precompiles/utils/src/tests.rs b/precompiles/utils/src/tests.rs index 8f073935..1d9e2234 100644 --- a/precompiles/utils/src/tests.rs +++ b/precompiles/utils/src/tests.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . use { crate::{ diff --git a/precompiles/utils/tests-external/lib.rs b/precompiles/utils/tests-external/lib.rs index 5537e534..d0a191e3 100644 --- a/precompiles/utils/tests-external/lib.rs +++ b/precompiles/utils/tests-external/lib.rs @@ -1,18 +1,18 @@ // Copyright 2019-2022 PureStake Inc. -// This file is part of Moonbeam. +// This file is part of Stability. -// Moonbeam is free software: you can redistribute it and/or modify +// Stability is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Moonbeam is distributed in the hope that it will be useful, +// Stability is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with Moonbeam. If not, see . +// along with Stability. If not, see . #[cfg(test)] mod tests { diff --git a/stability-rpc/Cargo.toml b/stability-rpc/Cargo.toml index 010166b6..f0ee8811 100644 --- a/stability-rpc/Cargo.toml +++ b/stability-rpc/Cargo.toml @@ -35,7 +35,7 @@ sc-service = { workspace = true } sp-api = { workspace = true } assert_matches = "1.3.0" tokio = "1.17.0" -substrate-test-runtime-client = { workspace = true } +stability-test-runtime-client = { workspace = true } sc-client-api = { workspace = true } pallet-sponsored-transactions = { workspace = true } diff --git a/stability-rpc/src/mock.rs b/stability-rpc/src/mock.rs index 72bdc731..f8e1c103 100644 --- a/stability-rpc/src/mock.rs +++ b/stability-rpc/src/mock.rs @@ -5,7 +5,7 @@ use sp_runtime::{ generic::BlockId, traits::{Block as BlockT, NumberFor, Zero}, }; -use substrate_test_runtime_client::runtime::{Block, Extrinsic, Hash}; +use stability_test_runtime_client::runtime::{Block, Extrinsic, Hash}; pub struct TestApi {} diff --git a/stability-rpc/src/tests.rs b/stability-rpc/src/tests.rs index 2dc92726..435797ff 100644 --- a/stability-rpc/src/tests.rs +++ b/stability-rpc/src/tests.rs @@ -4,7 +4,7 @@ use crate::mock::*; use sp_core::H160; use std::str::FromStr; use std::sync::Arc; -use substrate_test_runtime_client::{self, runtime::Block}; +use stability_test_runtime_client::{self, runtime::Block}; sp_api::mock_impl_runtime_apis! { impl stability_rpc_api::StabilityRpcApi for TestRuntimeApi { diff --git a/test-utils/stability-client/Cargo.toml b/test-utils/stability-client/Cargo.toml new file mode 100644 index 00000000..0b06561d --- /dev/null +++ b/test-utils/stability-client/Cargo.toml @@ -0,0 +1,36 @@ +[package] +name = "stability-test-client" +description = "Client testing utilities" +version = "2.0.1" +authors = ["Stability Solutions"] +edition = "2021" +license = "GPL-3.0-or-later WITH Classpath-exception-2.0" +publish = false + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +array-bytes = { workspace = true } +async-trait = { workspace = true } +codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } +futures = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +sc-client-api = { workspace = true } +sc-client-db = { workspace = true, features = [ + "test-helpers", +] } +sc-consensus = { workspace = true } +sc-executor = { workspace = true } +sc-offchain = { workspace = true } +sc-service = { workspace = true, features = [ + "test-helpers", +] } +sp-blockchain = { workspace = true } +sp-consensus = { workspace = true } +sp-core = { workspace = true } +sp-keyring = { workspace = true } +sp-keystore = { workspace = true } +sp-runtime = { workspace = true } +sp-state-machine = { workspace = true } diff --git a/test-utils/stability-client/src/client_ext.rs b/test-utils/stability-client/src/client_ext.rs new file mode 100644 index 00000000..82a7dd7d --- /dev/null +++ b/test-utils/stability-client/src/client_ext.rs @@ -0,0 +1,209 @@ +// This file is part of Stability. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Client extension for tests. + +use sc_client_api::{backend::Finalizer, client::BlockBackend}; +use sc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy}; +use sc_service::client::Client; +use sp_consensus::{BlockOrigin, Error as ConsensusError}; +use sp_runtime::{traits::Block as BlockT, Justification, Justifications}; + +/// Extension trait for a test client. +pub trait ClientExt: Sized { + /// Finalize a block. + fn finalize_block( + &self, + hash: Block::Hash, + justification: Option, + ) -> sp_blockchain::Result<()>; + + /// Returns hash of the genesis block. + fn genesis_hash(&self) -> ::Hash; +} + +/// Extension trait for a test client around block importing. +#[async_trait::async_trait] +pub trait ClientBlockImportExt: Sized { + /// Import block to the chain. No finality. + async fn import(&mut self, origin: BlockOrigin, block: Block) -> Result<(), ConsensusError>; + + /// Import a block and make it our best block if possible. + async fn import_as_best( + &mut self, + origin: BlockOrigin, + block: Block, + ) -> Result<(), ConsensusError>; + + /// Import a block and finalize it. + async fn import_as_final( + &mut self, + origin: BlockOrigin, + block: Block, + ) -> Result<(), ConsensusError>; + + /// Import block with justification(s), finalizes block. + async fn import_justified( + &mut self, + origin: BlockOrigin, + block: Block, + justifications: Justifications, + ) -> Result<(), ConsensusError>; +} + +impl ClientExt for Client +where + B: sc_client_api::backend::Backend, + E: sc_client_api::CallExecutor + sc_executor::RuntimeVersionOf + 'static, + Self: BlockImport, + Block: BlockT, +{ + fn finalize_block( + &self, + hash: Block::Hash, + justification: Option, + ) -> sp_blockchain::Result<()> { + Finalizer::finalize_block(self, hash, justification, true) + } + + fn genesis_hash(&self) -> ::Hash { + self.block_hash(0u32.into()).unwrap().unwrap() + } +} + +/// This implementation is required, because of the weird api requirements around `BlockImport`. +#[async_trait::async_trait] +impl ClientBlockImportExt for std::sync::Arc +where + for<'r> &'r T: BlockImport, + Transaction: Send + 'static, + T: Send + Sync, +{ + async fn import(&mut self, origin: BlockOrigin, block: Block) -> Result<(), ConsensusError> { + let (header, extrinsics) = block.deconstruct(); + let mut import = BlockImportParams::new(origin, header); + import.body = Some(extrinsics); + import.fork_choice = Some(ForkChoiceStrategy::LongestChain); + + BlockImport::import_block(self, import).await.map(|_| ()) + } + + async fn import_as_best( + &mut self, + origin: BlockOrigin, + block: Block, + ) -> Result<(), ConsensusError> { + let (header, extrinsics) = block.deconstruct(); + let mut import = BlockImportParams::new(origin, header); + import.body = Some(extrinsics); + import.fork_choice = Some(ForkChoiceStrategy::Custom(true)); + + BlockImport::import_block(self, import).await.map(|_| ()) + } + + async fn import_as_final( + &mut self, + origin: BlockOrigin, + block: Block, + ) -> Result<(), ConsensusError> { + let (header, extrinsics) = block.deconstruct(); + let mut import = BlockImportParams::new(origin, header); + import.body = Some(extrinsics); + import.finalized = true; + import.fork_choice = Some(ForkChoiceStrategy::Custom(true)); + + BlockImport::import_block(self, import).await.map(|_| ()) + } + + async fn import_justified( + &mut self, + origin: BlockOrigin, + block: Block, + justifications: Justifications, + ) -> Result<(), ConsensusError> { + let (header, extrinsics) = block.deconstruct(); + let mut import = BlockImportParams::new(origin, header); + import.justifications = Some(justifications); + import.body = Some(extrinsics); + import.finalized = true; + import.fork_choice = Some(ForkChoiceStrategy::LongestChain); + + BlockImport::import_block(self, import).await.map(|_| ()) + } +} + +#[async_trait::async_trait] +impl ClientBlockImportExt for Client +where + Self: BlockImport, + RA: Send, + B: Send + Sync, + E: Send, + >::Transaction: Send, +{ + async fn import(&mut self, origin: BlockOrigin, block: Block) -> Result<(), ConsensusError> { + let (header, extrinsics) = block.deconstruct(); + let mut import = BlockImportParams::new(origin, header); + import.body = Some(extrinsics); + import.fork_choice = Some(ForkChoiceStrategy::LongestChain); + + BlockImport::import_block(self, import).await.map(|_| ()) + } + + async fn import_as_best( + &mut self, + origin: BlockOrigin, + block: Block, + ) -> Result<(), ConsensusError> { + let (header, extrinsics) = block.deconstruct(); + let mut import = BlockImportParams::new(origin, header); + import.body = Some(extrinsics); + import.fork_choice = Some(ForkChoiceStrategy::Custom(true)); + + BlockImport::import_block(self, import).await.map(|_| ()) + } + + async fn import_as_final( + &mut self, + origin: BlockOrigin, + block: Block, + ) -> Result<(), ConsensusError> { + let (header, extrinsics) = block.deconstruct(); + let mut import = BlockImportParams::new(origin, header); + import.body = Some(extrinsics); + import.finalized = true; + import.fork_choice = Some(ForkChoiceStrategy::Custom(true)); + + BlockImport::import_block(self, import).await.map(|_| ()) + } + + async fn import_justified( + &mut self, + origin: BlockOrigin, + block: Block, + justifications: Justifications, + ) -> Result<(), ConsensusError> { + let (header, extrinsics) = block.deconstruct(); + let mut import = BlockImportParams::new(origin, header); + import.justifications = Some(justifications); + import.body = Some(extrinsics); + import.finalized = true; + import.fork_choice = Some(ForkChoiceStrategy::LongestChain); + + BlockImport::import_block(self, import).await.map(|_| ()) + } +} diff --git a/test-utils/stability-client/src/lib.rs b/test-utils/stability-client/src/lib.rs new file mode 100644 index 00000000..9b324918 --- /dev/null +++ b/test-utils/stability-client/src/lib.rs @@ -0,0 +1,476 @@ +// This file is part of Stability. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Client testing utilities. + +#![warn(missing_docs)] + +pub mod client_ext; + +pub use self::client_ext::{ClientBlockImportExt, ClientExt}; +pub use sc_client_api::{ + execution_extensions::{ExecutionExtensions, ExecutionStrategies}, + BadBlocks, ForkBlocks, +}; +pub use sc_client_db::{self, Backend, BlocksPruning}; +pub use sc_executor::{self, NativeElseWasmExecutor, WasmExecutionMethod, WasmExecutor}; +pub use sc_service::{client, RpcHandlers}; +pub use sp_consensus; +pub use sp_keyring::{ + ed25519::Keyring as Ed25519Keyring, sr25519::Keyring as Sr25519Keyring, AccountKeyring, +}; +pub use sp_keystore::{Keystore, KeystorePtr}; +pub use sp_runtime::{Storage, StorageChild}; +pub use sp_state_machine::ExecutionStrategy; + +use futures::{future::Future, stream::StreamExt}; +use sc_client_api::BlockchainEvents; +use sc_service::client::{ClientConfig, LocalCallExecutor}; +use serde::Deserialize; +use sp_core::{storage::ChildInfo, testing::TaskExecutor}; +use sp_runtime::{codec::Encode, traits::Block as BlockT, OpaqueExtrinsic}; +use std::{ + collections::{HashMap, HashSet}, + pin::Pin, + sync::Arc, +}; + +/// A genesis storage initialization trait. +pub trait GenesisInit: Default { + /// Construct genesis storage. + fn genesis_storage(&self) -> Storage; +} + +impl GenesisInit for () { + fn genesis_storage(&self) -> Storage { + Default::default() + } +} + +/// A builder for creating a test client instance. +pub struct TestClientBuilder { + execution_strategies: ExecutionStrategies, + genesis_init: G, + /// The key is an unprefixed storage key, this only contains + /// default child trie content. + child_storage_extension: HashMap, StorageChild>, + backend: Arc, + _executor: std::marker::PhantomData, + keystore: Option, + fork_blocks: ForkBlocks, + bad_blocks: BadBlocks, + enable_offchain_indexing_api: bool, + no_genesis: bool, +} + +impl Default + for TestClientBuilder, G> +{ + fn default() -> Self { + Self::with_default_backend() + } +} + +impl + TestClientBuilder, G> +{ + /// Create new `TestClientBuilder` with default backend. + pub fn with_default_backend() -> Self { + let backend = Arc::new(Backend::new_test(std::u32::MAX, std::u64::MAX)); + Self::with_backend(backend) + } + + /// Create new `TestClientBuilder` with default backend and pruning window size + pub fn with_pruning_window(blocks_pruning: u32) -> Self { + let backend = Arc::new(Backend::new_test(blocks_pruning, 0)); + Self::with_backend(backend) + } + + /// Create new `TestClientBuilder` with default backend and storage chain mode + pub fn with_tx_storage(blocks_pruning: u32) -> Self { + let backend = + Arc::new(Backend::new_test_with_tx_storage(BlocksPruning::Some(blocks_pruning), 0)); + Self::with_backend(backend) + } +} + +impl + TestClientBuilder +{ + /// Create a new instance of the test client builder. + pub fn with_backend(backend: Arc) -> Self { + TestClientBuilder { + backend, + execution_strategies: ExecutionStrategies::default(), + child_storage_extension: Default::default(), + genesis_init: Default::default(), + _executor: Default::default(), + keystore: None, + fork_blocks: None, + bad_blocks: None, + enable_offchain_indexing_api: false, + no_genesis: false, + } + } + + /// Set the keystore that should be used by the externalities. + pub fn set_keystore(mut self, keystore: KeystorePtr) -> Self { + self.keystore = Some(keystore); + self + } + + /// Alter the genesis storage parameters. + pub fn genesis_init_mut(&mut self) -> &mut G { + &mut self.genesis_init + } + + /// Give access to the underlying backend of these clients + pub fn backend(&self) -> Arc { + self.backend.clone() + } + + /// Extend child storage + pub fn add_child_storage( + mut self, + child_info: &ChildInfo, + key: impl AsRef<[u8]>, + value: impl AsRef<[u8]>, + ) -> Self { + let storage_key = child_info.storage_key(); + let entry = self.child_storage_extension.entry(storage_key.to_vec()).or_insert_with(|| { + StorageChild { data: Default::default(), child_info: child_info.clone() } + }); + entry.data.insert(key.as_ref().to_vec(), value.as_ref().to_vec()); + self + } + + /// Set the execution strategy that should be used by all contexts. + pub fn set_execution_strategy(mut self, execution_strategy: ExecutionStrategy) -> Self { + self.execution_strategies = ExecutionStrategies { + syncing: execution_strategy, + importing: execution_strategy, + block_construction: execution_strategy, + offchain_worker: execution_strategy, + other: execution_strategy, + }; + self + } + + /// Sets custom block rules. + pub fn set_block_rules( + mut self, + fork_blocks: ForkBlocks, + bad_blocks: BadBlocks, + ) -> Self { + self.fork_blocks = fork_blocks; + self.bad_blocks = bad_blocks; + self + } + + /// Enable the offchain indexing api. + pub fn enable_offchain_indexing_api(mut self) -> Self { + self.enable_offchain_indexing_api = true; + self + } + + /// Disable writing genesis. + pub fn set_no_genesis(mut self) -> Self { + self.no_genesis = true; + self + } + + /// Build the test client with the given native executor. + pub fn build_with_executor( + self, + executor: ExecutorDispatch, + ) -> ( + client::Client, + sc_consensus::LongestChain, + ) + where + ExecutorDispatch: + sc_client_api::CallExecutor + sc_executor::RuntimeVersionOf + Clone + 'static, + Backend: sc_client_api::backend::Backend, + >::OffchainStorage: 'static, + { + let storage = { + let mut storage = self.genesis_init.genesis_storage(); + // Add some child storage keys. + for (key, child_content) in self.child_storage_extension { + storage.children_default.insert( + key, + StorageChild { + data: child_content.data.into_iter().collect(), + child_info: child_content.child_info, + }, + ); + } + + storage + }; + + let client_config = ClientConfig { + offchain_indexing_api: self.enable_offchain_indexing_api, + no_genesis: self.no_genesis, + ..Default::default() + }; + + let genesis_block_builder = sc_service::GenesisBlockBuilder::new( + &storage, + !client_config.no_genesis, + self.backend.clone(), + executor.clone(), + ) + .expect("Creates genesis block builder"); + + let spawn_handle = Box::new(TaskExecutor::new()); + + let client = client::Client::new( + self.backend.clone(), + executor, + spawn_handle, + genesis_block_builder, + self.fork_blocks, + self.bad_blocks, + None, + None, + client_config, + ) + .expect("Creates new client"); + + let longest_chain = sc_consensus::LongestChain::new(self.backend); + + (client, longest_chain) + } +} + +impl + TestClientBuilder< + Block, + client::LocalCallExecutor>, + Backend, + G, + > where + D: sc_executor::NativeExecutionDispatch, +{ + /// Build the test client with the given native executor. + pub fn build_with_native_executor( + self, + executor: I, + ) -> ( + client::Client< + Backend, + client::LocalCallExecutor>, + Block, + RuntimeApi, + >, + sc_consensus::LongestChain, + ) + where + I: Into>>, + D: sc_executor::NativeExecutionDispatch + 'static, + Backend: sc_client_api::backend::Backend + 'static, + { + let executor = executor.into().unwrap_or_else(|| { + NativeElseWasmExecutor::new_with_wasm_executor(WasmExecutor::builder().build()) + }); + let executor = LocalCallExecutor::new( + self.backend.clone(), + executor.clone(), + Default::default(), + ExecutionExtensions::new( + self.execution_strategies.clone(), + self.keystore.clone(), + sc_offchain::OffchainDb::factory_from_backend(&*self.backend), + Arc::new(executor), + ), + ) + .expect("Creates LocalCallExecutor"); + + self.build_with_executor(executor) + } +} + +/// The output of an RPC transaction. +pub struct RpcTransactionOutput { + /// The output string of the transaction if any. + pub result: String, + /// An async receiver if data will be returned via a callback. + pub receiver: futures::channel::mpsc::UnboundedReceiver, +} + +impl std::fmt::Debug for RpcTransactionOutput { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + write!(f, "RpcTransactionOutput {{ result: {:?}, receiver }}", self.result) + } +} + +/// An error for when the RPC call fails. +#[derive(Deserialize, Debug)] +pub struct RpcTransactionError { + /// A Number that indicates the error type that occurred. + pub code: i64, + /// A String providing a short description of the error. + pub message: String, + /// A Primitive or Structured value that contains additional information about the error. + pub data: Option, +} + +impl std::fmt::Display for RpcTransactionError { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + std::fmt::Debug::fmt(self, f) + } +} + +/// An extension trait for `RpcHandlers`. +#[async_trait::async_trait] +pub trait RpcHandlersExt { + /// Send a transaction through the RpcHandlers. + async fn send_transaction( + &self, + extrinsic: OpaqueExtrinsic, + ) -> Result; +} + +#[async_trait::async_trait] +impl RpcHandlersExt for RpcHandlers { + async fn send_transaction( + &self, + extrinsic: OpaqueExtrinsic, + ) -> Result { + let (result, rx) = self + .rpc_query(&format!( + r#"{{ + "jsonrpc": "2.0", + "method": "author_submitExtrinsic", + "params": ["0x{}"], + "id": 0 + }}"#, + array_bytes::bytes2hex("", &extrinsic.encode()) + )) + .await + .expect("valid JSON-RPC request object; qed"); + parse_rpc_result(result, rx) + } +} + +pub(crate) fn parse_rpc_result( + result: String, + receiver: futures::channel::mpsc::UnboundedReceiver, +) -> Result { + let json: serde_json::Value = + serde_json::from_str(&result).expect("the result can only be a JSONRPC string; qed"); + let error = json.as_object().expect("JSON result is always an object; qed").get("error"); + + if let Some(error) = error { + return Err(serde_json::from_value(error.clone()) + .expect("the JSONRPC result's error is always valid; qed")) + } + + Ok(RpcTransactionOutput { result, receiver }) +} + +/// An extension trait for `BlockchainEvents`. +pub trait BlockchainEventsExt +where + C: BlockchainEvents, + B: BlockT, +{ + /// Wait for `count` blocks to be imported in the node and then exit. This function will not + /// return if no blocks are ever created, thus you should restrict the maximum amount of time of + /// the test execution. + fn wait_for_blocks(&self, count: usize) -> Pin + Send>>; +} + +impl BlockchainEventsExt for C +where + C: BlockchainEvents, + B: BlockT, +{ + fn wait_for_blocks(&self, count: usize) -> Pin + Send>> { + assert!(count > 0, "'count' argument must be greater than 0"); + + let mut import_notification_stream = self.import_notification_stream(); + let mut blocks = HashSet::new(); + + Box::pin(async move { + while let Some(notification) = import_notification_stream.next().await { + if notification.is_new_best { + blocks.insert(notification.hash); + if blocks.len() == count { + break + } + } + } + }) + } +} + +#[cfg(test)] +mod tests { + #[test] + fn parses_error_properly() { + let (_, rx) = futures::channel::mpsc::unbounded(); + assert!(super::parse_rpc_result( + r#"{ + "jsonrpc": "2.0", + "result": 19, + "id": 1 + }"# + .to_string(), + rx + ) + .is_ok()); + + let (_, rx) = futures::channel::mpsc::unbounded(); + let error = super::parse_rpc_result( + r#"{ + "jsonrpc": "2.0", + "error": { + "code": -32601, + "message": "Method not found" + }, + "id": 1 + }"# + .to_string(), + rx, + ) + .unwrap_err(); + assert_eq!(error.code, -32601); + assert_eq!(error.message, "Method not found"); + assert!(error.data.is_none()); + + let (_, rx) = futures::channel::mpsc::unbounded(); + let error = super::parse_rpc_result( + r#"{ + "jsonrpc": "2.0", + "error": { + "code": -32601, + "message": "Method not found", + "data": 42 + }, + "id": 1 + }"# + .to_string(), + rx, + ) + .unwrap_err(); + assert_eq!(error.code, -32601); + assert_eq!(error.message, "Method not found"); + assert!(error.data.is_some()); + } +} diff --git a/test-utils/stability-debug-derive/Cargo.toml b/test-utils/stability-debug-derive/Cargo.toml new file mode 100644 index 00000000..cdb0bd83 --- /dev/null +++ b/test-utils/stability-debug-derive/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "stability-sp-debug-derive" +version = "5.0.0" +authors = ["Stability Solutions"] +edition = "2021" +license = "GPL-3.0-or-later WITH Classpath-exception-2.0" +publish = false + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[lib] +proc-macro = true + +[dependencies] +quote = { workspace = true } +syn = { workspace = true } +proc-macro2 = { workspace = true } + +[features] +default = [ "std" ] +std = [] +# By default `RuntimeDebug` implements `Debug` that outputs `` when `std` is +# disabled. However, sometimes downstream users need to have the real `Debug` implementation for +# debugging purposes. If this is required, a user only needs to add this crate as a dependency of +# their runtime and enable the `force-debug` feature. +force-debug = [] + +[dev-dependencies] diff --git a/test-utils/stability-debug-derive/src/impls.rs b/test-utils/stability-debug-derive/src/impls.rs new file mode 100644 index 00000000..868fab43 --- /dev/null +++ b/test-utils/stability-debug-derive/src/impls.rs @@ -0,0 +1,187 @@ +// This file is part of Stability. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use proc_macro2::TokenStream; +use quote::quote; +use syn::{parse_quote, Data, DeriveInput}; + +pub fn debug_derive(ast: DeriveInput) -> proc_macro::TokenStream { + let name_str = ast.ident.to_string(); + let implementation = implementation::derive(&name_str, &ast.data); + let name = &ast.ident; + let mut generics = ast.generics.clone(); + let (impl_generics, ty_generics, where_clause) = { + let wh = generics.make_where_clause(); + for t in ast.generics.type_params() { + let name = &t.ident; + wh.predicates.push(parse_quote! { #name : core::fmt::Debug }); + } + generics.split_for_impl() + }; + let gen = quote! { + impl #impl_generics core::fmt::Debug for #name #ty_generics #where_clause { + fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result { + #implementation + } + } + }; + + gen.into() +} + +#[cfg(all(not(feature = "std"), not(feature = "force-debug")))] +mod implementation { + use super::*; + + /// Derive the inner implementation of `Debug::fmt` function. + /// + /// Non-std environment. We do nothing to prevent bloating the size of runtime. + /// Implement `Printable` if you need to print the details. + pub fn derive(_name_str: &str, _data: &Data) -> TokenStream { + quote! { + fmt.write_str("") + } + } +} + +#[cfg(any(feature = "std", feature = "force-debug"))] +mod implementation { + use super::*; + use proc_macro2::Span; + use syn::{token::SelfValue, Ident, Index}; + + /// Derive the inner implementation of `Debug::fmt` function. + pub fn derive(name_str: &str, data: &Data) -> TokenStream { + match *data { + Data::Struct(ref s) => derive_struct(name_str, &s.fields), + Data::Union(ref u) => derive_fields(name_str, Fields::new(u.fields.named.iter(), None)), + Data::Enum(ref e) => derive_enum(name_str, e), + } + } + + enum Fields { + Indexed { indices: Vec }, + Unnamed { vars: Vec }, + Named { names: Vec, this: Option }, + } + + impl Fields { + fn new<'a>(fields: impl Iterator, this: Option) -> Self { + let mut indices = vec![]; + let mut names = vec![]; + + for (i, f) in fields.enumerate() { + if let Some(ident) = f.ident.clone() { + names.push(ident); + } else { + indices.push(Index::from(i)); + } + } + + if names.is_empty() { + Self::Indexed { indices } + } else { + Self::Named { names, this } + } + } + } + + fn derive_fields(name_str: &str, fields: Fields) -> TokenStream { + match fields { + Fields::Named { names, this } => { + let names_str: Vec<_> = names.iter().map(|x| x.to_string()).collect(); + + let fields = match this { + None => quote! { #( .field(#names_str, #names) )* }, + Some(this) => quote! { #( .field(#names_str, &#this.#names) )* }, + }; + + quote! { + fmt.debug_struct(#name_str) + #fields + .finish() + } + }, + Fields::Indexed { indices } => { + quote! { + fmt.debug_tuple(#name_str) + #( .field(&self.#indices) )* + .finish() + } + }, + Fields::Unnamed { vars } => { + quote! { + fmt.debug_tuple(#name_str) + #( .field(#vars) )* + .finish() + } + }, + } + } + + fn derive_enum(name: &str, e: &syn::DataEnum) -> TokenStream { + let v = e.variants.iter().map(|v| { + let name = format!("{}::{}", name, v.ident); + let ident = &v.ident; + match v.fields { + syn::Fields::Named(ref f) => { + let names: Vec<_> = f.named.iter().flat_map(|f| f.ident.clone()).collect(); + let fields_impl = + derive_fields(&name, Fields::Named { names: names.clone(), this: None }); + (ident, (quote! { { #( ref #names ),* } }, fields_impl)) + }, + syn::Fields::Unnamed(ref f) => { + let names = f + .unnamed + .iter() + .enumerate() + .map(|(id, _)| Ident::new(&format!("a{}", id), Span::call_site())) + .collect::>(); + let fields_impl = derive_fields(&name, Fields::Unnamed { vars: names.clone() }); + (ident, (quote! { ( #( ref #names ),* ) }, fields_impl)) + }, + syn::Fields::Unit => { + let fields_impl = derive_fields(&name, Fields::Indexed { indices: vec![] }); + (ident, (quote! {}, fields_impl)) + }, + } + }); + + type Vecs = (Vec, Vec); + let (variants, others): Vecs<_, _> = v.unzip(); + let (match_fields, variants_impl): Vecs<_, _> = others.into_iter().unzip(); + + quote! { + match self { + #( Self::#variants #match_fields => #variants_impl, )* + _ => Ok(()), + } + } + } + + fn derive_struct(name_str: &str, fields: &syn::Fields) -> TokenStream { + match *fields { + syn::Fields::Named(ref f) => derive_fields( + name_str, + Fields::new(f.named.iter(), Some(syn::Token!(self)(Span::call_site()))), + ), + syn::Fields::Unnamed(ref f) => + derive_fields(name_str, Fields::new(f.unnamed.iter(), None)), + syn::Fields::Unit => derive_fields(name_str, Fields::Indexed { indices: vec![] }), + } + } +} diff --git a/test-utils/stability-debug-derive/src/lib.rs b/test-utils/stability-debug-derive/src/lib.rs new file mode 100644 index 00000000..2c4bb676 --- /dev/null +++ b/test-utils/stability-debug-derive/src/lib.rs @@ -0,0 +1,42 @@ +// This file is part of Stability. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Macros to derive runtime debug implementation. +//! +//! This custom derive implements a `core::fmt::Debug` trait, +//! but in case the `std` feature is enabled the implementation +//! will actually print out the structure as regular `derive(Debug)` +//! would do. If `std` is disabled the implementation will be empty. +//! +//! This behaviour is useful to prevent bloating the runtime WASM +//! blob from unneeded code. +//! +//! ```rust +//! #[derive(stability_sp_debug_derive::RuntimeDebug)] +//! struct MyStruct; +//! +//! assert_eq!(format!("{:?}", MyStruct), "MyStruct"); +//! ``` + +mod impls; + +use proc_macro::TokenStream; + +#[proc_macro_derive(RuntimeDebug)] +pub fn debug_derive(input: TokenStream) -> TokenStream { + impls::debug_derive(syn::parse_macro_input!(input)) +} diff --git a/test-utils/stability-debug-derive/tests/tests.rs b/test-utils/stability-debug-derive/tests/tests.rs new file mode 100644 index 00000000..2c7ca27b --- /dev/null +++ b/test-utils/stability-debug-derive/tests/tests.rs @@ -0,0 +1,48 @@ +// This file is part of Stability. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use stability_sp_debug_derive::RuntimeDebug; + +#[derive(RuntimeDebug)] +struct Unnamed(u64, String); + +#[derive(RuntimeDebug)] +struct Named { + a: u64, + b: String, +} + +#[derive(RuntimeDebug)] +enum EnumLongName { + A, + B(A, String), + VariantLongName { a: A, b: String }, +} + +#[test] +fn should_display_proper_debug() { + use self::EnumLongName as Enum; + + assert_eq!(format!("{:?}", Unnamed(1, "abc".into())), "Unnamed(1, \"abc\")"); + assert_eq!(format!("{:?}", Named { a: 1, b: "abc".into() }), "Named { a: 1, b: \"abc\" }"); + assert_eq!(format!("{:?}", Enum::::A), "EnumLongName::A"); + assert_eq!(format!("{:?}", Enum::B(1, "abc".into())), "EnumLongName::B(1, \"abc\")"); + assert_eq!( + format!("{:?}", Enum::VariantLongName { a: 1, b: "abc".into() }), + "EnumLongName::VariantLongName { a: 1, b: \"abc\" }" + ); +} diff --git a/test-utils/stability-root-testing/Cargo.toml b/test-utils/stability-root-testing/Cargo.toml new file mode 100644 index 00000000..40562b82 --- /dev/null +++ b/test-utils/stability-root-testing/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "stability-pallet-root-testing" +version = "1.0.0-dev" +authors = ["Stability Solutions"] +edition = "2021" +license = "GPL-3.0-or-later WITH Classpath-exception-2.0" +publish = false + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } +scale-info = { workspace = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +sp-core = { workspace = true } +sp-io = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } + +[features] +try-runtime = ["frame-support/try-runtime"] +default = ["std"] +std = [ + "codec/std", + "frame-support/std", + "frame-system/std", + "scale-info/std", + "sp-runtime/std", +] diff --git a/test-utils/stability-root-testing/README.md b/test-utils/stability-root-testing/README.md new file mode 100644 index 00000000..63743044 --- /dev/null +++ b/test-utils/stability-root-testing/README.md @@ -0,0 +1,5 @@ +# Root Testing Pallet + +Pallet that contains extrinsics that can be usefull in testing. + +NOTE: This pallet should only be used for testing purposes and should not be used in production runtimes! \ No newline at end of file diff --git a/test-utils/stability-root-testing/src/lib.rs b/test-utils/stability-root-testing/src/lib.rs new file mode 100644 index 00000000..15c5934b --- /dev/null +++ b/test-utils/stability-root-testing/src/lib.rs @@ -0,0 +1,54 @@ +// This file is part of Stability. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! # Root Testing Pallet +//! +//! Pallet that contains extrinsics that can be usefull in testing. +//! +//! NOTE: This pallet should only be used for testing purposes and should not be used in production +//! runtimes! + +#![cfg_attr(not(feature = "std"), no_std)] + +use frame_support::dispatch::DispatchResult; +use sp_runtime::Perbill; + +pub use pallet::*; + +#[frame_support::pallet] +pub mod pallet { + use super::*; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::*; + + #[pallet::config] + pub trait Config: frame_system::Config {} + + #[pallet::pallet] + pub struct Pallet(_); + + #[pallet::call] + impl Pallet { + /// A dispatch that will fill the block weight up to the given ratio. + #[pallet::call_index(0)] + #[pallet::weight(*_ratio * T::BlockWeights::get().max_block)] + pub fn fill_block(origin: OriginFor, _ratio: Perbill) -> DispatchResult { + ensure_root(origin)?; + Ok(()) + } + } +} diff --git a/test-utils/stability-runtime-client/Cargo.toml b/test-utils/stability-runtime-client/Cargo.toml new file mode 100644 index 00000000..fe31b0ad --- /dev/null +++ b/test-utils/stability-runtime-client/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "stability-test-runtime-client" +version = "2.0.0" +authors = ["Stability Solutions"] +edition = "2021" +license = "GPL-3.0-or-later WITH Classpath-exception-2.0" +publish = false + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } +futures = { workspace = true } +sc-block-builder = { workspace = true } +sc-chain-spec = { workspace = true } +sc-client-api = { workspace = true } +sc-consensus = { workspace = true } +sp-api = { workspace = true } +sp-blockchain = { workspace = true } +sp-consensus = { workspace = true } +sp-core = { workspace = true } +sp-runtime = { workspace = true } +stability-test-client = { workspace = true } +stability-test-runtime = { workspace = true } diff --git a/test-utils/stability-runtime-client/src/block_builder_ext.rs b/test-utils/stability-runtime-client/src/block_builder_ext.rs new file mode 100644 index 00000000..43d4c487 --- /dev/null +++ b/test-utils/stability-runtime-client/src/block_builder_ext.rs @@ -0,0 +1,80 @@ +// This file is part of Stability. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Block Builder extensions for tests. + +use sc_client_api::backend; +use sp_api::{ApiExt, ProvideRuntimeApi}; + +use sc_block_builder::BlockBuilderApi; +use stability_test_runtime::*; + +/// Extension trait for test block builder. +pub trait BlockBuilderExt { + /// Add transfer extrinsic to the block. + fn push_transfer( + &mut self, + transfer: stability_test_runtime::Transfer, + ) -> Result<(), sp_blockchain::Error>; + + /// Add unsigned storage change extrinsic to the block. + fn push_storage_change( + &mut self, + key: Vec, + value: Option>, + ) -> Result<(), sp_blockchain::Error>; + + /// Adds an extrinsic which pushes DigestItem to header's log + fn push_deposit_log_digest_item( + &mut self, + log: sp_runtime::generic::DigestItem, + ) -> Result<(), sp_blockchain::Error>; +} + +impl<'a, A, B> BlockBuilderExt + for sc_block_builder::BlockBuilder<'a, stability_test_runtime::Block, A, B> +where + A: ProvideRuntimeApi + 'a, + A::Api: BlockBuilderApi + + ApiExt< + stability_test_runtime::Block, + StateBackend = backend::StateBackendFor, + >, + B: backend::Backend, +{ + fn push_transfer( + &mut self, + transfer: stability_test_runtime::Transfer, + ) -> Result<(), sp_blockchain::Error> { + self.push(transfer.into_unchecked_extrinsic()) + } + + fn push_storage_change( + &mut self, + key: Vec, + value: Option>, + ) -> Result<(), sp_blockchain::Error> { + self.push(ExtrinsicBuilder::new_storage_change(key, value).build()) + } + + fn push_deposit_log_digest_item( + &mut self, + log: sp_runtime::generic::DigestItem, + ) -> Result<(), sp_blockchain::Error> { + self.push(ExtrinsicBuilder::new_deposit_log_digest_item(log).build()) + } +} diff --git a/test-utils/stability-runtime-client/src/lib.rs b/test-utils/stability-runtime-client/src/lib.rs new file mode 100644 index 00000000..9ba46282 --- /dev/null +++ b/test-utils/stability-runtime-client/src/lib.rs @@ -0,0 +1,244 @@ +// This file is part of Stability. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Client testing utilities. + +#![warn(missing_docs)] + +pub mod trait_tests; + +mod block_builder_ext; + +pub use sc_consensus::LongestChain; +use std::sync::Arc; +pub use stability_test_client::*; +pub use stability_test_runtime as runtime; + +pub use self::block_builder_ext::BlockBuilderExt; + +use sp_core::storage::{ChildInfo, Storage, StorageChild}; +use stability_test_client::sc_executor::WasmExecutor; +use stability_test_runtime::genesismap::GenesisStorageBuilder; + +/// A prelude to import in tests. +pub mod prelude { + // Trait extensions + pub use super::{ + BlockBuilderExt, ClientBlockImportExt, ClientExt, DefaultTestClientBuilderExt, + TestClientBuilderExt, + }; + // Client structs + pub use super::{ + Backend, ExecutorDispatch, LocalExecutorDispatch, NativeElseWasmExecutor, TestClient, + TestClientBuilder, WasmExecutionMethod, + }; + // Keyring + pub use super::{AccountKeyring, Sr25519Keyring}; +} + +/// A unit struct which implements `NativeExecutionDispatch` feeding in the +/// hard-coded runtime. +pub struct LocalExecutorDispatch; + +impl sc_executor::NativeExecutionDispatch for LocalExecutorDispatch { + type ExtendHostFunctions = (); + + fn dispatch(method: &str, data: &[u8]) -> Option> { + stability_test_runtime::api::dispatch(method, data) + } + + fn native_version() -> sc_executor::NativeVersion { + stability_test_runtime::native_version() + } +} + +/// Test client database backend. +pub type Backend = stability_test_client::Backend; + +/// Test client executor. +pub type ExecutorDispatch = client::LocalCallExecutor< + stability_test_runtime::Block, + Backend, + NativeElseWasmExecutor, +>; + +/// Parameters of test-client builder with test-runtime. +#[derive(Default)] +pub struct GenesisParameters { + heap_pages_override: Option, + extra_storage: Storage, + wasm_code: Option>, +} + +impl GenesisParameters { + /// Set the wasm code that should be used at genesis. + pub fn set_wasm_code(&mut self, code: Vec) { + self.wasm_code = Some(code); + } + + /// Access extra genesis storage. + pub fn extra_storage(&mut self) -> &mut Storage { + &mut self.extra_storage + } +} + +impl GenesisInit for GenesisParameters { + fn genesis_storage(&self) -> Storage { + GenesisStorageBuilder::default() + .with_heap_pages(self.heap_pages_override) + .with_wasm_code(&self.wasm_code) + .with_extra_storage(self.extra_storage.clone()) + .build() + } +} + +/// A `TestClient` with `test-runtime` builder. +pub type TestClientBuilder = stability_test_client::TestClientBuilder< + stability_test_runtime::Block, + E, + B, + GenesisParameters, +>; + +/// Test client type with `LocalExecutorDispatch` and generic Backend. +pub type Client = client::Client< + B, + client::LocalCallExecutor< + stability_test_runtime::Block, + B, + NativeElseWasmExecutor, + >, + stability_test_runtime::Block, + stability_test_runtime::RuntimeApi, +>; + +/// A test client with default backend. +pub type TestClient = Client; + +/// A `TestClientBuilder` with default backend and executor. +pub trait DefaultTestClientBuilderExt: Sized { + /// Create new `TestClientBuilder` + fn new() -> Self; +} + +impl DefaultTestClientBuilderExt for TestClientBuilder { + fn new() -> Self { + Self::with_default_backend() + } +} + +/// A `test-runtime` extensions to `TestClientBuilder`. +pub trait TestClientBuilderExt: Sized { + /// Returns a mutable reference to the genesis parameters. + fn genesis_init_mut(&mut self) -> &mut GenesisParameters; + + /// Override the default value for Wasm heap pages. + fn set_heap_pages(mut self, heap_pages: u64) -> Self { + self.genesis_init_mut().heap_pages_override = Some(heap_pages); + self + } + + /// Add an extra value into the genesis storage. + /// + /// # Panics + /// + /// Panics if the key is empty. + fn add_extra_child_storage>, V: Into>>( + mut self, + child_info: &ChildInfo, + key: K, + value: V, + ) -> Self { + let storage_key = child_info.storage_key().to_vec(); + let key = key.into(); + assert!(!storage_key.is_empty()); + assert!(!key.is_empty()); + self.genesis_init_mut() + .extra_storage + .children_default + .entry(storage_key) + .or_insert_with(|| StorageChild { + data: Default::default(), + child_info: child_info.clone(), + }) + .data + .insert(key, value.into()); + self + } + + /// Add an extra child value into the genesis storage. + /// + /// # Panics + /// + /// Panics if the key is empty. + fn add_extra_storage>, V: Into>>(mut self, key: K, value: V) -> Self { + let key = key.into(); + assert!(!key.is_empty()); + self.genesis_init_mut().extra_storage.top.insert(key, value.into()); + self + } + + /// Build the test client. + fn build(self) -> Client { + self.build_with_longest_chain().0 + } + + /// Build the test client and longest chain selector. + fn build_with_longest_chain( + self, + ) -> (Client, sc_consensus::LongestChain); + + /// Build the test client and the backend. + fn build_with_backend(self) -> (Client, Arc); +} + +impl TestClientBuilderExt + for TestClientBuilder< + client::LocalCallExecutor< + stability_test_runtime::Block, + B, + NativeElseWasmExecutor, + >, + B, + > where + B: sc_client_api::backend::Backend + 'static, +{ + fn genesis_init_mut(&mut self) -> &mut GenesisParameters { + Self::genesis_init_mut(self) + } + + fn build_with_longest_chain( + self, + ) -> (Client, sc_consensus::LongestChain) { + self.build_with_native_executor(None) + } + + fn build_with_backend(self) -> (Client, Arc) { + let backend = self.backend(); + (self.build_with_native_executor(None).0, backend) + } +} + +/// Creates new client instance used for tests. +pub fn new() -> Client { + TestClientBuilder::new().build() +} + +/// Create a new native executor. +pub fn new_native_or_wasm_executor() -> NativeElseWasmExecutor { + NativeElseWasmExecutor::new_with_wasm_executor(WasmExecutor::builder().build()) +} diff --git a/test-utils/stability-runtime-client/src/trait_tests.rs b/test-utils/stability-runtime-client/src/trait_tests.rs new file mode 100644 index 00000000..7137368a --- /dev/null +++ b/test-utils/stability-runtime-client/src/trait_tests.rs @@ -0,0 +1,421 @@ +// This file is part of Stability. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! tests that should hold for all implementations of certain traits. +//! to test implementations without duplication. + +#![allow(missing_docs)] + +use std::sync::Arc; + +use crate::{ + AccountKeyring, BlockBuilderExt, ClientBlockImportExt, TestClientBuilder, TestClientBuilderExt, +}; +use futures::executor::block_on; +use sc_block_builder::BlockBuilderProvider; +use sc_client_api::{ + backend, + blockchain::{Backend as BlockChainBackendT, HeaderBackend}, +}; +use sp_consensus::BlockOrigin; +use sp_runtime::traits::Block as BlockT; +use stability_test_runtime::{self, Transfer}; + +/// helper to test the `leaves` implementation for various backends +pub fn test_leaves_for_backend(backend: Arc) +where + B: backend::Backend, +{ + // block tree: + // G -> A1 -> A2 -> A3 -> A4 -> A5 + // A1 -> B2 -> B3 -> B4 + // B2 -> C3 + // A1 -> D2 + + let mut client = TestClientBuilder::with_backend(backend.clone()).build(); + let blockchain = backend.blockchain(); + + let genesis_hash = client.chain_info().genesis_hash; + + assert_eq!(blockchain.leaves().unwrap(), vec![genesis_hash]); + + // G -> A1 + let a1 = client.new_block(Default::default()).unwrap().build().unwrap().block; + block_on(client.import(BlockOrigin::Own, a1.clone())).unwrap(); + assert_eq!(blockchain.leaves().unwrap(), vec![a1.hash()]); + + // A1 -> A2 + let a2 = client + .new_block_at(a1.hash(), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a2.clone())).unwrap(); + + assert_eq!(blockchain.leaves().unwrap(), vec![a2.hash()]); + + // A2 -> A3 + let a3 = client + .new_block_at(a2.hash(), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a3.clone())).unwrap(); + + assert_eq!(blockchain.leaves().unwrap(), vec![a3.hash()]); + + // A3 -> A4 + let a4 = client + .new_block_at(a3.hash(), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a4.clone())).unwrap(); + assert_eq!(blockchain.leaves().unwrap(), vec![a4.hash()]); + + // A4 -> A5 + let a5 = client + .new_block_at(a4.hash(), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + + block_on(client.import(BlockOrigin::Own, a5.clone())).unwrap(); + assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash()]); + + // A1 -> B2 + let mut builder = client.new_block_at(a1.hash(), Default::default(), false).unwrap(); + + // this push is required as otherwise B2 has the same hash as A2 and won't get imported + builder + .push_transfer(Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Ferdie.into(), + amount: 41, + nonce: 0, + }) + .unwrap(); + let b2 = builder.build().unwrap().block; + block_on(client.import(BlockOrigin::Own, b2.clone())).unwrap(); + assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash(), b2.hash()]); + + // B2 -> B3 + let b3 = client + .new_block_at(b2.hash(), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + + block_on(client.import(BlockOrigin::Own, b3.clone())).unwrap(); + assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash(), b3.hash()]); + + // B3 -> B4 + let b4 = client + .new_block_at(b3.hash(), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, b4.clone())).unwrap(); + assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash(), b4.hash()]); + + // // B2 -> C3 + let mut builder = client.new_block_at(b2.hash(), Default::default(), false).unwrap(); + // this push is required as otherwise C3 has the same hash as B3 and won't get imported + builder + .push_transfer(Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Ferdie.into(), + amount: 1, + nonce: 1, + }) + .unwrap(); + let c3 = builder.build().unwrap().block; + block_on(client.import(BlockOrigin::Own, c3.clone())).unwrap(); + assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash(), b4.hash(), c3.hash()]); + + // A1 -> D2 + let mut builder = client.new_block_at(a1.hash(), Default::default(), false).unwrap(); + // this push is required as otherwise D2 has the same hash as B2 and won't get imported + builder + .push_transfer(Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Ferdie.into(), + amount: 1, + nonce: 0, + }) + .unwrap(); + let d2 = builder.build().unwrap().block; + block_on(client.import(BlockOrigin::Own, d2.clone())).unwrap(); + assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash(), b4.hash(), c3.hash(), d2.hash()]); +} + +/// helper to test the `children` implementation for various backends +pub fn test_children_for_backend(backend: Arc) +where + B: backend::LocalBackend, +{ + // block tree: + // G -> A1 -> A2 -> A3 -> A4 -> A5 + // A1 -> B2 -> B3 -> B4 + // B2 -> C3 + // A1 -> D2 + + let mut client = TestClientBuilder::with_backend(backend.clone()).build(); + let blockchain = backend.blockchain(); + + // G -> A1 + let a1 = client.new_block(Default::default()).unwrap().build().unwrap().block; + block_on(client.import(BlockOrigin::Own, a1.clone())).unwrap(); + + // A1 -> A2 + let a2 = client + .new_block_at(a1.hash(), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a2.clone())).unwrap(); + + // A2 -> A3 + let a3 = client + .new_block_at(a2.hash(), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a3.clone())).unwrap(); + + // A3 -> A4 + let a4 = client + .new_block_at(a3.hash(), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a4.clone())).unwrap(); + + // A4 -> A5 + let a5 = client + .new_block_at(a4.hash(), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a5.clone())).unwrap(); + + // A1 -> B2 + let mut builder = client.new_block_at(a1.hash(), Default::default(), false).unwrap(); + // this push is required as otherwise B2 has the same hash as A2 and won't get imported + builder + .push_transfer(Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Ferdie.into(), + amount: 41, + nonce: 0, + }) + .unwrap(); + let b2 = builder.build().unwrap().block; + block_on(client.import(BlockOrigin::Own, b2.clone())).unwrap(); + + // B2 -> B3 + let b3 = client + .new_block_at(b2.hash(), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, b3.clone())).unwrap(); + + // B3 -> B4 + let b4 = client + .new_block_at(b3.hash(), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, b4)).unwrap(); + + // // B2 -> C3 + let mut builder = client.new_block_at(b2.hash(), Default::default(), false).unwrap(); + // this push is required as otherwise C3 has the same hash as B3 and won't get imported + builder + .push_transfer(Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Ferdie.into(), + amount: 1, + nonce: 1, + }) + .unwrap(); + let c3 = builder.build().unwrap().block; + block_on(client.import(BlockOrigin::Own, c3.clone())).unwrap(); + + // A1 -> D2 + let mut builder = client.new_block_at(a1.hash(), Default::default(), false).unwrap(); + // this push is required as otherwise D2 has the same hash as B2 and won't get imported + builder + .push_transfer(Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Ferdie.into(), + amount: 1, + nonce: 0, + }) + .unwrap(); + let d2 = builder.build().unwrap().block; + block_on(client.import(BlockOrigin::Own, d2.clone())).unwrap(); + + let genesis_hash = client.chain_info().genesis_hash; + + let children1 = blockchain.children(a4.hash()).unwrap(); + assert_eq!(vec![a5.hash()], children1); + + let children2 = blockchain.children(a1.hash()).unwrap(); + assert_eq!(vec![a2.hash(), b2.hash(), d2.hash()], children2); + + let children3 = blockchain.children(genesis_hash).unwrap(); + assert_eq!(vec![a1.hash()], children3); + + let children4 = blockchain.children(b2.hash()).unwrap(); + assert_eq!(vec![b3.hash(), c3.hash()], children4); +} + +pub fn test_blockchain_query_by_number_gets_canonical(backend: Arc) +where + B: backend::LocalBackend, +{ + // block tree: + // G -> A1 -> A2 -> A3 -> A4 -> A5 + // A1 -> B2 -> B3 -> B4 + // B2 -> C3 + // A1 -> D2 + let mut client = TestClientBuilder::with_backend(backend.clone()).build(); + let blockchain = backend.blockchain(); + + // G -> A1 + let a1 = client.new_block(Default::default()).unwrap().build().unwrap().block; + block_on(client.import(BlockOrigin::Own, a1.clone())).unwrap(); + + // A1 -> A2 + let a2 = client + .new_block_at(a1.hash(), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a2.clone())).unwrap(); + + // A2 -> A3 + let a3 = client + .new_block_at(a2.hash(), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a3.clone())).unwrap(); + + // A3 -> A4 + let a4 = client + .new_block_at(a3.hash(), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a4.clone())).unwrap(); + + // A4 -> A5 + let a5 = client + .new_block_at(a4.hash(), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a5.clone())).unwrap(); + + // A1 -> B2 + let mut builder = client.new_block_at(a1.hash(), Default::default(), false).unwrap(); + // this push is required as otherwise B2 has the same hash as A2 and won't get imported + builder + .push_transfer(Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Ferdie.into(), + amount: 41, + nonce: 0, + }) + .unwrap(); + let b2 = builder.build().unwrap().block; + block_on(client.import(BlockOrigin::Own, b2.clone())).unwrap(); + + // B2 -> B3 + let b3 = client + .new_block_at(b2.hash(), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, b3.clone())).unwrap(); + + // B3 -> B4 + let b4 = client + .new_block_at(b3.hash(), Default::default(), false) + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, b4)).unwrap(); + + // // B2 -> C3 + let mut builder = client.new_block_at(b2.hash(), Default::default(), false).unwrap(); + // this push is required as otherwise C3 has the same hash as B3 and won't get imported + builder + .push_transfer(Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Ferdie.into(), + amount: 1, + nonce: 1, + }) + .unwrap(); + let c3 = builder.build().unwrap().block; + block_on(client.import(BlockOrigin::Own, c3)).unwrap(); + + // A1 -> D2 + let mut builder = client.new_block_at(a1.hash(), Default::default(), false).unwrap(); + // this push is required as otherwise D2 has the same hash as B2 and won't get imported + builder + .push_transfer(Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Ferdie.into(), + amount: 1, + nonce: 0, + }) + .unwrap(); + let d2 = builder.build().unwrap().block; + block_on(client.import(BlockOrigin::Own, d2)).unwrap(); + + let genesis_hash = client.chain_info().genesis_hash; + + assert_eq!(blockchain.hash(0).unwrap().unwrap(), genesis_hash); + assert_eq!(blockchain.hash(1).unwrap().unwrap(), a1.hash()); + assert_eq!(blockchain.hash(2).unwrap().unwrap(), a2.hash()); + assert_eq!(blockchain.hash(3).unwrap().unwrap(), a3.hash()); + assert_eq!(blockchain.hash(4).unwrap().unwrap(), a4.hash()); + assert_eq!(blockchain.hash(5).unwrap().unwrap(), a5.hash()); +} diff --git a/test-utils/stability-runtime/Cargo.toml b/test-utils/stability-runtime/Cargo.toml new file mode 100644 index 00000000..6511af24 --- /dev/null +++ b/test-utils/stability-runtime/Cargo.toml @@ -0,0 +1,118 @@ +[package] +name = "stability-test-runtime" +version = "1.0.0" +authors = ["Stability Solutions"] +edition = "2021" +license = "GPL-3.0-or-later WITH Classpath-exception-2.0" +build = "build.rs" +publish = false + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +pallet-beefy-mmr = { workspace = true } +sp-application-crypto = { workspace = true } +sp-consensus-aura = { workspace = true } +sp-consensus-babe = { workspace = true } +sp-consensus-beefy = { workspace = true } +sp-block-builder = { workspace = true } +codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } +scale-info = { workspace = true } +sp-inherents = { workspace = true } +sp-keyring = { workspace = true, optional = true } +memory-db = { workspace = true } +sp-offchain = { workspace = true } +sp-core = { workspace = true } +sp-std = { workspace = true } +sp-runtime-interface = { workspace = true } +sp-io = { workspace = true } +frame-support = { workspace = true } +sp-version = { workspace = true } +sp-session = { workspace = true } +sp-api = { workspace = true } +sp-runtime = { workspace = true } +pallet-babe = { workspace = true } +pallet-balances = { workspace = true } +stability-pallet-root-testing = { workspace = true } +pallet-sudo = { workspace = true } +frame-executive = { workspace = true } +frame-system = { workspace = true } +frame-system-rpc-runtime-api = { workspace = true } +pallet-timestamp = { workspace = true } +sp-consensus-grandpa = { workspace = true } +sp-trie = { workspace = true } +sp-transaction-pool = { workspace = true } +trie-db = { workspace = true } +sc-service = { workspace = true, optional = true } +sp-state-machine = { workspace = true } +sp-externalities = { workspace = true } +stability-sp-debug-derive = { workspace = true } +stbl-primitives-fee-compatible-api = { workspace = true } +stbl-primitives-zero-gas-transactions-api = { workspace = true } +stbl-core-primitives = { workspace = true } +pallet-ethereum = { workspace = true } +# 3rd party +array-bytes = { workspace = true, optional = true} +log = { workspace = true } +serde = { workspace = true, optional = true} + +[dev-dependencies] +futures = { workspace = true } +sc-block-builder = { workspace = true } +sc-executor = { workspace = true } +sp-consensus = { workspace = true } +stability-test-runtime-client = { workspace = true } +stability-sp-tracing = { workspace = true } + +[build-dependencies] +substrate-wasm-builder = { workspace = true, optional = true } + +[features] +default = [ + "std", +] +std = [ + "array-bytes", + "sp-application-crypto/std", + "sp-consensus-aura/std", + "sp-consensus-babe/std", + "sp-consensus-beefy/std", + "sp-block-builder/std", + "codec/std", + "scale-info/std", + "sp-inherents/std", + "sp-keyring", + "log/std", + "memory-db/std", + "sp-offchain/std", + "sp-core/std", + "sp-core/std", + "sp-std/std", + "sp-runtime-interface/std", + "sp-io/std", + "frame-support/std", + "sp-version/std", + "serde", + "sp-session/std", + "sp-api/std", + "sp-runtime/std", + "sp-externalities/std", + "sp-state-machine/std", + "pallet-babe/std", + "pallet-beefy-mmr/std", + "pallet-timestamp/std", + "pallet-balances/std", + "pallet-sudo/std", + "stability-pallet-root-testing/std", + "frame-system-rpc-runtime-api/std", + "frame-system/std", + "sc-service", + "sp-consensus-grandpa/std", + "sp-trie/std", + "sp-transaction-pool/std", + "trie-db/std", + "substrate-wasm-builder", +] +# Special feature to disable logging +disable-logging = [ "sp-api/disable-logging" ] diff --git a/test-utils/stability-runtime/build.rs b/test-utils/stability-runtime/build.rs new file mode 100644 index 00000000..766ab40d --- /dev/null +++ b/test-utils/stability-runtime/build.rs @@ -0,0 +1,42 @@ +// This file is part of Stability. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +fn main() { + #[cfg(feature = "std")] + { + substrate_wasm_builder::WasmBuilder::new() + .with_current_project() + .export_heap_base() + // Note that we set the stack-size to 1MB explicitly even though it is set + // to this value by default. This is because some of our tests + // (`restoration_of_globals`) depend on the stack-size. + .append_to_rust_flags("-Clink-arg=-zstack-size=1048576") + .import_memory() + .build(); + } + + #[cfg(feature = "std")] + { + substrate_wasm_builder::WasmBuilder::new() + .with_current_project() + .export_heap_base() + .import_memory() + .set_file_name("wasm_binary_logging_disabled.rs") + .enable_feature("disable-logging") + .build(); + } +} diff --git a/test-utils/stability-runtime/src/extrinsic.rs b/test-utils/stability-runtime/src/extrinsic.rs new file mode 100644 index 00000000..02a60450 --- /dev/null +++ b/test-utils/stability-runtime/src/extrinsic.rs @@ -0,0 +1,207 @@ +// This file is part of Stability. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Provides utils for building the `Extrinsic` instances used with `substrate-test-runtime`. + +use crate::{ + substrate_test_pallet::pallet::Call as PalletCall, AccountId, Balance, BalancesCall, + CheckSubstrateCall, Extrinsic, Index, Pair, RuntimeCall, SignedPayload, TransferData, +}; +use codec::Encode; +use frame_system::{CheckNonce, CheckWeight}; +use sp_core::crypto::Pair as TraitPair; +use sp_keyring::AccountKeyring; +use sp_runtime::{transaction_validity::TransactionPriority, Perbill}; +use sp_std::prelude::*; + +/// Transfer used in test substrate pallet. Extrinsic is created and signed using this data. +#[derive(Clone)] +pub struct Transfer { + /// Transfer sender and signer of created extrinsic + pub from: Pair, + /// The recipient of the transfer + pub to: AccountId, + /// Amount of transfer + pub amount: Balance, + /// Sender's account nonce at which transfer is valid + pub nonce: u64, +} + +impl Transfer { + /// Convert into a signed unchecked extrinsic. + pub fn into_unchecked_extrinsic(self) -> Extrinsic { + ExtrinsicBuilder::new_transfer(self).build() + } +} + +impl Default for TransferData { + fn default() -> Self { + Self { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Bob.into(), + amount: 0, + nonce: 0, + } + } +} + +/// If feasible converts given `Extrinsic` to `TransferData` +impl TryFrom<&Extrinsic> for TransferData { + type Error = (); + fn try_from(uxt: &Extrinsic) -> Result { + match uxt { + Extrinsic { + function: RuntimeCall::Balances(BalancesCall::transfer_allow_death { dest, value }), + signature: Some((from, _, (CheckNonce(nonce), ..))), + } => Ok(TransferData { from: *from, to: *dest, amount: *value, nonce: *nonce }), + Extrinsic { + function: RuntimeCall::SubstrateTest(PalletCall::bench_call { transfer }), + signature: None, + } => Ok(transfer.clone()), + _ => Err(()), + } + } +} + +/// Generates `Extrinsic` +pub struct ExtrinsicBuilder { + function: RuntimeCall, + signer: Option, + nonce: Option, +} + +impl ExtrinsicBuilder { + /// Create builder for given `RuntimeCall`. By default `Extrinsic` will be signed by `Alice`. + pub fn new(function: impl Into) -> Self { + Self { function: function.into(), signer: Some(AccountKeyring::Alice.pair()), nonce: None } + } + + /// Create builder for given `RuntimeCall`. `Extrinsic` will be unsigned. + pub fn new_unsigned(function: impl Into) -> Self { + Self { function: function.into(), signer: None, nonce: None } + } + + /// Create builder for `pallet_call::bench_transfer` from given `TransferData`. + pub fn new_bench_call(transfer: TransferData) -> Self { + Self::new_unsigned(PalletCall::bench_call { transfer }) + } + + /// Create builder for given `Transfer`. Transfer `nonce` will be used as `Extrinsic` nonce. + /// Transfer `from` will be used as Extrinsic signer. + pub fn new_transfer(transfer: Transfer) -> Self { + Self { + nonce: Some(transfer.nonce), + signer: Some(transfer.from.clone()), + ..Self::new(BalancesCall::transfer_allow_death { + dest: transfer.to, + value: transfer.amount, + }) + } + } + + /// Create builder for `PalletCall::include_data` call using given parameters + pub fn new_include_data(data: Vec) -> Self { + Self::new(PalletCall::include_data { data }) + } + + /// Create builder for `PalletCall::storage_change` call using given parameters. Will + /// create unsigned Extrinsic. + pub fn new_storage_change(key: Vec, value: Option>) -> Self { + Self::new_unsigned(PalletCall::storage_change { key, value }) + } + + /// Create builder for `PalletCall::offchain_index_set` call using given parameters + pub fn new_offchain_index_set(key: Vec, value: Vec) -> Self { + Self::new(PalletCall::offchain_index_set { key, value }) + } + + /// Create builder for `PalletCall::offchain_index_clear` call using given parameters + pub fn new_offchain_index_clear(key: Vec) -> Self { + Self::new(PalletCall::offchain_index_clear { key }) + } + + /// Create builder for `PalletCall::indexed_call` call using given parameters + pub fn new_indexed_call(data: Vec) -> Self { + Self::new(PalletCall::indexed_call { data }) + } + + /// Create builder for `PalletCall::new_deposit_log_digest_item` call using given `log` + pub fn new_deposit_log_digest_item(log: sp_runtime::generic::DigestItem) -> Self { + Self::new_unsigned(PalletCall::deposit_log_digest_item { log }) + } + + /// Create builder for `PalletCall::Call::new_deposit_log_digest_item` + pub fn new_fill_block(ratio: Perbill) -> Self { + Self::new(PalletCall::fill_block { ratio }) + } + + /// Create builder for `PalletCall::call_do_not_propagate` call using given parameters + pub fn new_call_do_not_propagate() -> Self { + Self::new(PalletCall::call_do_not_propagate {}) + } + + /// Create builder for `PalletCall::call_with_priority` call using given parameters + pub fn new_call_with_priority(priority: TransactionPriority) -> Self { + Self::new(PalletCall::call_with_priority { priority }) + } + + /// Create builder for `PalletCall::read` call using given parameters + pub fn new_read(count: u32) -> Self { + Self::new_unsigned(PalletCall::read { count }) + } + + /// Create builder for `PalletCall::read` call using given parameters + pub fn new_read_and_panic(count: u32) -> Self { + Self::new_unsigned(PalletCall::read_and_panic { count }) + } + + /// Unsigned `Extrinsic` will be created + pub fn unsigned(mut self) -> Self { + self.signer = None; + self + } + + /// Given `nonce` will be set in `Extrinsic` + pub fn nonce(mut self, nonce: Index) -> Self { + self.nonce = Some(nonce); + self + } + + /// Extrinsic will be signed by `signer` + pub fn signer(mut self, signer: Pair) -> Self { + self.signer = Some(signer); + self + } + + /// Build `Extrinsic` using embedded parameters + pub fn build(self) -> Extrinsic { + if let Some(signer) = self.signer { + let extra = ( + CheckNonce::from(self.nonce.unwrap_or(0)), + CheckWeight::new(), + CheckSubstrateCall {}, + ); + let raw_payload = + SignedPayload::from_raw(self.function.clone(), extra.clone(), ((), (), ())); + let signature = raw_payload.using_encoded(|e| signer.sign(e)); + + Extrinsic::new_signed(self.function, signer.public(), signature, extra) + } else { + Extrinsic::new_unsigned(self.function) + } + } +} diff --git a/test-utils/stability-runtime/src/genesismap.rs b/test-utils/stability-runtime/src/genesismap.rs new file mode 100644 index 00000000..005811c3 --- /dev/null +++ b/test-utils/stability-runtime/src/genesismap.rs @@ -0,0 +1,172 @@ +// This file is part of Stability. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Tool for creating the genesis block. + +use super::{ + currency, substrate_test_pallet, wasm_binary_unwrap, AccountId, Balance, GenesisConfig, +}; +use codec::Encode; +use sc_service::construct_genesis_block; +use sp_core::{ + sr25519, + storage::{well_known_keys, StateVersion, Storage}, + Pair, +}; +use sp_keyring::{AccountKeyring, Sr25519Keyring}; +use sp_runtime::{ + traits::{Block as BlockT, Hash as HashT, Header as HeaderT}, + BuildStorage, +}; + +/// Builder for generating storage from substrate-test-runtime genesis config. +/// +/// Default storage can be extended with additional key-value pairs. +pub struct GenesisStorageBuilder { + /// Authorities accounts used by any component requiring an authority set (e.g. babe). + authorities: Vec, + /// Accounts to be endowed with some funds. + balances: Vec<(AccountId, u64)>, + /// Override default number of heap pages. + heap_pages_override: Option, + /// Additional storage key pairs that will be added to the genesis map. + extra_storage: Storage, + /// Optional wasm code override. + wasm_code: Option>, +} + +impl Default for GenesisStorageBuilder { + /// Creates a builder with default settings for `stability_test_runtime`. + fn default() -> Self { + Self::new( + vec![ + Sr25519Keyring::Alice.into(), + Sr25519Keyring::Bob.into(), + Sr25519Keyring::Charlie.into(), + ], + (0..16_usize) + .into_iter() + .map(|i| AccountKeyring::numeric(i).public()) + .chain(vec![ + AccountKeyring::Alice.into(), + AccountKeyring::Bob.into(), + AccountKeyring::Charlie.into(), + ]) + .collect(), + 1000 * currency::DOLLARS, + ) + } +} + +impl GenesisStorageBuilder { + /// Creates a storage builder for genesis config. `substrage test runtime` `GenesisConfig` is + /// initialized with provided `authorities`, `endowed_accounts` with given balance. Key-pairs + /// from `extra_storage` will be injected into built storage. `HEAP_PAGES` key and value will + /// also be placed into storage. + pub fn new( + authorities: Vec, + endowed_accounts: Vec, + balance: Balance, + ) -> Self { + GenesisStorageBuilder { + authorities, + balances: endowed_accounts.into_iter().map(|a| (a, balance)).collect(), + heap_pages_override: None, + extra_storage: Default::default(), + wasm_code: None, + } + } + + /// Override default wasm code to be placed into GenesisConfig. + pub fn with_wasm_code(mut self, wasm_code: &Option>) -> Self { + self.wasm_code = wasm_code.clone(); + self + } + + pub fn with_heap_pages(mut self, heap_pages_override: Option) -> Self { + self.heap_pages_override = heap_pages_override; + self + } + + pub fn with_extra_storage(mut self, storage: Storage) -> Self { + self.extra_storage = storage; + self + } + + /// Builds the `GenesisConfig` and returns its storage. + pub fn build(self) -> Storage { + let authorities_sr25519: Vec<_> = self + .authorities + .clone() + .into_iter() + .map(|id| sr25519::Public::from(id)) + .collect(); + + let genesis_config = GenesisConfig { + system: frame_system::GenesisConfig { + code: self.wasm_code.clone().unwrap_or(wasm_binary_unwrap().to_vec()), + }, + babe: pallet_babe::GenesisConfig { + authorities: authorities_sr25519 + .clone() + .into_iter() + .map(|x| (x.into(), 1)) + .collect(), + epoch_config: Some(crate::TEST_RUNTIME_BABE_EPOCH_CONFIGURATION), + }, + substrate_test: substrate_test_pallet::GenesisConfig { + authorities: authorities_sr25519.clone(), + }, + balances: pallet_balances::GenesisConfig { balances: self.balances.clone() }, + }; + + let mut storage = genesis_config + .build_storage() + .expect("Build storage from substrate-test-runtime GenesisConfig"); + + storage.top.insert( + well_known_keys::HEAP_PAGES.into(), + self.heap_pages_override.unwrap_or(16_u64).encode(), + ); + + storage.top.extend(self.extra_storage.top.clone()); + storage.children_default.extend(self.extra_storage.children_default.clone()); + + storage + } +} + +pub fn insert_genesis_block(storage: &mut Storage) -> sp_core::hash::H256 { + let child_roots = storage.children_default.iter().map(|(sk, child_content)| { + let state_root = + <<::Header as HeaderT>::Hashing as HashT>::trie_root( + child_content.data.clone().into_iter().collect(), + sp_runtime::StateVersion::V1, + ); + (sk.clone(), state_root.encode()) + }); + // add child roots to storage + storage.top.extend(child_roots); + let state_root = <<::Header as HeaderT>::Hashing as HashT>::trie_root( + storage.top.clone().into_iter().collect(), + sp_runtime::StateVersion::V1, + ); + let block: crate::Block = construct_genesis_block(state_root, StateVersion::V1); + let genesis_hash = block.header.hash(); + + genesis_hash +} diff --git a/test-utils/stability-runtime/src/lib.rs b/test-utils/stability-runtime/src/lib.rs new file mode 100644 index 00000000..93e76fed --- /dev/null +++ b/test-utils/stability-runtime/src/lib.rs @@ -0,0 +1,1197 @@ +// This file is part of Stability. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! The Substrate runtime. This can be compiled with `#[no_std]`, ready for Wasm. + +#![cfg_attr(not(feature = "std"), no_std)] + +#[cfg(feature = "std")] +pub mod extrinsic; +#[cfg(feature = "std")] +pub mod genesismap; +pub mod substrate_test_pallet; + +use codec::{Decode, Encode}; +use frame_support::{ + construct_runtime, + dispatch::DispatchClass, + parameter_types, + traits::{ConstU32, ConstU64}, + weights::{ + constants::{BlockExecutionWeight, ExtrinsicBaseWeight, WEIGHT_REF_TIME_PER_SECOND}, + Weight, + }, +}; +use frame_system::{ + limits::{BlockLength, BlockWeights}, + CheckNonce, CheckWeight, +}; +use scale_info::TypeInfo; +use sp_std::prelude::*; +use pallet_ethereum::Transaction as EthereumTransaction; +use sp_application_crypto::{ecdsa, ed25519, sr25519, RuntimeAppPublic}; +use sp_core::{OpaqueMetadata, RuntimeDebug}; +use sp_trie::{ + trie_types::{TrieDBBuilder, TrieDBMutBuilderV1}, + PrefixedMemoryDB, StorageProof, +}; +use trie_db::{Trie, TrieMut}; + +use sp_api::{decl_runtime_apis, impl_runtime_apis}; +pub use sp_core::hash::H256; +use sp_inherents::{CheckInherentsResult, InherentData}; +use sp_runtime::{ + create_runtime_str, impl_opaque_keys, + traits::{BlakeTwo256, Block as BlockT, DispatchInfoOf, NumberFor, Verify}, + transaction_validity::{TransactionSource, TransactionValidity, TransactionValidityError}, + ApplyExtrinsicResult, Perbill, +}; +#[cfg(any(feature = "std", test))] +use sp_version::NativeVersion; +use sp_version::RuntimeVersion; + +pub use sp_consensus_babe::{AllowedSlots, BabeEpochConfiguration, Slot}; + +pub use pallet_balances::Call as BalancesCall; + +pub type AuraId = sp_consensus_aura::sr25519::AuthorityId; +#[cfg(feature = "std")] +pub use extrinsic::{ExtrinsicBuilder, Transfer}; + +const LOG_TARGET: &str = "substrate-test-runtime"; + +// Include the WASM binary +#[cfg(feature = "std")] +include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); + +#[cfg(feature = "std")] +pub mod wasm_binary_logging_disabled { + include!(concat!(env!("OUT_DIR"), "/wasm_binary_logging_disabled.rs")); +} + +/// Wasm binary unwrapped. If built with `SKIP_WASM_BUILD`, the function panics. +#[cfg(feature = "std")] +pub fn wasm_binary_unwrap() -> &'static [u8] { + WASM_BINARY.expect( + "Development wasm binary is not available. Testing is only supported with the flag \ + disabled.", + ) +} + +/// Wasm binary unwrapped. If built with `SKIP_WASM_BUILD`, the function panics. +#[cfg(feature = "std")] +pub fn wasm_binary_logging_disabled_unwrap() -> &'static [u8] { + wasm_binary_logging_disabled::WASM_BINARY.expect( + "Development wasm binary is not available. Testing is only supported with the flag \ + disabled.", + ) +} + +/// Test runtime version. +#[sp_version::runtime_version] +pub const VERSION: RuntimeVersion = RuntimeVersion { + spec_name: create_runtime_str!("test"), + impl_name: create_runtime_str!("parity-test"), + authoring_version: 1, + spec_version: 2, + impl_version: 2, + apis: RUNTIME_API_VERSIONS, + transaction_version: 1, + state_version: 1, +}; + +fn version() -> RuntimeVersion { + VERSION +} + +/// Native version. +#[cfg(any(feature = "std", test))] +pub fn native_version() -> NativeVersion { + NativeVersion { runtime_version: VERSION, can_author_with: Default::default() } +} + +/// Transfer data extracted from Extrinsic containing `Balances::transfer_allow_death`. +#[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)] +pub struct TransferData { + pub from: AccountId, + pub to: AccountId, + pub amount: Balance, + pub nonce: Index, +} + +/// The address format for describing accounts. +pub type Address = sp_core::sr25519::Public; +pub type Signature = sr25519::Signature; +#[cfg(feature = "std")] +pub type Pair = sp_core::sr25519::Pair; + +/// The SignedExtension to the basic transaction logic. +pub type SignedExtra = (CheckNonce, CheckWeight, CheckSubstrateCall); +/// The payload being signed in transactions. +pub type SignedPayload = sp_runtime::generic::SignedPayload; +/// Unchecked extrinsic type as expected by this runtime. +pub type Extrinsic = + sp_runtime::generic::UncheckedExtrinsic; + +/// An identifier for an account on this system. +pub type AccountId = ::Signer; +/// A simple hash type for all our hashing. +pub type Hash = H256; +/// The hashing algorithm used. +pub type Hashing = BlakeTwo256; +/// The block number type used in this runtime. +pub type BlockNumber = u64; +/// Index of a transaction. +pub type Index = u64; +/// The item of a block digest. +pub type DigestItem = sp_runtime::generic::DigestItem; +/// The digest of a block. +pub type Digest = sp_runtime::generic::Digest; +/// A test block. +pub type Block = sp_runtime::generic::Block; +/// A test block's header. +pub type Header = sp_runtime::generic::Header; +/// Balance of an account. +pub type Balance = u64; + + +pub type RealAccountiD = stbl_core_primitives::AccountId; + +decl_runtime_apis! { + #[api_version(2)] + pub trait TestAPI { + /// Return the balance of the given account id. + fn balance_of(id: AccountId) -> u64; + /// A benchmark function that adds one to the given value and returns the result. + fn benchmark_add_one(val: &u64) -> u64; + /// A benchmark function that adds one to each value in the given vector and returns the + /// result. + fn benchmark_vector_add_one(vec: &Vec) -> Vec; + /// A function for that the signature changed in version `2`. + #[changed_in(2)] + fn function_signature_changed() -> Vec; + /// The new signature. + fn function_signature_changed() -> u64; + /// trie no_std testing + fn use_trie() -> u64; + /// Calls function in the loop using never-inlined function pointer + fn benchmark_indirect_call() -> u64; + /// Calls function in the loop + fn benchmark_direct_call() -> u64; + /// Allocates vector with given capacity. + fn vec_with_capacity(size: u32) -> Vec; + /// Returns the initialized block number. + fn get_block_number() -> u64; + + /// Test that `ed25519` crypto works in the runtime. + /// + /// Returns the signature generated for the message `ed25519` and the public key. + fn test_ed25519_crypto() -> (ed25519::AppSignature, ed25519::AppPublic); + /// Test that `sr25519` crypto works in the runtime. + /// + /// Returns the signature generated for the message `sr25519`. + fn test_sr25519_crypto() -> (sr25519::AppSignature, sr25519::AppPublic); + /// Test that `ecdsa` crypto works in the runtime. + /// + /// Returns the signature generated for the message `ecdsa`. + fn test_ecdsa_crypto() -> (ecdsa::AppSignature, ecdsa::AppPublic); + /// Run various tests against storage. + fn test_storage(); + /// Check a witness. + fn test_witness(proof: StorageProof, root: crate::Hash); + /// Test that ensures that we can call a function that takes multiple + /// arguments. + fn test_multiple_arguments(data: Vec, other: Vec, num: u32); + /// Traces log "Hey I'm runtime." + fn do_trace_log(); + /// Verify the given signature, public & message bundle. + fn verify_ed25519(sig: ed25519::Signature, public: ed25519::Public, message: Vec) -> bool; + } +} + +pub type Executive = frame_executive::Executive< + Runtime, + Block, + frame_system::ChainContext, + Runtime, + AllPalletsWithSystem, +>; + +#[derive(Copy, Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)] +pub struct CheckSubstrateCall; + +impl sp_runtime::traits::Printable for CheckSubstrateCall { + fn print(&self) { + "CheckSubstrateCall".print() + } +} + +impl sp_runtime::traits::Dispatchable for CheckSubstrateCall { + type RuntimeOrigin = CheckSubstrateCall; + type Config = CheckSubstrateCall; + type Info = CheckSubstrateCall; + type PostInfo = CheckSubstrateCall; + + fn dispatch( + self, + _origin: Self::RuntimeOrigin, + ) -> sp_runtime::DispatchResultWithInfo { + panic!("This implementation should not be used for actual dispatch."); + } +} + +impl sp_runtime::traits::SignedExtension for CheckSubstrateCall { + type AccountId = AccountId; + type Call = RuntimeCall; + type AdditionalSigned = (); + type Pre = (); + const IDENTIFIER: &'static str = "CheckSubstrateCall"; + + fn additional_signed( + &self, + ) -> sp_std::result::Result { + Ok(()) + } + + fn validate( + &self, + _who: &Self::AccountId, + call: &Self::Call, + _info: &DispatchInfoOf, + _len: usize, + ) -> TransactionValidity { + log::trace!(target: LOG_TARGET, "validate"); + match call { + RuntimeCall::SubstrateTest(ref substrate_test_call) => + substrate_test_pallet::validate_runtime_call(substrate_test_call), + _ => Ok(Default::default()), + } + } + + fn pre_dispatch( + self, + who: &Self::AccountId, + call: &Self::Call, + info: &sp_runtime::traits::DispatchInfoOf, + len: usize, + ) -> Result { + self.validate(who, call, info, len).map(drop) + } +} + +construct_runtime!( + pub enum Runtime where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = Extrinsic + { + System: frame_system, + Babe: pallet_babe, + SubstrateTest: substrate_test_pallet::pallet, + Balances: pallet_balances, + } +); + +/// We assume that ~10% of the block weight is consumed by `on_initialize` handlers. +/// This is used to limit the maximal weight of a single extrinsic. +const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); +/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used +/// by Operational extrinsics. +const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); +/// Max weight, actual value does not matter for test runtime. +const MAXIMUM_BLOCK_WEIGHT: Weight = + Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2), u64::MAX); + +parameter_types! { + pub const BlockHashCount: BlockNumber = 2400; + pub const Version: RuntimeVersion = VERSION; + + pub RuntimeBlockLength: BlockLength = + BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); + + pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder() + .base_block(BlockExecutionWeight::get()) + .for_class(DispatchClass::all(), |weights| { + weights.base_extrinsic = ExtrinsicBaseWeight::get(); + }) + .for_class(DispatchClass::Normal, |weights| { + weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT); + }) + .for_class(DispatchClass::Operational, |weights| { + weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT); + // Operational transactions have some extra reserved space, so that they + // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`. + weights.reserved = Some( + MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT + ); + }) + .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) + .build_or_panic(); +} + +impl frame_system::pallet::Config for Runtime { + type BaseCallFilter = frame_support::traits::Everything; + type BlockWeights = RuntimeBlockWeights; + type BlockLength = (); + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + type Index = Index; + type BlockNumber = BlockNumber; + type Hash = H256; + type Hashing = Hashing; + type AccountId = AccountId; + type Lookup = sp_runtime::traits::IdentityLookup; + type Header = Header; + type RuntimeEvent = RuntimeEvent; + type BlockHashCount = ConstU64<2400>; + type DbWeight = (); + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = pallet_balances::AccountData; + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = (); + type OnSetCode = (); + type MaxConsumers = ConstU32<16>; +} + +pub mod currency { + use crate::Balance; + const MILLICENTS: Balance = 1_000_000_000; + const CENTS: Balance = 1_000 * MILLICENTS; // assume this is worth about a cent. + pub const DOLLARS: Balance = 100 * CENTS; +} + +parameter_types! { + pub const ExistentialDeposit: Balance = 1 * currency::DOLLARS; + // For weight estimation, we assume that the most locks on an individual account will be 50. + // This number may need to be adjusted in the future if this assumption no longer holds true. + pub const MaxLocks: u32 = 50; + pub const MaxReserves: u32 = 50; +} + +impl pallet_balances::Config for Runtime { + type MaxLocks = MaxLocks; + type MaxReserves = MaxReserves; + type ReserveIdentifier = [u8; 8]; + type Balance = Balance; + type DustRemoval = (); + type RuntimeEvent = RuntimeEvent; + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; + type WeightInfo = pallet_balances::weights::SubstrateWeight; + type FreezeIdentifier = (); + type MaxFreezes = (); + type HoldIdentifier = (); + type MaxHolds = ConstU32<1>; +} + +impl substrate_test_pallet::Config for Runtime {} + +// Required for `pallet_babe::Config`. +impl pallet_timestamp::Config for Runtime { + type Moment = u64; + type OnTimestampSet = Babe; + type MinimumPeriod = ConstU64<500>; + type WeightInfo = pallet_timestamp::weights::SubstrateWeight; +} + +parameter_types! { + pub const EpochDuration: u64 = 6; +} + +impl pallet_babe::Config for Runtime { + type EpochDuration = EpochDuration; + type ExpectedBlockTime = ConstU64<10_000>; + type EpochChangeTrigger = pallet_babe::SameAuthoritiesForever; + type DisabledValidators = (); + type KeyOwnerProof = sp_core::Void; + type EquivocationReportSystem = (); + type WeightInfo = (); + type MaxAuthorities = ConstU32<10>; +} + +/// Adds one to the given input and returns the final result. +#[inline(never)] +fn benchmark_add_one(i: u64) -> u64 { + i + 1 +} + +fn code_using_trie() -> u64 { + let pairs = [ + (b"0103000000000000000464".to_vec(), b"0400000000".to_vec()), + (b"0103000000000000000469".to_vec(), b"0401000000".to_vec()), + ] + .to_vec(); + + let mut mdb = PrefixedMemoryDB::default(); + let mut root = sp_std::default::Default::default(); + { + let mut t = TrieDBMutBuilderV1::::new(&mut mdb, &mut root).build(); + for (key, value) in &pairs { + if t.insert(key, value).is_err() { + return 101 + } + } + } + + let trie = TrieDBBuilder::::new(&mdb, &root).build(); + let res = if let Ok(iter) = trie.iter() { iter.flatten().count() as u64 } else { 102 }; + + res +} + +impl_opaque_keys! { + pub struct SessionKeys { + pub ed25519: ed25519::AppPublic, + pub sr25519: sr25519::AppPublic, + pub ecdsa: ecdsa::AppPublic, + } +} + +pub(crate) const TEST_RUNTIME_BABE_EPOCH_CONFIGURATION: BabeEpochConfiguration = + BabeEpochConfiguration { + c: (3, 10), + allowed_slots: AllowedSlots::PrimaryAndSecondaryPlainSlots, + }; + +impl_runtime_apis! { + impl sp_api::Core for Runtime { + fn version() -> RuntimeVersion { + version() + } + + fn execute_block(block: Block) { + log::trace!(target: LOG_TARGET, "execute_block: {block:#?}"); + Executive::execute_block(block); + } + + fn initialize_block(header: &::Header) { + log::trace!(target: LOG_TARGET, "initialize_block: {header:#?}"); + Executive::initialize_block(header); + } + } + + impl sp_api::Metadata for Runtime { + fn metadata() -> OpaqueMetadata { + unimplemented!() + } + + fn metadata_at_version(_version: u32) -> Option { + unimplemented!() + } + fn metadata_versions() -> sp_std::vec::Vec { + unimplemented!() + } + } + + impl sp_transaction_pool::runtime_api::TaggedTransactionQueue for Runtime { + fn validate_transaction( + source: TransactionSource, + utx: ::Extrinsic, + block_hash: ::Hash, + ) -> TransactionValidity { + let validity = Executive::validate_transaction(source, utx.clone(), block_hash); + log::trace!(target: LOG_TARGET, "validate_transaction {:?} {:?}", utx, validity); + validity + } + } + + impl sp_block_builder::BlockBuilder for Runtime { + fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyExtrinsicResult { + Executive::apply_extrinsic(extrinsic) + } + + fn finalize_block() -> ::Header { + log::trace!(target: LOG_TARGET, "finalize_block"); + Executive::finalize_block() + } + + fn inherent_extrinsics(_data: InherentData) -> Vec<::Extrinsic> { + vec![] + } + + fn check_inherents(_block: Block, _data: InherentData) -> CheckInherentsResult { + CheckInherentsResult::new() + } + } + + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Index { + System::account_nonce(account) + } + } + + impl self::TestAPI for Runtime { + fn balance_of(id: AccountId) -> u64 { + Balances::free_balance(id) + } + + fn benchmark_add_one(val: &u64) -> u64 { + val + 1 + } + + fn benchmark_vector_add_one(vec: &Vec) -> Vec { + let mut vec = vec.clone(); + vec.iter_mut().for_each(|v| *v += 1); + vec + } + + fn function_signature_changed() -> u64 { + 1 + } + + fn use_trie() -> u64 { + code_using_trie() + } + + fn benchmark_indirect_call() -> u64 { + let function = benchmark_add_one; + (0..1000).fold(0, |p, i| p + function(i)) + } + fn benchmark_direct_call() -> u64 { + (0..1000).fold(0, |p, i| p + benchmark_add_one(i)) + } + + fn vec_with_capacity(size: u32) -> Vec { + Vec::with_capacity(size as usize) + } + + fn get_block_number() -> u64 { + System::block_number() + } + + fn test_ed25519_crypto() -> (ed25519::AppSignature, ed25519::AppPublic) { + test_ed25519_crypto() + } + + fn test_sr25519_crypto() -> (sr25519::AppSignature, sr25519::AppPublic) { + test_sr25519_crypto() + } + + fn test_ecdsa_crypto() -> (ecdsa::AppSignature, ecdsa::AppPublic) { + test_ecdsa_crypto() + } + + fn test_storage() { + test_read_storage(); + test_read_child_storage(); + } + + fn test_witness(proof: StorageProof, root: crate::Hash) { + test_witness(proof, root); + } + + fn test_multiple_arguments(data: Vec, other: Vec, num: u32) { + assert_eq!(&data[..], &other[..]); + assert_eq!(data.len(), num as usize); + } + + fn do_trace_log() { + log::trace!("Hey I'm runtime"); + } + + fn verify_ed25519(sig: ed25519::Signature, public: ed25519::Public, message: Vec) -> bool { + sp_io::crypto::ed25519_verify(&sig, &message, &public) + } + } + + impl sp_consensus_aura::AuraApi for Runtime { + fn slot_duration() -> sp_consensus_aura::SlotDuration { + sp_consensus_aura::SlotDuration::from_millis(1000) + } + + fn authorities() -> Vec { + SubstrateTest::authorities().into_iter().map(|auth| AuraId::from(auth)).collect() + } + } + + impl sp_consensus_babe::BabeApi for Runtime { + fn configuration() -> sp_consensus_babe::BabeConfiguration { + let epoch_config = Babe::epoch_config().unwrap_or(TEST_RUNTIME_BABE_EPOCH_CONFIGURATION); + sp_consensus_babe::BabeConfiguration { + slot_duration: Babe::slot_duration(), + epoch_length: EpochDuration::get(), + c: epoch_config.c, + authorities: Babe::authorities().to_vec(), + randomness: Babe::randomness(), + allowed_slots: epoch_config.allowed_slots, + } + } + + fn current_epoch_start() -> Slot { + Babe::current_epoch_start() + } + + fn current_epoch() -> sp_consensus_babe::Epoch { + Babe::current_epoch() + } + + fn next_epoch() -> sp_consensus_babe::Epoch { + Babe::next_epoch() + } + + fn submit_report_equivocation_unsigned_extrinsic( + _equivocation_proof: sp_consensus_babe::EquivocationProof< + ::Header, + >, + _key_owner_proof: sp_consensus_babe::OpaqueKeyOwnershipProof, + ) -> Option<()> { + None + } + + fn generate_key_ownership_proof( + _slot: sp_consensus_babe::Slot, + _authority_id: sp_consensus_babe::AuthorityId, + ) -> Option { + None + } + } + + impl sp_offchain::OffchainWorkerApi for Runtime { + fn offchain_worker(header: &::Header) { + let ext = Extrinsic::new_unsigned( + substrate_test_pallet::pallet::Call::storage_change{ + key:b"some_key".encode(), + value:Some(header.number.encode()) + }.into(), + ); + sp_io::offchain::submit_transaction(ext.encode()).unwrap(); + } + } + + impl sp_session::SessionKeys for Runtime { + fn generate_session_keys(_: Option>) -> Vec { + SessionKeys::generate(None) + } + + fn decode_session_keys( + encoded: Vec, + ) -> Option, sp_core::crypto::KeyTypeId)>> { + SessionKeys::decode_into_raw_public_keys(&encoded) + } + } + + impl sp_consensus_grandpa::GrandpaApi for Runtime { + fn grandpa_authorities() -> sp_consensus_grandpa::AuthorityList { + Vec::new() + } + + fn current_set_id() -> sp_consensus_grandpa::SetId { + 0 + } + + fn submit_report_equivocation_unsigned_extrinsic( + _equivocation_proof: sp_consensus_grandpa::EquivocationProof< + ::Hash, + NumberFor, + >, + _key_owner_proof: sp_consensus_grandpa::OpaqueKeyOwnershipProof, + ) -> Option<()> { + None + } + + fn generate_key_ownership_proof( + _set_id: sp_consensus_grandpa::SetId, + _authority_id: sp_consensus_grandpa::AuthorityId, + ) -> Option { + None + } + } + + impl stbl_primitives_fee_compatible_api::CompatibleFeeApi for Runtime { + fn is_compatible_fee(tx: ::Extrinsic, _: RealAccountiD) -> bool { + true + } + } + + impl stbl_primitives_zero_gas_transactions_api::ZeroGasTransactionApi for Runtime { + fn convert_zero_gas_transaction(_transaction: EthereumTransaction, _validator_signature: Vec) -> ::Extrinsic { + return Extrinsic::new_unsigned((substrate_test_pallet::pallet::Call::call_do_not_propagate {}).into()) + } + } +} + +fn test_ed25519_crypto() -> (ed25519::AppSignature, ed25519::AppPublic) { + let public0 = ed25519::AppPublic::generate_pair(None); + let public1 = ed25519::AppPublic::generate_pair(None); + let public2 = ed25519::AppPublic::generate_pair(None); + + let all = ed25519::AppPublic::all(); + assert!(all.contains(&public0)); + assert!(all.contains(&public1)); + assert!(all.contains(&public2)); + + let signature = public0.sign(&"ed25519").expect("Generates a valid `ed25519` signature."); + assert!(public0.verify(&"ed25519", &signature)); + (signature, public0) +} + +fn test_sr25519_crypto() -> (sr25519::AppSignature, sr25519::AppPublic) { + let public0 = sr25519::AppPublic::generate_pair(None); + let public1 = sr25519::AppPublic::generate_pair(None); + let public2 = sr25519::AppPublic::generate_pair(None); + + let all = sr25519::AppPublic::all(); + assert!(all.contains(&public0)); + assert!(all.contains(&public1)); + assert!(all.contains(&public2)); + + let signature = public0.sign(&"sr25519").expect("Generates a valid `sr25519` signature."); + assert!(public0.verify(&"sr25519", &signature)); + (signature, public0) +} + +fn test_ecdsa_crypto() -> (ecdsa::AppSignature, ecdsa::AppPublic) { + let public0 = ecdsa::AppPublic::generate_pair(None); + let public1 = ecdsa::AppPublic::generate_pair(None); + let public2 = ecdsa::AppPublic::generate_pair(None); + + let all = ecdsa::AppPublic::all(); + assert!(all.contains(&public0)); + assert!(all.contains(&public1)); + assert!(all.contains(&public2)); + + let signature = public0.sign(&"ecdsa").expect("Generates a valid `ecdsa` signature."); + + assert!(public0.verify(&"ecdsa", &signature)); + (signature, public0) +} + +fn test_read_storage() { + const KEY: &[u8] = b":read_storage"; + sp_io::storage::set(KEY, b"test"); + + let mut v = [0u8; 4]; + let r = sp_io::storage::read(KEY, &mut v, 0); + assert_eq!(r, Some(4)); + assert_eq!(&v, b"test"); + + let mut v = [0u8; 4]; + let r = sp_io::storage::read(KEY, &mut v, 4); + assert_eq!(r, Some(0)); + assert_eq!(&v, &[0, 0, 0, 0]); +} + +fn test_read_child_storage() { + const STORAGE_KEY: &[u8] = b"unique_id_1"; + const KEY: &[u8] = b":read_child_storage"; + sp_io::default_child_storage::set(STORAGE_KEY, KEY, b"test"); + + let mut v = [0u8; 4]; + let r = sp_io::default_child_storage::read(STORAGE_KEY, KEY, &mut v, 0); + assert_eq!(r, Some(4)); + assert_eq!(&v, b"test"); + + let mut v = [0u8; 4]; + let r = sp_io::default_child_storage::read(STORAGE_KEY, KEY, &mut v, 8); + assert_eq!(r, Some(0)); + assert_eq!(&v, &[0, 0, 0, 0]); +} + +fn test_witness(proof: StorageProof, root: crate::Hash) { + use sp_externalities::Externalities; + let db: sp_trie::MemoryDB = proof.into_memory_db(); + let backend = sp_state_machine::TrieBackendBuilder::<_, crate::Hashing>::new(db, root).build(); + let mut overlay = sp_state_machine::OverlayedChanges::default(); + let mut cache = sp_state_machine::StorageTransactionCache::<_, _>::default(); + let mut ext = sp_state_machine::Ext::new( + &mut overlay, + &mut cache, + &backend, + #[cfg(feature = "std")] + None, + ); + assert!(ext.storage(b"value3").is_some()); + assert!(ext.storage_root(Default::default()).as_slice() == &root[..]); + ext.place_storage(vec![0], Some(vec![1])); + assert!(ext.storage_root(Default::default()).as_slice() != &root[..]); +} + +/// Some tests require the hashed keys of the storage. As the values of hashed keys are not trivial +/// to guess, this small module provides the values of the keys, and the code which is required to +/// generate the keys. +#[cfg(feature = "std")] +pub mod storage_key_generator { + use super::*; + use sp_core::Pair; + use sp_keyring::AccountKeyring; + + /// Generate hex string without prefix + pub(super) fn hex(x: T) -> String + where + T: array_bytes::Hex, + { + x.hex(Default::default()) + } + + fn concat_hashes(input: &Vec<&[u8]>) -> String { + input.iter().map(|s| sp_core::hashing::twox_128(s)).map(hex).collect() + } + + fn twox_64_concat(x: &[u8]) -> Vec { + sp_core::hashing::twox_64(x).iter().chain(x.iter()).cloned().collect::>() + } + + /// Generate the hashed storage keys from the raw literals. These keys are expected to be be in + /// storage with given substrate-test runtime. + pub fn generate_expected_storage_hashed_keys() -> Vec { + let literals: Vec<&[u8]> = vec![b":code", b":extrinsic_index", b":heappages"]; + + let keys: Vec> = vec![ + vec![b"Babe", b"Authorities"], + vec![b"Babe", b"EpochConfig"], + vec![b"Babe", b"NextAuthorities"], + vec![b"Babe", b"SegmentIndex"], + vec![b"Babe", b":__STORAGE_VERSION__:"], + vec![b"Balances", b":__STORAGE_VERSION__:"], + vec![b"Balances", b"TotalIssuance"], + vec![b"SubstrateTest", b"Authorities"], + vec![b"SubstrateTest", b":__STORAGE_VERSION__:"], + vec![b"System", b"LastRuntimeUpgrade"], + vec![b"System", b"ParentHash"], + vec![b"System", b":__STORAGE_VERSION__:"], + vec![b"System", b"UpgradedToTripleRefCount"], + vec![b"System", b"UpgradedToU32RefCount"], + ]; + + let mut expected_keys = keys.iter().map(concat_hashes).collect::>(); + + expected_keys.extend(literals.into_iter().map(hex)); + + let balances_map_keys = (0..16_usize) + .into_iter() + .map(|i| AccountKeyring::numeric(i).public().to_vec()) + .chain(vec![ + AccountKeyring::Alice.public().to_vec(), + AccountKeyring::Bob.public().to_vec(), + AccountKeyring::Charlie.public().to_vec(), + ]) + .map(|pubkey| { + sp_core::hashing::blake2_128(&pubkey) + .iter() + .chain(pubkey.iter()) + .cloned() + .collect::>() + }) + .map(|hash_pubkey| { + [concat_hashes(&vec![b"System", b"Account"]), hex(hash_pubkey)].concat() + }); + + expected_keys.extend(balances_map_keys); + + expected_keys.push( + [ + concat_hashes(&vec![b"System", b"BlockHash"]), + hex(0u64.using_encoded(twox_64_concat)), + ] + .concat(), + ); + + expected_keys.sort(); + expected_keys + } + + /// Provides the commented list of hashed keys. This contains a hard-coded list of hashed keys + /// that would be generated by `generate_expected_storage_hashed_keys`. This list is provided + /// for the debugging convenience only. Value of each hex-string is documented with the literal + /// origin. + pub fn get_expected_storage_hashed_keys() -> Vec { + [ + //System|:__STORAGE_VERSION__: + "00771836bebdd29870ff246d305c578c4e7b9012096b41c4eb3aaf947f6ea429", + //SubstrateTest|Authorities + "00771836bebdd29870ff246d305c578c5e0621c4869aa60c02be9adcc98a0d1d", + //Babe|:__STORAGE_VERSION__: + "1cb6f36e027abb2091cfb5110ab5087f4e7b9012096b41c4eb3aaf947f6ea429", + //Babe|Authorities + "1cb6f36e027abb2091cfb5110ab5087f5e0621c4869aa60c02be9adcc98a0d1d", + //Babe|SegmentIndex + "1cb6f36e027abb2091cfb5110ab5087f66e8f035c8adbe7f1547b43c51e6f8a4", + //Babe|NextAuthorities + "1cb6f36e027abb2091cfb5110ab5087faacf00b9b41fda7a9268821c2a2b3e4c", + //Babe|EpochConfig + "1cb6f36e027abb2091cfb5110ab5087fdc6b171b77304263c292cc3ea5ed31ef", + //System|:__STORAGE_VERSION__: + "26aa394eea5630e07c48ae0c9558cef74e7b9012096b41c4eb3aaf947f6ea429", + //System|UpgradedToU32RefCount + "26aa394eea5630e07c48ae0c9558cef75684a022a34dd8bfa2baaf44f172b710", + //System|ParentHash + "26aa394eea5630e07c48ae0c9558cef78a42f33323cb5ced3b44dd825fda9fcc", + //System::BlockHash|0 + "26aa394eea5630e07c48ae0c9558cef7a44704b568d21667356a5a050c118746bb1bdbcacd6ac9340000000000000000", + //System|UpgradedToTripleRefCount + "26aa394eea5630e07c48ae0c9558cef7a7fd6c28836b9a28522dc924110cf439", + + // System|Account|blake2_128Concat("//11") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da901cae4e3edfbb32c91ed3f01ab964f4eeeab50338d8e5176d3141802d7b010a55dadcd5f23cf8aaafa724627e967e90e", + // System|Account|blake2_128Concat("//4") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da91b614bd4a126f2d5d294e9a8af9da25248d7e931307afb4b68d8d565d4c66e00d856c6d65f5fed6bb82dcfb60e936c67", + // System|Account|blake2_128Concat("//7") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da94b21aff9fe1e8b2fc4b0775b8cbeff28ba8e2c7594dd74730f3ca835e95455d199261897edc9735d602ea29615e2b10b", + // System|Account|blake2_128Concat("//Bob") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da94f9aea1afa791265fae359272badc1cf8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48", + // System|Account|blake2_128Concat("//3") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da95786a2916fcb81e1bd5dcd81e0d2452884617f575372edb5a36d85c04cdf2e4699f96fe33eb5f94a28c041b88e398d0c", + // System|Account|blake2_128Concat("//14") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da95b8542d9672c7b7e779cc7c1e6b605691c2115d06120ea2bee32dd601d02f36367564e7ddf84ae2717ca3f097459652e", + // System|Account|blake2_128Concat("//6") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da996c30bdbfab640838e6b6d3c33ab4adb4211b79e34ee8072eab506edd4b93a7b85a14c9a05e5cdd056d98e7dbca87730", + // System|Account|blake2_128Concat("//9") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da99dc65b1339ec388fbf2ca0cdef51253512c6cfd663203ea16968594f24690338befd906856c4d2f4ef32dad578dba20c", + // System|Account|blake2_128Concat("//8") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da99e6eb5abd62f5fd54793da91a47e6af6125d57171ff9241f07acaa1bb6a6103517965cf2cd00e643b27e7599ebccba70", + // System|Account|blake2_128Concat("//Charlie") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9b0edae20838083f2cde1c4080db8cf8090b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22", + // System|Account|blake2_128Concat("//10") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9d0052993b6f3bd0544fd1f5e4125b9fbde3e789ecd53431fe5c06c12b72137153496dace35c695b5f4d7b41f7ed5763b", + // System|Account|blake2_128Concat("//1") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9d6b7e9a5f12bc571053265dade10d3b4b606fc73f57f03cdb4c932d475ab426043e429cecc2ffff0d2672b0df8398c48", + // System|Account|blake2_128Concat("//Alice") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9de1e86a9a8c739864cf3cc5ec2bea59fd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d", + // System|Account|blake2_128Concat("//2") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9e1a35f56ee295d39287cbffcfc60c4b346f136b564e1fad55031404dd84e5cd3fa76bfe7cc7599b39d38fd06663bbc0a", + // System|Account|blake2_128Concat("//5") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9e2c1dc507e2035edbbd8776c440d870460c57f0008067cc01c5ff9eb2e2f9b3a94299a915a91198bd1021a6c55596f57", + // System|Account|blake2_128Concat("//0") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9eca0e653a94f4080f6311b4e7b6934eb2afba9278e30ccf6a6ceb3a8b6e336b70068f045c666f2e7f4f9cc5f47db8972", + // System|Account|blake2_128Concat("//13") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9ee8bf7ef90fc56a8aa3b90b344c599550c29b161e27ff8ba45bf6bad4711f326fc506a8803453a4d7e3158e993495f10", + // System|Account|blake2_128Concat("//12") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9f5d6f1c082fe63eec7a71fcad00f4a892e3d43b7b0d04e776e69e7be35247cecdac65504c579195731eaf64b7940966e", + // System|Account|blake2_128Concat("//15") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9fbf0818841edf110e05228a6379763c4fc3c37459d9bdc61f58a5ebc01e9e2305a19d390c0543dc733861ec3cf1de01f", + // System|LastRuntimeUpgrade + "26aa394eea5630e07c48ae0c9558cef7f9cce9c888469bb1a0dceaa129672ef8", + // :code + "3a636f6465", + // :extrinsic_index + "3a65787472696e7369635f696e646578", + // :heappages + "3a686561707061676573", + // Balances|:__STORAGE_VERSION__: + "c2261276cc9d1f8598ea4b6a74b15c2f4e7b9012096b41c4eb3aaf947f6ea429", + // Balances|TotalIssuance + "c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80", + ].into_iter().map(String::from).collect::>() + } + + #[test] + fn expected_keys_vec_are_matching() { + assert_eq!( + storage_key_generator::get_expected_storage_hashed_keys(), + storage_key_generator::generate_expected_storage_hashed_keys(), + ); + } +} + +#[cfg(test)] +mod tests { + use super::*; + use codec::Encode; + use frame_support::dispatch::DispatchInfo; + use sc_block_builder::BlockBuilderProvider; + use sp_api::ProvideRuntimeApi; + use sp_consensus::BlockOrigin; + use sp_core::{storage::well_known_keys::HEAP_PAGES, ExecutionContext}; + use sp_keyring::AccountKeyring; + use sp_runtime::{ + traits::{Hash as _, SignedExtension}, + transaction_validity::{InvalidTransaction, ValidTransaction}, + }; + use sp_state_machine::ExecutionStrategy; + use stability_test_runtime_client::{ + prelude::*, runtime::TestAPI, DefaultTestClientBuilderExt, TestClientBuilder, + }; + + #[test] + fn heap_pages_is_respected() { + // This tests that the on-chain `HEAP_PAGES` parameter is respected. + + // Create a client devoting only 8 pages of wasm memory. This gives us ~512k of heap memory. + let mut client = TestClientBuilder::new() + .set_execution_strategy(ExecutionStrategy::AlwaysWasm) + .set_heap_pages(8) + .build(); + let best_hash = client.chain_info().best_hash; + + // Try to allocate 1024k of memory on heap. This is going to fail since it is twice larger + // than the heap. + let ret = client.runtime_api().vec_with_capacity_with_context( + best_hash, + // Use `BlockImport` to ensure we use the on chain heap pages as configured above. + ExecutionContext::Importing, + 1048576, + ); + assert!(ret.is_err()); + + // Create a block that sets the `:heap_pages` to 32 pages of memory which corresponds to + // ~2048k of heap memory. + let (new_at_hash, block) = { + let mut builder = client.new_block(Default::default()).unwrap(); + builder.push_storage_change(HEAP_PAGES.to_vec(), Some(32u64.encode())).unwrap(); + let block = builder.build().unwrap().block; + let hash = block.header.hash(); + (hash, block) + }; + + futures::executor::block_on(client.import(BlockOrigin::Own, block)).unwrap(); + + // Allocation of 1024k while having ~2048k should succeed. + let ret = client.runtime_api().vec_with_capacity(new_at_hash, 1048576); + assert!(ret.is_ok()); + } + + #[test] + fn test_storage() { + let client = + TestClientBuilder::new().set_execution_strategy(ExecutionStrategy::Both).build(); + let runtime_api = client.runtime_api(); + let best_hash = client.chain_info().best_hash; + + runtime_api.test_storage(best_hash).unwrap(); + } + + fn witness_backend() -> (sp_trie::MemoryDB, crate::Hash) { + let mut root = crate::Hash::default(); + let mut mdb = sp_trie::MemoryDB::::default(); + { + let mut trie = + sp_trie::trie_types::TrieDBMutBuilderV1::new(&mut mdb, &mut root).build(); + trie.insert(b"value3", &[142]).expect("insert failed"); + trie.insert(b"value4", &[124]).expect("insert failed"); + }; + (mdb, root) + } + + #[test] + fn witness_backend_works() { + let (db, root) = witness_backend(); + let backend = + sp_state_machine::TrieBackendBuilder::<_, crate::Hashing>::new(db, root).build(); + let proof = sp_state_machine::prove_read(backend, vec![b"value3"]).unwrap(); + let client = + TestClientBuilder::new().set_execution_strategy(ExecutionStrategy::Both).build(); + let runtime_api = client.runtime_api(); + let best_hash = client.chain_info().best_hash; + + runtime_api.test_witness(best_hash, proof, root).unwrap(); + } + + pub fn new_test_ext() -> sp_io::TestExternalities { + genesismap::GenesisStorageBuilder::new( + vec![AccountKeyring::One.public().into(), AccountKeyring::Two.public().into()], + vec![AccountKeyring::One.into(), AccountKeyring::Two.into()], + 1000 * currency::DOLLARS, + ) + .build() + .into() + } + + #[test] + fn validate_storage_keys() { + assert_eq!( + genesismap::GenesisStorageBuilder::default() + .build() + .top + .keys() + .cloned() + .map(storage_key_generator::hex) + .collect::>(), + storage_key_generator::get_expected_storage_hashed_keys() + ); + } + + #[test] + fn validate_unsigned_works() { + stability_sp_tracing::try_init_simple(); + new_test_ext().execute_with(|| { + let failing_calls = vec![ + substrate_test_pallet::Call::bench_call { transfer: Default::default() }, + substrate_test_pallet::Call::include_data { data: vec![] }, + substrate_test_pallet::Call::fill_block { ratio: Perbill::from_percent(50) }, + ]; + let succeeding_calls = vec![ + substrate_test_pallet::Call::deposit_log_digest_item { + log: DigestItem::Other(vec![]), + }, + substrate_test_pallet::Call::storage_change { key: vec![], value: None }, + substrate_test_pallet::Call::read { count: 0 }, + substrate_test_pallet::Call::read_and_panic { count: 0 }, + ]; + + for call in failing_calls { + assert_eq!( + ::validate_unsigned( + TransactionSource::External, + &call, + ), + InvalidTransaction::Call.into(), + ); + } + + for call in succeeding_calls { + assert_eq!( + ::validate_unsigned( + TransactionSource::External, + &call, + ), + Ok(ValidTransaction { + provides: vec![BlakeTwo256::hash_of(&call).encode()], + ..Default::default() + }) + ); + } + }); + } + + #[test] + fn check_substrate_check_signed_extension_works() { + stability_sp_tracing::try_init_simple(); + new_test_ext().execute_with(|| { + let x = sp_keyring::AccountKeyring::Alice.into(); + let info = DispatchInfo::default(); + let len = 0_usize; + assert_eq!( + CheckSubstrateCall {} + .validate( + &x, + &ExtrinsicBuilder::new_call_with_priority(16).build().function, + &info, + len + ) + .unwrap() + .priority, + 16 + ); + + assert_eq!( + CheckSubstrateCall {} + .validate( + &x, + &ExtrinsicBuilder::new_call_do_not_propagate().build().function, + &info, + len + ) + .unwrap() + .propagate, + false + ); + }) + } +} diff --git a/test-utils/stability-runtime/src/substrate_test_pallet.rs b/test-utils/stability-runtime/src/substrate_test_pallet.rs new file mode 100644 index 00000000..1fc91abd --- /dev/null +++ b/test-utils/stability-runtime/src/substrate_test_pallet.rs @@ -0,0 +1,250 @@ +// This file is part of Stability. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! # substrate-test pallet +//! +//! Provides functionality used in unit-tests of numerous modules across substrate that require +//! functioning runtime. Some calls are allowed to be submitted as unsigned extrinsics, however most +//! of them requires signing. Refer to `pallet::Call` for further details. + +use frame_support::{pallet_prelude::*, storage}; +use sp_core::sr25519::Public; +use sp_runtime::{ + traits::{BlakeTwo256, Hash}, + transaction_validity::{ + InvalidTransaction, TransactionSource, TransactionValidity, ValidTransaction, + }, +}; +use sp_std::prelude::*; + +pub use self::pallet::*; + +const LOG_TARGET: &str = "substrate_test_pallet"; + +#[frame_support::pallet(dev_mode)] +pub mod pallet { + use super::*; + use crate::TransferData; + use frame_system::pallet_prelude::*; + use sp_core::storage::well_known_keys; + use sp_runtime::{transaction_validity::TransactionPriority, Perbill}; + + #[pallet::pallet] + #[pallet::without_storage_info] + pub struct Pallet(PhantomData); + + #[pallet::config] + pub trait Config: frame_system::Config {} + + #[pallet::storage] + #[pallet::getter(fn authorities)] + pub type Authorities = StorageValue<_, Vec, ValueQuery>; + + #[pallet::genesis_config] + #[cfg_attr(feature = "std", derive(Default))] + pub struct GenesisConfig { + pub authorities: Vec, + } + + #[pallet::genesis_build] + impl GenesisBuild for GenesisConfig { + fn build(&self) { + >::put(self.authorities.clone()); + } + } + + #[pallet::call] + impl Pallet { + /// Legacy call used in transaction pool benchmarks. + #[pallet::call_index(0)] + #[pallet::weight(100)] + pub fn bench_call(_origin: OriginFor, _transfer: TransferData) -> DispatchResult { + Ok(()) + } + + /// Implicitly fill a block body with some data. + #[pallet::call_index(1)] + #[pallet::weight(100)] + pub fn include_data(origin: OriginFor, _data: Vec) -> DispatchResult { + frame_system::ensure_signed(origin)?; + Ok(()) + } + + /// Put/delete some data from storage. Intended to use as an unsigned extrinsic. + #[pallet::call_index(2)] + #[pallet::weight(100)] + pub fn storage_change( + _origin: OriginFor, + key: Vec, + value: Option>, + ) -> DispatchResult { + match value { + Some(value) => storage::unhashed::put_raw(&key, &value), + None => storage::unhashed::kill(&key), + } + Ok(()) + } + + /// Write a key value pair to the offchain database. + #[pallet::call_index(3)] + #[pallet::weight(100)] + pub fn offchain_index_set( + origin: OriginFor, + key: Vec, + value: Vec, + ) -> DispatchResult { + frame_system::ensure_signed(origin)?; + sp_io::offchain_index::set(&key, &value); + Ok(()) + } + + /// Remove a key and an associated value from the offchain database. + #[pallet::call_index(4)] + #[pallet::weight(100)] + pub fn offchain_index_clear(origin: OriginFor, key: Vec) -> DispatchResult { + frame_system::ensure_signed(origin)?; + sp_io::offchain_index::clear(&key); + Ok(()) + } + + /// Create an index for this call. + #[pallet::call_index(5)] + #[pallet::weight(100)] + pub fn indexed_call(origin: OriginFor, data: Vec) -> DispatchResult { + frame_system::ensure_signed(origin)?; + let content_hash = sp_io::hashing::blake2_256(&data); + let extrinsic_index: u32 = + storage::unhashed::get(well_known_keys::EXTRINSIC_INDEX).unwrap(); + sp_io::transaction_index::index(extrinsic_index, data.len() as u32, content_hash); + Ok(()) + } + + /// Deposit given digest items into the system storage. They will be included in a header + /// during finalization. + #[pallet::call_index(6)] + #[pallet::weight(100)] + pub fn deposit_log_digest_item( + _origin: OriginFor, + log: sp_runtime::generic::DigestItem, + ) -> DispatchResult { + >::deposit_log(log); + Ok(()) + } + + /// This call is validated as `ValidTransaction` with given priority. + #[pallet::call_index(7)] + #[pallet::weight(100)] + pub fn call_with_priority( + _origin: OriginFor, + _priority: TransactionPriority, + ) -> DispatchResult { + Ok(()) + } + + /// This call is validated as non-propagable `ValidTransaction`. + #[pallet::call_index(8)] + #[pallet::weight(100)] + pub fn call_do_not_propagate(_origin: OriginFor) -> DispatchResult { + Ok(()) + } + + /// Fill the block weight up to the given ratio. + #[pallet::call_index(9)] + #[pallet::weight(*_ratio * T::BlockWeights::get().max_block)] + pub fn fill_block(origin: OriginFor, _ratio: Perbill) -> DispatchResult { + ensure_signed(origin)?; + Ok(()) + } + + /// Read X times from the state some data. + /// + /// Panics if it can not read `X` times. + #[pallet::call_index(10)] + #[pallet::weight(100)] + pub fn read(_origin: OriginFor, count: u32) -> DispatchResult { + Self::execute_read(count, false) + } + + /// Read X times from the state some data and then panic! + /// + /// Returns `Ok` if it didn't read anything. + #[pallet::call_index(11)] + #[pallet::weight(100)] + pub fn read_and_panic(_origin: OriginFor, count: u32) -> DispatchResult { + Self::execute_read(count, true) + } + } + + impl Pallet { + fn execute_read(read: u32, panic_at_end: bool) -> DispatchResult { + let mut next_key = vec![]; + for _ in 0..(read as usize) { + if let Some(next) = sp_io::storage::next_key(&next_key) { + // Read the value + sp_io::storage::get(&next); + + next_key = next; + } else { + if panic_at_end { + return Ok(()) + } else { + panic!("Could not read {read} times from the state"); + } + } + } + + if panic_at_end { + panic!("BYE") + } else { + Ok(()) + } + } + } + + #[pallet::validate_unsigned] + impl ValidateUnsigned for Pallet { + type Call = Call; + + fn validate_unsigned(_source: TransactionSource, call: &Self::Call) -> TransactionValidity { + log::trace!(target: LOG_TARGET, "validate_unsigned {call:?}"); + match call { + // Some tests do not need to be complicated with signer and nonce, some need + // reproducible block hash (call signature can't be there). + // Offchain testing requires storage_change. + Call::deposit_log_digest_item { .. } | + Call::storage_change { .. } | + Call::read { .. } | + Call::read_and_panic { .. } => Ok(ValidTransaction { + provides: vec![BlakeTwo256::hash_of(&call).encode()], + ..Default::default() + }), + _ => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)), + } + } + } +} + +pub fn validate_runtime_call(call: &pallet::Call) -> TransactionValidity { + log::trace!(target: LOG_TARGET, "validate_runtime_call {call:?}"); + match call { + Call::call_do_not_propagate {} => + Ok(ValidTransaction { propagate: false, ..Default::default() }), + Call::call_with_priority { priority } => + Ok(ValidTransaction { priority: *priority, ..Default::default() }), + _ => Ok(Default::default()), + } +} diff --git a/test-utils/stability-tracing/Cargo.toml b/test-utils/stability-tracing/Cargo.toml new file mode 100644 index 00000000..30216e06 --- /dev/null +++ b/test-utils/stability-tracing/Cargo.toml @@ -0,0 +1,35 @@ +[package] +name = "stability-sp-tracing" +version = "6.0.0" +authors = ["Stability Solutions"] +edition = "2021" +license = "GPL-3.0-or-later WITH Classpath-exception-2.0" +publish = false + + +[package.metadata.docs.rs] +# let's default to wasm32 +default-target = "wasm32-unknown-unknown" +# with the tracing enabled +features = ["with-tracing"] +# allowing for linux-gnu here, too, allows for `std` to show up as well +targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"] + +[dependencies] +sp-std = { workspace = true } +codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } +tracing = { workspace = true } +tracing-core = { workspace = true } +tracing-subscriber = { workspace = true, optional = true } + +[features] +default = ["std"] +with-tracing = ["codec/derive", "codec/full"] +std = [ + "with-tracing", + "tracing/std", + "tracing-core/std", + "codec/std", + "sp-std/std", + "tracing-subscriber", +] diff --git a/test-utils/stability-tracing/README.md b/test-utils/stability-tracing/README.md new file mode 100644 index 00000000..d66bb900 --- /dev/null +++ b/test-utils/stability-tracing/README.md @@ -0,0 +1,15 @@ +Substrate tracing primitives and macros. + +To trace functions or individual code in Substrate, this crate provides [`within_span`] +and [`enter_span`]. See the individual docs for how to use these macros. + +Note that to allow traces from wasm execution environment there are +2 reserved identifiers for tracing `Field` recording, stored in the consts: +`WASM_TARGET_KEY` and `WASM_NAME_KEY` - if you choose to record fields, you +must ensure that your identifiers do not clash with either of these. + +Additionally, we have a const: `WASM_TRACE_IDENTIFIER`, which holds a span name used +to signal that the 'actual' span name and target should be retrieved instead from +the associated Fields mentioned above. + +License: Apache-2.0 \ No newline at end of file diff --git a/test-utils/stability-tracing/src/lib.rs b/test-utils/stability-tracing/src/lib.rs new file mode 100644 index 00000000..62004bd5 --- /dev/null +++ b/test-utils/stability-tracing/src/lib.rs @@ -0,0 +1,252 @@ +// This file is part of Stability. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Substrate tracing primitives and macros. +//! +//! To trace functions or invidual code in Substrate, this crate provides [`within_span`] +//! and [`enter_span`]. See the individual docs for how to use these macros. +//! +//! Note that to allow traces from wasm execution environment there are +//! 2 reserved identifiers for tracing `Field` recording, stored in the consts: +//! `WASM_TARGET_KEY` and `WASM_NAME_KEY` - if you choose to record fields, you +//! must ensure that your identifiers do not clash with either of these. +//! +//! Additionally, we have a const: `WASM_TRACE_IDENTIFIER`, which holds a span name used +//! to signal that the 'actual' span name and target should be retrieved instead from +//! the associated Fields mentioned above. +//! +//! Note: The `tracing` crate requires trace metadata to be static. This does not work +//! for wasm code in substrate, as it is regularly updated with new code from on-chain +//! events. The workaround for this is for the wasm tracing wrappers to put the +//! `name` and `target` data in the `values` map (normally they would be in the static +//! metadata assembled at compile time). + +#![cfg_attr(not(feature = "std"), no_std)] + +#[cfg(feature = "std")] +use tracing; +pub use tracing::{ + debug, debug_span, error, error_span, event, info, info_span, span, trace, trace_span, warn, + warn_span, Level, Span, +}; + +pub use crate::types::{ + WasmEntryAttributes, WasmFieldName, WasmFields, WasmLevel, WasmMetadata, WasmValue, + WasmValuesSet, +}; +#[cfg(feature = "std")] +pub use crate::types::{WASM_NAME_KEY, WASM_TARGET_KEY, WASM_TRACE_IDENTIFIER}; + +/// Tracing facilities and helpers. +/// +/// This is modeled after the `tracing`/`tracing-core` interface and uses that more or +/// less directly for the native side. Because of certain optimisations the these crates +/// have done, the wasm implementation diverges slightly and is optimised for that use +/// case (like being able to cross the wasm/native boundary via scale codecs). +/// +/// One of said optimisations is that all macros will yield to a `noop` in non-std unless +/// the `with-tracing` feature is explicitly activated. This allows you to just use the +/// tracing wherever you deem fit and without any performance impact by default. Only if +/// the specific `with-tracing`-feature is activated on this crate will it actually include +/// the tracing code in the non-std environment. +/// +/// Because of that optimisation, you should not use the `span!` and `span_*!` macros +/// directly as they yield nothing without the feature present. Instead you should use +/// `enter_span!` and `within_span!` – which would strip away even any parameter conversion +/// you do within the span-definition (and thus optimise your performance). For your +/// convineience you directly specify the `Level` and name of the span or use the full +/// feature set of `span!`/`span_*!` on it: +/// +/// # Example +/// +/// ```rust +/// stability_sp_tracing::enter_span!(stability_sp_tracing::Level::TRACE, "fn wide span"); +/// { +/// stability_sp_tracing::enter_span!(stability_sp_tracing::trace_span!("outer-span")); +/// { +/// stability_sp_tracing::enter_span!(stability_sp_tracing::Level::TRACE, "inner-span"); +/// // .. +/// } // inner span exists here +/// } // outer span exists here +/// +/// stability_sp_tracing::within_span! { +/// stability_sp_tracing::debug_span!("debug-span", you_can_pass="any params"); +/// 1 + 1; +/// // some other complex code +/// } // debug span ends here +/// ``` +/// +/// +/// # Setup +/// +/// This project only provides the macros and facilities to manage tracing +/// it doesn't implement the tracing subscriber or backend directly – that is +/// up to the developer integrating it into a specific environment. In native +/// this can and must be done through the regular `tracing`-facitilies, please +/// see their documentation for details. +/// +/// On the wasm-side we've adopted a similar approach of having a global +/// `TracingSubscriber` that the macros call and that does the actual work +/// of tracking. To provide your tracking, you must implement `TracingSubscriber` +/// and call `set_tracing_subscriber` at the very beginning of your execution – +/// the default subscriber is doing nothing, so any spans or events happening before +/// will not be recorded! +mod types; + +/// Try to init a simple tracing subscriber with log compatibility layer. +/// +/// Ignores any error. Useful for testing. +#[cfg(feature = "std")] +pub fn try_init_simple() { + let _ = tracing_subscriber::fmt() + .with_env_filter(tracing_subscriber::EnvFilter::from_default_env()) + .with_writer(std::io::stderr) + .try_init(); +} + +/// Init a tracing subscriber for logging in tests. +/// +/// Be aware that this enables `TRACE` by default. It also ignores any error +/// while setting up the logger. +/// +/// The logs are not shown by default, logs are only shown when the test fails +/// or if [`nocapture`](https://doc.rust-lang.org/cargo/commands/cargo-test.html#display-options) +/// is being used. +#[cfg(feature = "std")] +pub fn init_for_tests() { + let _ = tracing_subscriber::fmt() + .with_max_level(tracing::Level::TRACE) + .with_test_writer() + .try_init(); +} + +/// Runs given code within a tracing span, measuring it's execution time. +/// +/// If tracing is not enabled, the code is still executed. Pass in level and name or +/// use any valid `stability_sp_tracing::Span`followe by `;` and the code to execute, +/// +/// # Example +/// +/// ``` +/// stability_sp_tracing::within_span! { +/// stability_sp_tracing::Level::TRACE, +/// "test-span"; +/// 1 + 1; +/// // some other complex code +/// } +/// +/// stability_sp_tracing::within_span! { +/// stability_sp_tracing::span!(stability_sp_tracing::Level::WARN, "warn-span", you_can_pass="any params"); +/// 1 + 1; +/// // some other complex code +/// } +/// +/// stability_sp_tracing::within_span! { +/// stability_sp_tracing::debug_span!("debug-span", you_can_pass="any params"); +/// 1 + 1; +/// // some other complex code +/// } +/// ``` +#[cfg(any(feature = "std", feature = "with-tracing"))] +#[macro_export] +macro_rules! within_span { + ( + $span:expr; + $( $code:tt )* + ) => { + $span.in_scope(|| + { + $( $code )* + } + ) + }; + ( + $lvl:expr, + $name:expr; + $( $code:tt )* + ) => { + { + $crate::within_span!($crate::span!($lvl, $name); $( $code )*) + } + }; +} + +#[cfg(all(not(feature = "std"), not(feature = "with-tracing")))] +#[macro_export] +macro_rules! within_span { + ( + $span:stmt; + $( $code:tt )* + ) => { + $( $code )* + }; + ( + $lvl:expr, + $name:expr; + $( $code:tt )* + ) => { + $( $code )* + }; +} + +/// Enter a span - noop for `no_std` without `with-tracing` +#[cfg(all(not(feature = "std"), not(feature = "with-tracing")))] +#[macro_export] +macro_rules! enter_span { + ( $lvl:expr, $name:expr ) => {}; + ( $name:expr ) => {}; // no-op +} + +/// Enter a span. +/// +/// The span will be valid, until the scope is left. Use either level and name +/// or pass in any valid `stability_sp_tracing::Span` for extended usage. The span will +/// be exited on drop – which is at the end of the block or to the next +/// `enter_span!` calls, as this overwrites the local variable. For nested +/// usage or to ensure the span closes at certain time either put it into a block +/// or use `within_span!` +/// +/// # Example +/// +/// ``` +/// stability_sp_tracing::enter_span!(stability_sp_tracing::Level::TRACE, "test-span"); +/// // previous will be dropped here +/// stability_sp_tracing::enter_span!( +/// stability_sp_tracing::span!(stability_sp_tracing::Level::DEBUG, "debug-span", params="value")); +/// stability_sp_tracing::enter_span!(stability_sp_tracing::info_span!("info-span", params="value")); +/// +/// { +/// stability_sp_tracing::enter_span!(stability_sp_tracing::Level::TRACE, "outer-span"); +/// { +/// stability_sp_tracing::enter_span!(stability_sp_tracing::Level::TRACE, "inner-span"); +/// // .. +/// } // inner span exists here +/// } // outer span exists here +/// ``` +#[cfg(any(feature = "std", feature = "with-tracing"))] +#[macro_export] +macro_rules! enter_span { + ( $span:expr ) => { + // Calling this twice in a row will overwrite (and drop) the earlier + // that is a _documented feature_! + let __within_span__ = $span; + let __tracing_guard__ = __within_span__.enter(); + }; + ( $lvl:expr, $name:expr ) => { + $crate::enter_span!($crate::span!($lvl, $name)) + }; +} diff --git a/test-utils/stability-tracing/src/types.rs b/test-utils/stability-tracing/src/types.rs new file mode 100644 index 00000000..b0d119d9 --- /dev/null +++ b/test-utils/stability-tracing/src/types.rs @@ -0,0 +1,669 @@ +// This file is part of Stability. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use codec::{Decode, Encode}; +/// Types for wasm based tracing. Loosly inspired by `tracing-core` but +/// optimised for the specific use case. +use core::{fmt::Debug, format_args}; +use sp_std::{vec, vec::Vec, Writer}; + +/// The Tracing Level – the user can filter by this +#[derive(Clone, Encode, Decode, Debug)] +pub enum WasmLevel { + /// This is a fatal errors + ERROR, + /// This is a warning you should be aware of + WARN, + /// Nice to now info + INFO, + /// Further information for debugging purposes + DEBUG, + /// The lowest level, keeping track of minute detail + TRACE, +} + +impl From<&tracing_core::Level> for WasmLevel { + fn from(l: &tracing_core::Level) -> WasmLevel { + match *l { + tracing_core::Level::ERROR => WasmLevel::ERROR, + tracing_core::Level::WARN => WasmLevel::WARN, + tracing_core::Level::INFO => WasmLevel::INFO, + tracing_core::Level::DEBUG => WasmLevel::DEBUG, + tracing_core::Level::TRACE => WasmLevel::TRACE, + } + } +} + +impl core::default::Default for WasmLevel { + fn default() -> Self { + WasmLevel::TRACE + } +} + +/// A paramter value provided to the span/event +#[derive(Encode, Decode, Clone)] +pub enum WasmValue { + U8(u8), + I8(i8), + U32(u32), + I32(i32), + I64(i64), + U64(u64), + Bool(bool), + Str(Vec), + /// Debug or Display call, this is most-likely a print-able UTF8 String + Formatted(Vec), + /// SCALE CODEC encoded object – the name should allow the received to know + /// how to decode this. + Encoded(Vec), +} + +impl core::fmt::Debug for WasmValue { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + match self { + WasmValue::U8(ref i) => f.write_fmt(format_args!("{}_u8", i)), + WasmValue::I8(ref i) => f.write_fmt(format_args!("{}_i8", i)), + WasmValue::U32(ref i) => f.write_fmt(format_args!("{}_u32", i)), + WasmValue::I32(ref i) => f.write_fmt(format_args!("{}_i32", i)), + WasmValue::I64(ref i) => f.write_fmt(format_args!("{}_i64", i)), + WasmValue::U64(ref i) => f.write_fmt(format_args!("{}_u64", i)), + WasmValue::Bool(ref i) => f.write_fmt(format_args!("{}_bool", i)), + WasmValue::Formatted(ref i) | WasmValue::Str(ref i) => { + if let Ok(v) = core::str::from_utf8(i) { + f.write_fmt(format_args!("{}", v)) + } else { + f.write_fmt(format_args!("{:?}", i)) + } + }, + WasmValue::Encoded(ref v) => { + f.write_str("Scale(")?; + for byte in v { + f.write_fmt(format_args!("{:02x}", byte))?; + } + f.write_str(")") + }, + } + } +} + +impl From for WasmValue { + fn from(u: u8) -> WasmValue { + WasmValue::U8(u) + } +} + +impl From<&i8> for WasmValue { + fn from(inp: &i8) -> WasmValue { + WasmValue::I8(*inp) + } +} + +impl From<&str> for WasmValue { + fn from(inp: &str) -> WasmValue { + WasmValue::Str(inp.as_bytes().to_vec()) + } +} + +impl From<&&str> for WasmValue { + fn from(inp: &&str) -> WasmValue { + WasmValue::Str((*inp).as_bytes().to_vec()) + } +} + +impl From for WasmValue { + fn from(inp: bool) -> WasmValue { + WasmValue::Bool(inp) + } +} + +impl From> for WasmValue { + fn from(inp: core::fmt::Arguments<'_>) -> WasmValue { + let mut buf = Writer::default(); + core::fmt::write(&mut buf, inp).expect("Writing of arguments doesn't fail"); + WasmValue::Formatted(buf.into_inner()) + } +} + +impl From for WasmValue { + fn from(u: i8) -> WasmValue { + WasmValue::I8(u) + } +} + +impl From for WasmValue { + fn from(u: i32) -> WasmValue { + WasmValue::I32(u) + } +} + +impl From<&i32> for WasmValue { + fn from(u: &i32) -> WasmValue { + WasmValue::I32(*u) + } +} + +impl From for WasmValue { + fn from(u: u32) -> WasmValue { + WasmValue::U32(u) + } +} + +impl From<&u32> for WasmValue { + fn from(u: &u32) -> WasmValue { + WasmValue::U32(*u) + } +} + +impl From for WasmValue { + fn from(u: u64) -> WasmValue { + WasmValue::U64(u) + } +} + +impl From for WasmValue { + fn from(u: i64) -> WasmValue { + WasmValue::I64(u) + } +} + +/// The name of a field provided as the argument name when contstructing an +/// `event!` or `span!`. +/// Generally generated automaticaly via `stringify` from an `'static &str`. +/// Likely print-able. +#[derive(Encode, Decode, Clone)] +pub struct WasmFieldName(Vec); + +impl core::fmt::Debug for WasmFieldName { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + if let Ok(v) = core::str::from_utf8(&self.0) { + f.write_fmt(format_args!("{}", v)) + } else { + for byte in self.0.iter() { + f.write_fmt(format_args!("{:02x}", byte))?; + } + Ok(()) + } + } +} + +impl From> for WasmFieldName { + fn from(v: Vec) -> Self { + WasmFieldName(v) + } +} + +impl From<&str> for WasmFieldName { + fn from(v: &str) -> Self { + WasmFieldName(v.as_bytes().to_vec()) + } +} + +/// A list of `WasmFieldName`s in the order provided +#[derive(Encode, Decode, Clone, Debug)] +pub struct WasmFields(Vec); + +impl WasmFields { + /// Iterate over the fields + pub fn iter(&self) -> core::slice::Iter<'_, WasmFieldName> { + self.0.iter() + } +} + +impl From> for WasmFields { + fn from(v: Vec) -> WasmFields { + WasmFields(v) + } +} + +impl From> for WasmFields { + fn from(v: Vec<&str>) -> WasmFields { + WasmFields(v.into_iter().map(|v| v.into()).collect()) + } +} + +impl WasmFields { + /// Create an empty entry + pub fn empty() -> Self { + WasmFields(Vec::with_capacity(0)) + } +} + +impl From<&tracing_core::field::FieldSet> for WasmFields { + fn from(wm: &tracing_core::field::FieldSet) -> WasmFields { + WasmFields(wm.iter().map(|s| s.name().into()).collect()) + } +} + +/// A list of `WasmFieldName`s with the given `WasmValue` (if provided) +/// in the order specified. +#[derive(Encode, Decode, Clone)] +pub struct WasmValuesSet(Vec<(WasmFieldName, Option)>); + +impl core::fmt::Debug for WasmValuesSet { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + let mut wrt = f.debug_struct(""); + let mut non_str = false; + for (f, v) in self.0.iter() { + if let Ok(s) = core::str::from_utf8(&f.0) { + match v { + Some(ref i) => wrt.field(s, i), + None => wrt.field(s, &(None as Option)), + }; + } else { + non_str = true; + } + } + + // FIXME: replace with using `finish_non_exhaustive()` once stable + // https://github.com/rust-lang/rust/issues/67364 + if non_str { + wrt.field("..", &".."); + } + + wrt.finish() + } +} + +impl From)>> for WasmValuesSet { + fn from(v: Vec<(WasmFieldName, Option)>) -> Self { + WasmValuesSet(v) + } +} +impl From)>> for WasmValuesSet { + fn from(v: Vec<(&&WasmFieldName, Option)>) -> Self { + WasmValuesSet(v.into_iter().map(|(k, v)| ((**k).clone(), v)).collect()) + } +} + +impl From)>> for WasmValuesSet { + fn from(v: Vec<(&&str, Option)>) -> Self { + WasmValuesSet(v.into_iter().map(|(k, v)| ((*k).into(), v)).collect()) + } +} + +impl WasmValuesSet { + /// Create an empty entry + pub fn empty() -> Self { + WasmValuesSet(Vec::with_capacity(0)) + } +} + +impl tracing_core::field::Visit for WasmValuesSet { + fn record_debug(&mut self, field: &tracing_core::field::Field, value: &dyn Debug) { + self.0 + .push((field.name().into(), Some(WasmValue::from(format_args!("{:?}", value))))) + } + fn record_i64(&mut self, field: &tracing_core::field::Field, value: i64) { + self.0.push((field.name().into(), Some(WasmValue::from(value)))) + } + fn record_u64(&mut self, field: &tracing_core::field::Field, value: u64) { + self.0.push((field.name().into(), Some(WasmValue::from(value)))) + } + fn record_bool(&mut self, field: &tracing_core::field::Field, value: bool) { + self.0.push((field.name().into(), Some(WasmValue::from(value)))) + } + fn record_str(&mut self, field: &tracing_core::field::Field, value: &str) { + self.0.push((field.name().into(), Some(WasmValue::from(value)))) + } +} +/// Metadata provides generic information about the specifc location of the +/// `span!` or `event!` call on the wasm-side. +#[derive(Encode, Decode, Clone)] +pub struct WasmMetadata { + /// The name given to `event!`/`span!`, `&'static str` converted to bytes + pub name: Vec, + /// The given target to `event!`/`span!` – or module-name, `&'static str` converted to bytes + pub target: Vec, + /// The level of this entry + pub level: WasmLevel, + /// The file this was emitted from – useful for debugging; `&'static str` converted to bytes + pub file: Vec, + /// The specific line number in the file – useful for debugging + pub line: u32, + /// The module path; `&'static str` converted to bytes + pub module_path: Vec, + /// Whether this is a call to `span!` or `event!` + pub is_span: bool, + /// The list of fields specified in the call + pub fields: WasmFields, +} + +impl From<&tracing_core::Metadata<'_>> for WasmMetadata { + fn from(wm: &tracing_core::Metadata<'_>) -> WasmMetadata { + WasmMetadata { + name: wm.name().as_bytes().to_vec(), + target: wm.target().as_bytes().to_vec(), + level: wm.level().into(), + file: wm.file().map(|f| f.as_bytes().to_vec()).unwrap_or_default(), + line: wm.line().unwrap_or_default(), + module_path: wm.module_path().map(|m| m.as_bytes().to_vec()).unwrap_or_default(), + is_span: wm.is_span(), + fields: wm.fields().into(), + } + } +} + +impl core::fmt::Debug for WasmMetadata { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + f.debug_struct("WasmMetadata") + .field("name", &decode_field(&self.name)) + .field("target", &decode_field(&self.target)) + .field("level", &self.level) + .field("file", &decode_field(&self.file)) + .field("line", &self.line) + .field("module_path", &decode_field(&self.module_path)) + .field("is_span", &self.is_span) + .field("fields", &self.fields) + .finish() + } +} + +impl core::default::Default for WasmMetadata { + fn default() -> Self { + let target = "default".as_bytes().to_vec(); + WasmMetadata { + target, + name: Default::default(), + level: Default::default(), + file: Default::default(), + line: Default::default(), + module_path: Default::default(), + is_span: true, + fields: WasmFields::empty(), + } + } +} + +fn decode_field(field: &[u8]) -> &str { + core::str::from_utf8(field).unwrap_or_default() +} + +/// Span or Event Attributes +#[derive(Encode, Decode, Clone, Debug)] +pub struct WasmEntryAttributes { + /// the parent, if directly specified – otherwise assume most inner span + pub parent_id: Option, + /// the metadata of the location + pub metadata: WasmMetadata, + /// the Values provided + pub fields: WasmValuesSet, +} + +impl From<&tracing_core::Event<'_>> for WasmEntryAttributes { + fn from(evt: &tracing_core::Event<'_>) -> WasmEntryAttributes { + let mut fields = WasmValuesSet(Vec::new()); + evt.record(&mut fields); + WasmEntryAttributes { + parent_id: evt.parent().map(|id| id.into_u64()), + metadata: evt.metadata().into(), + fields, + } + } +} + +impl From<&tracing_core::span::Attributes<'_>> for WasmEntryAttributes { + fn from(attrs: &tracing_core::span::Attributes<'_>) -> WasmEntryAttributes { + let mut fields = WasmValuesSet(Vec::new()); + attrs.record(&mut fields); + WasmEntryAttributes { + parent_id: attrs.parent().map(|id| id.into_u64()), + metadata: attrs.metadata().into(), + fields, + } + } +} + +impl core::default::Default for WasmEntryAttributes { + fn default() -> Self { + WasmEntryAttributes { + parent_id: None, + metadata: Default::default(), + fields: WasmValuesSet(vec![]), + } + } +} + +#[cfg(feature = "std")] +mod std_features { + + use tracing_core::callsite; + + /// Static entry use for wasm-originated metadata. + pub struct WasmCallsite; + impl callsite::Callsite for WasmCallsite { + fn set_interest(&self, _: tracing_core::Interest) { + unimplemented!() + } + fn metadata(&self) -> &tracing_core::Metadata { + unimplemented!() + } + } + static CALLSITE: WasmCallsite = WasmCallsite; + /// The identifier we are using to inject the wasm events in the generic `tracing` system + pub static WASM_TRACE_IDENTIFIER: &str = "wasm_tracing"; + /// The fieldname for the wasm-originated name + pub static WASM_NAME_KEY: &str = "name"; + /// The fieldname for the wasm-originated target + pub static WASM_TARGET_KEY: &str = "target"; + /// The the list of all static field names we construct from the given metadata + pub static GENERIC_FIELDS: &[&str] = + &[WASM_TARGET_KEY, WASM_NAME_KEY, "file", "line", "module_path", "params"]; + + // Implementation Note: + // the original `tracing` crate generates these static metadata entries at every `span!` and + // `event!` location to allow for highly optimised filtering. For us to allow level-based + // emitting of wasm events we need these static metadata entries to inject into that system. We + // then provide generic `From`-implementations picking the right metadata to refer to. + + static SPAN_ERROR_METADATA: tracing_core::Metadata<'static> = tracing::Metadata::new( + WASM_TRACE_IDENTIFIER, + WASM_TRACE_IDENTIFIER, + tracing::Level::ERROR, + None, + None, + None, + tracing_core::field::FieldSet::new( + GENERIC_FIELDS, + tracing_core::identify_callsite!(&CALLSITE), + ), + tracing_core::metadata::Kind::SPAN, + ); + + static SPAN_WARN_METADATA: tracing_core::Metadata<'static> = tracing::Metadata::new( + WASM_TRACE_IDENTIFIER, + WASM_TRACE_IDENTIFIER, + tracing::Level::WARN, + None, + None, + None, + tracing_core::field::FieldSet::new( + GENERIC_FIELDS, + tracing_core::identify_callsite!(&CALLSITE), + ), + tracing_core::metadata::Kind::SPAN, + ); + static SPAN_INFO_METADATA: tracing_core::Metadata<'static> = tracing::Metadata::new( + WASM_TRACE_IDENTIFIER, + WASM_TRACE_IDENTIFIER, + tracing::Level::INFO, + None, + None, + None, + tracing_core::field::FieldSet::new( + GENERIC_FIELDS, + tracing_core::identify_callsite!(&CALLSITE), + ), + tracing_core::metadata::Kind::SPAN, + ); + + static SPAN_DEBUG_METADATA: tracing_core::Metadata<'static> = tracing::Metadata::new( + WASM_TRACE_IDENTIFIER, + WASM_TRACE_IDENTIFIER, + tracing::Level::DEBUG, + None, + None, + None, + tracing_core::field::FieldSet::new( + GENERIC_FIELDS, + tracing_core::identify_callsite!(&CALLSITE), + ), + tracing_core::metadata::Kind::SPAN, + ); + + static SPAN_TRACE_METADATA: tracing_core::Metadata<'static> = tracing::Metadata::new( + WASM_TRACE_IDENTIFIER, + WASM_TRACE_IDENTIFIER, + tracing::Level::TRACE, + None, + None, + None, + tracing_core::field::FieldSet::new( + GENERIC_FIELDS, + tracing_core::identify_callsite!(&CALLSITE), + ), + tracing_core::metadata::Kind::SPAN, + ); + + static EVENT_ERROR_METADATA: tracing_core::Metadata<'static> = tracing::Metadata::new( + WASM_TRACE_IDENTIFIER, + WASM_TRACE_IDENTIFIER, + tracing::Level::ERROR, + None, + None, + None, + tracing_core::field::FieldSet::new( + GENERIC_FIELDS, + tracing_core::identify_callsite!(&CALLSITE), + ), + tracing_core::metadata::Kind::EVENT, + ); + + static EVENT_WARN_METADATA: tracing_core::Metadata<'static> = tracing::Metadata::new( + WASM_TRACE_IDENTIFIER, + WASM_TRACE_IDENTIFIER, + tracing::Level::WARN, + None, + None, + None, + tracing_core::field::FieldSet::new( + GENERIC_FIELDS, + tracing_core::identify_callsite!(&CALLSITE), + ), + tracing_core::metadata::Kind::EVENT, + ); + + static EVENT_INFO_METADATA: tracing_core::Metadata<'static> = tracing::Metadata::new( + WASM_TRACE_IDENTIFIER, + WASM_TRACE_IDENTIFIER, + tracing::Level::INFO, + None, + None, + None, + tracing_core::field::FieldSet::new( + GENERIC_FIELDS, + tracing_core::identify_callsite!(&CALLSITE), + ), + tracing_core::metadata::Kind::EVENT, + ); + + static EVENT_DEBUG_METADATA: tracing_core::Metadata<'static> = tracing::Metadata::new( + WASM_TRACE_IDENTIFIER, + WASM_TRACE_IDENTIFIER, + tracing::Level::DEBUG, + None, + None, + None, + tracing_core::field::FieldSet::new( + GENERIC_FIELDS, + tracing_core::identify_callsite!(&CALLSITE), + ), + tracing_core::metadata::Kind::EVENT, + ); + + static EVENT_TRACE_METADATA: tracing_core::Metadata<'static> = tracing::Metadata::new( + WASM_TRACE_IDENTIFIER, + WASM_TRACE_IDENTIFIER, + tracing::Level::TRACE, + None, + None, + None, + tracing_core::field::FieldSet::new( + GENERIC_FIELDS, + tracing_core::identify_callsite!(&CALLSITE), + ), + tracing_core::metadata::Kind::EVENT, + ); + + // FIXME: this could be done a lot in 0.2 if they opt for using `Cow` instead + // https://github.com/paritytech/substrate/issues/7134 + impl From<&crate::WasmMetadata> for &'static tracing_core::Metadata<'static> { + fn from(wm: &crate::WasmMetadata) -> &'static tracing_core::Metadata<'static> { + match (&wm.level, wm.is_span) { + (&crate::WasmLevel::ERROR, true) => &SPAN_ERROR_METADATA, + (&crate::WasmLevel::WARN, true) => &SPAN_WARN_METADATA, + (&crate::WasmLevel::INFO, true) => &SPAN_INFO_METADATA, + (&crate::WasmLevel::DEBUG, true) => &SPAN_DEBUG_METADATA, + (&crate::WasmLevel::TRACE, true) => &SPAN_TRACE_METADATA, + (&crate::WasmLevel::ERROR, false) => &EVENT_ERROR_METADATA, + (&crate::WasmLevel::WARN, false) => &EVENT_WARN_METADATA, + (&crate::WasmLevel::INFO, false) => &EVENT_INFO_METADATA, + (&crate::WasmLevel::DEBUG, false) => &EVENT_DEBUG_METADATA, + (&crate::WasmLevel::TRACE, false) => &EVENT_TRACE_METADATA, + } + } + } + + impl From for tracing::Span { + fn from(a: crate::WasmEntryAttributes) -> tracing::Span { + let name = std::str::from_utf8(&a.metadata.name).unwrap_or_default(); + let target = std::str::from_utf8(&a.metadata.target).unwrap_or_default(); + let file = std::str::from_utf8(&a.metadata.file).unwrap_or_default(); + let line = a.metadata.line; + let module_path = std::str::from_utf8(&a.metadata.module_path).unwrap_or_default(); + let params = a.fields; + let metadata: &tracing_core::metadata::Metadata<'static> = (&a.metadata).into(); + + tracing::span::Span::child_of( + a.parent_id.map(tracing_core::span::Id::from_u64), + metadata, + &tracing::valueset! { metadata.fields(), target, name, file, line, module_path, ?params }, + ) + } + } + + impl crate::WasmEntryAttributes { + /// convert the given Attributes to an event and emit it using `tracing_core`. + pub fn emit(self: crate::WasmEntryAttributes) { + let name = std::str::from_utf8(&self.metadata.name).unwrap_or_default(); + let target = std::str::from_utf8(&self.metadata.target).unwrap_or_default(); + let file = std::str::from_utf8(&self.metadata.file).unwrap_or_default(); + let line = self.metadata.line; + let module_path = std::str::from_utf8(&self.metadata.module_path).unwrap_or_default(); + let params = self.fields; + let metadata: &tracing_core::metadata::Metadata<'static> = (&self.metadata).into(); + + tracing_core::Event::child_of( + self.parent_id.map(tracing_core::span::Id::from_u64), + metadata, + &tracing::valueset! { metadata.fields(), target, name, file, line, module_path, ?params }, + ) + } + } +} + +#[cfg(feature = "std")] +pub use std_features::*; From 41cbcb06db0b03364651075a220a3dcc7dfb0543 Mon Sep 17 00:00:00 2001 From: GabrielMartinezRodriguez Date: Fri, 10 Nov 2023 15:25:38 +0100 Subject: [PATCH 10/37] chore: remove --unsafe-ws-external --- Makefile.toml | 2 +- docker/client/entrypoint.sh | 4 ++-- docs/GETTING-STARTED.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.toml b/Makefile.toml index 120878da..364fe645 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -6,5 +6,5 @@ default_to_workspace = false [tasks.alphanet-dev] script = [ - "cargo run --release -- --dev --unsafe-rpc-external --rpc-cors all --unsafe-ws-external" + "cargo run --release -- --dev --unsafe-rpc-external --rpc-cors all" ] diff --git a/docker/client/entrypoint.sh b/docker/client/entrypoint.sh index 23b6b7ab..30c8c219 100644 --- a/docker/client/entrypoint.sh +++ b/docker/client/entrypoint.sh @@ -11,7 +11,7 @@ fi if [[ "$CHAIN_TARGET" == "dev" ]]; then echo "Starting dev chain" - START_COMMAND_DEV="./target/release/stability --base-path /tmp/node --dev --unsafe-rpc-external --rpc-cors all --unsafe-ws-external --prometheus-external" + START_COMMAND_DEV="./target/release/stability --base-path /tmp/node --dev --unsafe-rpc-external --rpc-cors all --prometheus-external" if [ "$MODE" = "archive" ]; then START_COMMAND_DEV="$START_COMMAND_DEV --pruning archive" @@ -36,7 +36,7 @@ if [ -n "$SEED" ]; then --key-type gran fi -START_COMMAND="./target/release/stability --base-path /tmp/node --validator --unsafe-rpc-external --rpc-cors all --unsafe-ws-external --prometheus-external --chain=$CHAIN_TARGET" +START_COMMAND="./target/release/stability --base-path /tmp/node --validator --unsafe-rpc-external --rpc-cors all --prometheus-external --chain=$CHAIN_TARGET" if [ "$MODE" = "archive" ]; then START_COMMAND="$START_COMMAND --pruning archive" diff --git a/docs/GETTING-STARTED.md b/docs/GETTING-STARTED.md index 989fb15a..7227c665 100644 --- a/docs/GETTING-STARTED.md +++ b/docs/GETTING-STARTED.md @@ -65,7 +65,7 @@ Additionally, you can configure the following flags: - `--validator`: Assumes that you are a validator and begins validation if you are on the validators' list. - `--pruning archive`: Runs your node in archival mode. An archival node maintains a complete copy and allows queries on any historical chain state. -- `--unsafe-rpc-external --rpc-cors all --unsafe-ws-external`: Use if your node will be accessed from a system external to your localhost. +- `--unsafe-rpc-external --rpc-cors all`: Use if your node will be accessed from a system external to your localhost. - `--bootnodes`: A list of p2p nodes for Stability to join the network. What is known as bootnodes - `--base-path`: Specifies a custom base path for the data folder From eb0e7ffeb252a10444ff1b6a9e81094493c0d245 Mon Sep 17 00:00:00 2001 From: GabrielMartinezRodriguez Date: Fri, 10 Nov 2023 15:41:44 +0100 Subject: [PATCH 11/37] chore: changed rpc port --- docker/README.md | 4 ++-- docker/client/Dockerfile | 3 +-- docker/client/entrypoint.sh | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docker/README.md b/docker/README.md index dd2a1e71..3614895e 100644 --- a/docker/README.md +++ b/docker/README.md @@ -26,7 +26,7 @@ $ docker build -f ./docker/client/Dockerfile -t stability . ### Run ``` -docker run -d -p 30333:30333 -p 9933:9933 -p 9944:9944 -p 9615:9615 -e CHAIN="/stability/chain-specs/betanet.json" stability +docker run -d -p 30333:30333 -p 9933:9933 -p 9615:9615 -e CHAIN="/stability/chain-specs/betanet.json" stability ``` Optional environment variables: @@ -42,7 +42,7 @@ To set an environment variable in the docker run, use the flag -e NAME=VALUE ### Example ``` -docker run -d -p 30333:30333 -p 9933:9933 -p 9944:9944 -p 9615:9615 -e SEED=account -e CHAIN="/stability/chain-specs/betanet.json" -e MODE=archive -e BOOTNODES=/ip4/... stability +docker run -d -p 30333:30333 -p 9933:9933 -p 9615:9615 -e SEED=account -e CHAIN="/stability/chain-specs/betanet.json" -e MODE=archive -e BOOTNODES=/ip4/... stability ``` ## Test diff --git a/docker/client/Dockerfile b/docker/client/Dockerfile index af7f7c73..e8388d78 100644 --- a/docker/client/Dockerfile +++ b/docker/client/Dockerfile @@ -28,9 +28,8 @@ RUN cargo build "--$PROFILE" # 30333 for p2p traffic # 9933 for RPC call -# 9944 for Websocket # 9615 for Prometheus (metrics) -EXPOSE 30333 9933 9944 9615 +EXPOSE 30333 9933 9615 # Copy entrypoint diff --git a/docker/client/entrypoint.sh b/docker/client/entrypoint.sh index 30c8c219..09639035 100644 --- a/docker/client/entrypoint.sh +++ b/docker/client/entrypoint.sh @@ -36,7 +36,7 @@ if [ -n "$SEED" ]; then --key-type gran fi -START_COMMAND="./target/release/stability --base-path /tmp/node --validator --unsafe-rpc-external --rpc-cors all --prometheus-external --chain=$CHAIN_TARGET" +START_COMMAND="./target/release/stability --base-path /tmp/node --validator --unsafe-rpc-external --rpc-cors all --rpc-port 9933 --prometheus-external --chain=$CHAIN_TARGET" if [ "$MODE" = "archive" ]; then START_COMMAND="$START_COMMAND --pruning archive" From 8fc39afebbd393e822ad3ec7e92fa7c988de254a Mon Sep 17 00:00:00 2001 From: Daniel Blanco Parla Date: Mon, 13 Nov 2023 10:24:13 +0100 Subject: [PATCH 12/37] hotifx(custom_fee): reduce calc on type 1 --- primitives/tools/src/custom_fee.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/primitives/tools/src/custom_fee.rs b/primitives/tools/src/custom_fee.rs index 9387acba..6b0e1509 100644 --- a/primitives/tools/src/custom_fee.rs +++ b/primitives/tools/src/custom_fee.rs @@ -29,7 +29,7 @@ pub fn custom_info_from_fee_params( .map(|_| (max_fee_per_gas.unwrap(), 1_000_000_000.into())), max_fee_per_gas: max_priority_fee_per_gas .map(|max_priority_fee_per_gas| max_priority_fee_per_gas.saturating_add(base_fee)) - .unwrap_or(max_fee_per_gas.unwrap_or_default()), + .unwrap_or(max_fee_per_gas.unwrap_or(base_fee)), max_priority_fee_per_gas, } } From 75ca1875e0583d3187831fb7630af1428ad73654 Mon Sep 17 00:00:00 2001 From: Daniel Blanco Parla Date: Mon, 13 Nov 2023 11:39:10 +0100 Subject: [PATCH 13/37] Revert "hotifx(custom_fee): reduce calc on type 1" This reverts commit 8fc39afebbd393e822ad3ec7e92fa7c988de254a. --- primitives/tools/src/custom_fee.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/primitives/tools/src/custom_fee.rs b/primitives/tools/src/custom_fee.rs index 6b0e1509..9387acba 100644 --- a/primitives/tools/src/custom_fee.rs +++ b/primitives/tools/src/custom_fee.rs @@ -29,7 +29,7 @@ pub fn custom_info_from_fee_params( .map(|_| (max_fee_per_gas.unwrap(), 1_000_000_000.into())), max_fee_per_gas: max_priority_fee_per_gas .map(|max_priority_fee_per_gas| max_priority_fee_per_gas.saturating_add(base_fee)) - .unwrap_or(max_fee_per_gas.unwrap_or(base_fee)), + .unwrap_or(max_fee_per_gas.unwrap_or_default()), max_priority_fee_per_gas, } } From b91814c2ad317a558d0178732ab1e8f630690849 Mon Sep 17 00:00:00 2001 From: Daniel Blanco Parla Date: Mon, 13 Nov 2023 11:43:39 +0100 Subject: [PATCH 14/37] feat(Runtime): estimate_transaction_len --- runtime/src/lib.rs | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index d2e04191..009f788c 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -65,8 +65,7 @@ use fp_evm::weight_per_gas; use fp_rpc::TransactionStatus; use pallet_ethereum::{Call::transact, PostLogContent, Transaction as EthereumTransaction}; use pallet_evm::{ - Account as EVMAccount, EnsureAccountId20, FeeCalculator, GasWeightMapping, - Runner + Account as EVMAccount, EnsureAccountId20, FeeCalculator, GasWeightMapping, Runner, }; use pallet_sponsored_transactions::Call::send_sponsored_transaction; use pallet_validator_set::SessionBlockManager; @@ -75,7 +74,9 @@ pub use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{ConstU32, ConstU8, FindAuthor, KeyOwnerProofSystem, OnTimestampSet, Randomness, OnFinalize}, + traits::{ + ConstU32, ConstU8, FindAuthor, KeyOwnerProofSystem, OnFinalize, OnTimestampSet, Randomness, + }, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight}, ConstantMultiplier, IdentityFee, Weight, @@ -461,7 +462,6 @@ where const WEIGHT_PER_GAS: u64 = 20_000; - parameter_types! { pub PrecompilesValue: StabilityPrecompiles = StabilityPrecompiles::<_, StabilityFeeController>::new(); pub WeightPerGas: Weight = Weight::from_ref_time(WEIGHT_PER_GAS); @@ -1093,22 +1093,23 @@ impl_runtime_apis! { let validate = true; let evm_config = config.as_ref().unwrap_or(::config()); + // Estimated encoded transaction size must be based on the heaviest transaction + // type (EIP1559Transaction) to be compatible with all transaction types. let mut estimated_transaction_len = data.len() + - 20 + // to - 20 + // from - 32 + // value - 32 + // gas_limit - 32 + // nonce - 1 + // TransactionAction - 8 + // chain id - 65; // signature + // pallet ethereum index: 1 + // transact call index: 1 + // Transaction enum variant: 1 + // chain_id 8 bytes + // nonce: 32 + // max_priority_fee_per_gas: 32 + // max_fee_per_gas: 32 + // gas_limit: 32 + // action: 21 (enum varianrt + call address) + // value: 32 + // access_list: 1 (empty vec size) + // 65 bytes signature + 258; - if max_fee_per_gas.is_some() { - estimated_transaction_len += 32; - } - if max_priority_fee_per_gas.is_some() { - estimated_transaction_len += 32; - } if access_list.is_some() { estimated_transaction_len += access_list.encoded_size(); } From 986b7cf29d2c72cf0289fc12b007e79c3c06154e Mon Sep 17 00:00:00 2001 From: GabrielMartinezRodriguez Date: Mon, 13 Nov 2023 14:09:44 +0100 Subject: [PATCH 15/37] chore: warnings --- Cargo.lock | 622 +++++++++--------- Cargo.toml | 6 +- client/authorship/Cargo.toml | 2 +- client/authorship/src/authorship.rs | 1 - node/Cargo.toml | 2 +- node/src/rpc/eth.rs | 1 - pallets/custom-balances/Cargo.toml | 2 +- pallets/custom-balances/src/lib.rs | 4 +- pallets/custom-balances/src/mock.rs | 2 +- pallets/dnt-fee-controller/Cargo.toml | 2 +- pallets/erc20-manager/Cargo.toml | 2 +- pallets/fee-rewards-vault/Cargo.toml | 2 +- pallets/root-controller/Cargo.toml | 2 +- pallets/root-controller/src/lib.rs | 2 +- pallets/root-controller/src/mock.rs | 5 +- pallets/sponsored-transactions/Cargo.toml | 2 +- .../supported-tokens-manager/Cargo.toml | 2 +- .../user-fee-selector/Cargo.toml | 2 +- .../validator-fee-selector/Cargo.toml | 2 +- pallets/upgrade-runtime-proposal/Cargo.toml | 2 +- pallets/upgrade-runtime-proposal/src/lib.rs | 6 +- pallets/validator-keys-controller/Cargo.toml | 2 +- pallets/validator-keys-controller/src/lib.rs | 3 +- pallets/validator-set/Cargo.toml | 2 +- pallets/validator-set/src/lib.rs | 9 +- pallets/zero-gas-transactions/Cargo.toml | 2 +- .../fee-rewards-vault-controller/Cargo.toml | 2 +- .../upgrade-runtime-controller/Cargo.toml | 2 +- precompiles/utils/Cargo.toml | 2 +- precompiles/utils/src/precompile_set.rs | 10 - precompiles/utils/src/testing/execution.rs | 3 +- precompiles/validator-controller/Cargo.toml | 2 +- primitives/fee-compatible-api/Cargo.toml | 2 +- primitives/runner/Cargo.toml | 2 +- primitives/runner/src/lib.rs | 2 - primitives/stability-rpc-api/Cargo.toml | 2 +- primitives/transaction-validator/Cargo.toml | 2 +- .../zero-gas-transactions-api/Cargo.toml | 2 +- runtime/src/lib.rs | 5 +- runtime/src/stability_config.rs | 7 +- stability-rpc/Cargo.toml | 2 +- test-utils/stability-client/Cargo.toml | 2 +- test-utils/stability-root-testing/Cargo.toml | 2 +- .../stability-runtime-client/Cargo.toml | 2 +- test-utils/stability-runtime/Cargo.toml | 2 +- test-utils/stability-runtime/src/lib.rs | 2 +- test-utils/stability-tracing/Cargo.toml | 2 +- 47 files changed, 374 insertions(+), 376 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 11bf6dd1..8c461067 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -178,25 +178,26 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.11", "once_cell", "version_check", ] [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", - "getrandom 0.2.10", + "getrandom 0.2.11", "once_cell", "version_check", + "zerocopy", ] [[package]] @@ -240,30 +241,29 @@ dependencies = [ [[package]] name = "anstream" -version = "0.3.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is-terminal", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" dependencies = [ "utf8parse", ] @@ -279,9 +279,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "1.0.1" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" dependencies = [ "anstyle", "windows-sys 0.48.0", @@ -316,9 +316,9 @@ checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" [[package]] name = "array-bytes" -version = "6.1.0" +version = "6.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b1c5a481ec30a5abd8dfbd94ab5cf1bb4e9a66be7f1b3b322f2f1170c200fd" +checksum = "de17a919934ad8c5cc99a1a74de4e2dab95d6121a8f27f94755ff525b630382c" [[package]] name = "arrayref" @@ -445,9 +445,9 @@ dependencies = [ "log", "parking", "polling", - "rustix 0.37.25", + "rustix 0.37.27", "slab", - "socket2 0.4.9", + "socket2 0.4.10", "waker-fn", ] @@ -468,7 +468,7 @@ checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -569,9 +569,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.4" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "base64ct" @@ -581,9 +581,9 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "basic-toml" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bfc506e7a2370ec239e1d072507b2a80c833083699d3c6fa176fbb4de8448c6" +checksum = "2f2139706359229bfa8f19142ac1155b4b80beafb7a60471ac5dd109d4a19778" dependencies = [ "serde", ] @@ -633,7 +633,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -801,9 +801,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79ad7fb2dd38f3dabd76b09c6a5a20c038fc0213ef1e9afd30eb777f120f019" +checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c" dependencies = [ "memchr", "serde", @@ -905,11 +905,10 @@ checksum = "fd6c0e7b807d60291f42f33f58480c0bfafe28ed08286446f45e463728cf9c1c" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "0f8e7c90afad890484a21653d08b6e209ae34770fb5ee298f9c699fcc1e5c856" dependencies = [ - "jobserver", "libc", ] @@ -956,25 +955,24 @@ checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] name = "chacha20" -version = "0.8.2" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" +checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" dependencies = [ "cfg-if", - "cipher 0.3.0", + "cipher 0.4.4", "cpufeatures", - "zeroize", ] [[package]] name = "chacha20poly1305" -version = "0.9.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" +checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" dependencies = [ - "aead 0.4.3", + "aead 0.5.2", "chacha20", - "cipher 0.3.0", + "cipher 0.4.4", "poly1305", "zeroize", ] @@ -1032,6 +1030,7 @@ checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ "crypto-common", "inout", + "zeroize", ] [[package]] @@ -1056,45 +1055,43 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.8" +version = "4.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9394150f5b4273a1763355bd1c2ec54cc5a2593f790587bcd6b2c947cfa9211" +checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" dependencies = [ "clap_builder", "clap_derive", - "once_cell", ] [[package]] name = "clap_builder" -version = "4.3.8" +version = "4.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a78fbdd3cc2914ddf37ba444114bc7765bbdcb55ec9cbe6fa054f0137400717" +checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" dependencies = [ "anstream", "anstyle", - "bitflags 1.3.2", "clap_lex", "strsim", ] [[package]] name = "clap_derive" -version = "4.3.2" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "codespan-reporting" @@ -1210,9 +1207,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" dependencies = [ "libc", ] @@ -1326,9 +1323,9 @@ dependencies = [ [[package]] name = "crc-catalog" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crc32fast" @@ -1402,9 +1399,9 @@ dependencies = [ [[package]] name = "crypto-bigint" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" +checksum = "28f85c3514d2a6e64160359b45a3918c3b4178bcbf4ae5d03ab2d02e521c479a" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", @@ -1498,7 +1495,7 @@ dependencies = [ "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "platforms 3.1.2", + "platforms 3.2.0", "rustc_version", "subtle", "zeroize", @@ -1506,20 +1503,20 @@ dependencies = [ [[package]] name = "curve25519-dalek-derive" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] name = "cxx" -version = "1.0.109" +version = "1.0.110" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c390c123d671cc547244943ecad81bdaab756c6ea332d9ca9c1f48d952a24895" +checksum = "7129e341034ecb940c9072817cd9007974ea696844fc4dd582dc1653a7fbe2e8" dependencies = [ "cc", "cxxbridge-flags", @@ -1529,9 +1526,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.109" +version = "1.0.110" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00d3d3ac9ffb900304edf51ca719187c779f4001bb544f26c4511d621de905cf" +checksum = "a2a24f3f5f8eed71936f21e570436f024f5c2e25628f7496aa7ccd03b90109d5" dependencies = [ "cc", "codespan-reporting", @@ -1539,24 +1536,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] name = "cxxbridge-flags" -version = "1.0.109" +version = "1.0.110" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94415827ecfea0f0c74c8cad7d1a86ddb3f05354d6a6ddeda0adee5e875d2939" +checksum = "06fdd177fc61050d63f67f5bd6351fac6ab5526694ea8e359cd9cd3b75857f44" [[package]] name = "cxxbridge-macro" -version = "1.0.109" +version = "1.0.110" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33dbbe9f5621c9247f97ec14213b04f350bff4b6cebefe834c60055db266ecf" +checksum = "587663dd5fb3d10932c8aecfe7c844db1bcf0aee93eeab08fac13dc1212c2e7f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -1835,7 +1832,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -1885,9 +1882,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.14" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd" +checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" [[package]] name = "ecdsa" @@ -2012,7 +2009,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d97ca172ae9dc9f9b779a6e3a65d308f2af74e5b8c921299075bdb4a0370e914" dependencies = [ "base16ct 0.2.0", - "crypto-bigint 0.5.3", + "crypto-bigint 0.5.4", "digest 0.10.7", "ff 0.13.0", "generic-array 0.14.7", @@ -2053,9 +2050,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" dependencies = [ "humantime", "is-terminal", @@ -2078,9 +2075,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +checksum = "7c18ee0ed65a5f1f81cac6b1d213b69c35fa47d4252ad41f1486dbd8226fe36e" dependencies = [ "libc", "windows-sys 0.48.0", @@ -2449,9 +2446,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" +checksum = "f69037fe1b785e84986b4f2cbcf647381876a00671d25ceef715d7812dd7e1dd" [[package]] name = "file-per-thread-logger" @@ -2829,7 +2826,7 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -2841,7 +2838,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -2851,7 +2848,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -2899,9 +2896,12 @@ dependencies = [ [[package]] name = "fs-err" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" +checksum = "fb5fd9bcbe8b1087cbd395b51498c01bc997cef73e778a80b77a811af5e2d29f" +dependencies = [ + "autocfg", +] [[package]] name = "fs2" @@ -2919,7 +2919,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eeb4ed9e12f43b7fa0baae3f9cdda28352770132ef2e09a23760c29cae8bd47" dependencies = [ - "rustix 0.38.19", + "rustix 0.38.21", "windows-sys 0.48.0", ] @@ -2931,9 +2931,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" dependencies = [ "futures-channel", "futures-core", @@ -2946,9 +2946,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", "futures-sink", @@ -2956,15 +2956,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" dependencies = [ "futures-core", "futures-task", @@ -2985,9 +2985,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" [[package]] name = "futures-lite" @@ -3006,13 +3006,13 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -3028,15 +3028,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-timer" @@ -3046,9 +3046,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-channel", "futures-core", @@ -3114,9 +3114,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "libc", @@ -3173,7 +3173,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" dependencies = [ "aho-corasick", - "bstr 1.7.0", + "bstr 1.8.0", "fnv", "log", "regex", @@ -3222,9 +3222,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "4.4.0" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c39b3bc2a8f715298032cf5087e58573809374b08160aa7d750582bdb82d2683" +checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" dependencies = [ "log", "pest", @@ -3261,7 +3261,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.6", + "ahash 0.7.7", ] [[package]] @@ -3270,16 +3270,16 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.6", ] [[package]] name = "hashbrown" -version = "0.14.1" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.6", "allocator-api2", ] @@ -3289,7 +3289,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.1", + "hashbrown 0.14.2", ] [[package]] @@ -3405,9 +3405,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "f95b9abcae896730d42b78e09c155ed4ddf82c07b4de772c64aee5b2d8b7c150" dependencies = [ "bytes", "fnv", @@ -3466,7 +3466,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite 0.2.13", - "socket2 0.4.9", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -3631,12 +3631,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.1", + "hashbrown 0.14.2", ] [[package]] @@ -3708,7 +3708,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.4", + "socket2 0.5.5", "widestring", "windows-sys 0.48.0", "winreg", @@ -3716,9 +3716,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" @@ -3727,7 +3727,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi 0.3.3", - "rustix 0.38.19", + "rustix 0.38.21", "windows-sys 0.48.0", ] @@ -3755,20 +3755,11 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" -[[package]] -name = "jobserver" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" -dependencies = [ - "libc", -] - [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" dependencies = [ "wasm-bindgen", ] @@ -3963,9 +3954,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libloading" @@ -3992,7 +3983,7 @@ dependencies = [ "bytes", "futures", "futures-timer", - "getrandom 0.2.10", + "getrandom 0.2.11", "instant", "libp2p-allow-block-list", "libp2p-connection-limits", @@ -4166,7 +4157,7 @@ dependencies = [ "log", "rand 0.8.5", "smallvec", - "socket2 0.4.9", + "socket2 0.4.10", "tokio", "trust-dns-proto", "void", @@ -4308,7 +4299,7 @@ dependencies = [ "libc", "libp2p-core", "log", - "socket2 0.4.9", + "socket2 0.4.10", "tokio", ] @@ -4408,6 +4399,17 @@ dependencies = [ "yamux", ] +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.4.1", + "libc", + "redox_syscall 0.4.1", +] + [[package]] name = "librocksdb-sys" version = "0.11.0+8.1.1" @@ -4540,9 +4542,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" [[package]] name = "lock_api" @@ -4684,7 +4686,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.38.19", + "rustix 0.38.21", ] [[package]] @@ -4773,9 +4775,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", @@ -5197,7 +5199,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -5259,9 +5261,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.57" +version = "0.10.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" +checksum = "7a257ad03cd8fb16ad4172fedf8094451e1af1c4b70097636ef2eac9a5f0cc33" dependencies = [ "bitflags 2.4.1", "cfg-if", @@ -5280,7 +5282,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -5291,9 +5293,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.93" +version = "0.9.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" +checksum = "40a4130519a360279579c2053038317e40eff64d13fd3f004f9e1b72b8a6aaf9" dependencies = [ "cc", "libc", @@ -6181,9 +6183,9 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c022f1e7b65d6a24c0dbbd5fb344c66881bc01f3e5ae74a1c8100f2f985d98a4" +checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" dependencies = [ "memchr", "thiserror", @@ -6192,9 +6194,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35513f630d46400a977c4cb58f78e1bfbe01434316e60c37d27b9ad6139c66d8" +checksum = "81d78524685f5ef2a3b3bd1cafbc9fcabb036253d9b1463e726a91cd16e2dfc2" dependencies = [ "pest", "pest_generator", @@ -6202,22 +6204,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc9fc1b9e7057baba189b5c626e2d6f40681ae5b6eb064dc7c7834101ec8123a" +checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] name = "pest_meta" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df74e9e7ec4053ceb980e7c0c8bd3594e977fde1af91daba9c928e8e8c6708d" +checksum = "7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6" dependencies = [ "once_cell", "pest", @@ -6231,7 +6233,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.0.2", + "indexmap 2.1.0", ] [[package]] @@ -6251,7 +6253,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -6306,9 +6308,9 @@ checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" [[package]] name = "platforms" -version = "3.1.2" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" +checksum = "14e6ab3f592e6fb464fc9712d8d6e6912de6473954635fd76a589d832cffcbb0" [[package]] name = "polling" @@ -6328,13 +6330,13 @@ dependencies = [ [[package]] name = "poly1305" -version = "0.7.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" dependencies = [ "cpufeatures", "opaque-debug 0.3.0", - "universal-hash 0.4.1", + "universal-hash 0.5.1", ] [[package]] @@ -6648,7 +6650,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -6707,7 +6709,7 @@ checksum = "0e99670bafb56b9a106419397343bdbc8b8742c3cc449fec6345f86173f47cd4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -6753,7 +6755,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -6950,7 +6952,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.11", ] [[package]] @@ -7051,12 +7053,12 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ - "getrandom 0.2.10", - "redox_syscall 0.2.16", + "getrandom 0.2.11", + "libredox", "thiserror", ] @@ -7077,7 +7079,7 @@ checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -7142,7 +7144,7 @@ version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ - "base64 0.21.4", + "base64 0.21.5", "bytes", "encoding_rs", "futures-core", @@ -7222,12 +7224,12 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.4" +version = "0.17.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fce3045ffa7c981a6ee93f640b538952e155f1ae3a1a02b84547fc7a56b7059a" +checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" dependencies = [ "cc", - "getrandom 0.2.10", + "getrandom 0.2.11", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -7277,13 +7279,13 @@ dependencies = [ [[package]] name = "rpassword" -version = "7.2.0" +version = "7.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6678cf63ab3491898c0d021b493c94c9b221d91295294a2a5746eacbe5928322" +checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f" dependencies = [ "libc", "rtoolbox", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -7314,12 +7316,12 @@ dependencies = [ [[package]] name = "rtoolbox" -version = "0.0.1" +version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034e22c514f5c0cb8a10ff341b9b048b5ceb21591f31c8f44c43b960f9b3524a" +checksum = "c247d24e63230cdb56463ae328478bd5eac8b8faa8c69461a77e8e323afac90e" dependencies = [ "libc", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -7403,9 +7405,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.16" +version = "0.36.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6da3636faa25820d8648e0e31c5d519bbb01f72fdf57131f0f5f7da5fed36eab" +checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" dependencies = [ "bitflags 1.3.2", "errno", @@ -7417,9 +7419,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.25" +version = "0.37.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4eb579851244c2c03e7c24f501c3432bed80b8f720af1d6e5b0e0f01555a035" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" dependencies = [ "bitflags 1.3.2", "errno", @@ -7431,14 +7433,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.19" +version = "0.38.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed" +checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" dependencies = [ "bitflags 2.4.1", "errno", "libc", - "linux-raw-sys 0.4.10", + "linux-raw-sys 0.4.11", "windows-sys 0.48.0", ] @@ -7463,7 +7465,7 @@ checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" dependencies = [ "log", "ring 0.16.20", - "sct 0.7.0", + "sct 0.7.1", "webpki 0.22.4", ] @@ -7481,11 +7483,11 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.4", + "base64 0.21.5", ] [[package]] @@ -7582,7 +7584,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -7786,7 +7788,7 @@ name = "sc-consensus-grandpa" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.6", "array-bytes 4.2.0", "async-trait", "dyn-clone", @@ -7923,7 +7925,7 @@ dependencies = [ "libc", "log", "once_cell", - "rustix 0.36.16", + "rustix 0.36.17", "sc-allocator", "sc-executor-common", "sp-runtime-interface", @@ -8060,7 +8062,7 @@ name = "sc-network-gossip" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.6", "futures", "futures-timer", "libp2p", @@ -8469,7 +8471,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -8530,9 +8532,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0a159d0c45c12b20c5a844feb1fe4bea86e28f17b92a5f0c42193634d3782" +checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" dependencies = [ "bitvec", "cfg-if", @@ -8544,9 +8546,9 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "912e55f6d20e0e80d63733872b40e1227c0bce1e1ab81ba67d696339bfd7fd29" +checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8569,7 +8571,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.6", "cfg-if", "hashbrown 0.13.2", ] @@ -8616,12 +8618,12 @@ dependencies = [ [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring 0.17.5", + "untrusted 0.9.0", ] [[package]] @@ -8740,29 +8742,29 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.189" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.189" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -8984,9 +8986,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "snap" @@ -8996,16 +8998,16 @@ checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" [[package]] name = "snow" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155" +checksum = "58021967fd0a5eeeb23b08df6cc244a4d4a5b4aec1d27c9e02fad1a58b4cd74e" dependencies = [ - "aes-gcm 0.9.4", + "aes-gcm 0.10.3", "blake2", "chacha20poly1305", "curve25519-dalek 4.1.1", "rand_core 0.6.4", - "ring 0.16.20", + "ring 0.17.5", "rustc_version", "sha2 0.10.8", "subtle", @@ -9013,9 +9015,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -9023,9 +9025,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", "windows-sys 0.48.0", @@ -9079,7 +9081,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -9308,7 +9310,7 @@ dependencies = [ "proc-macro2", "quote", "sp-core-hashing", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -9327,7 +9329,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -9524,7 +9526,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -9667,7 +9669,7 @@ name = "sp-trie" version = "7.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.6", "hash-db 0.16.0", "hashbrown 0.13.2", "lazy_static", @@ -9710,7 +9712,7 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -9805,7 +9807,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d6753e460c998bbd4cd8c6f0ed9a64346fcca0723d6e75e52fdc351c5d2169d" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.6", "atoi", "byteorder", "bytes", @@ -9821,7 +9823,7 @@ dependencies = [ "futures-util", "hashlink", "hex", - "indexmap 2.0.2", + "indexmap 2.1.0", "log", "memchr", "native-tls", @@ -9900,9 +9902,9 @@ dependencies = [ [[package]] name = "ss58-registry" -version = "1.43.0" +version = "1.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6915280e2d0db8911e5032a5c275571af6bdded2916abd691a659be25d3439" +checksum = "35935738370302d5e33963665b77541e4b990a3e919ec904c837a56cfc891de1" dependencies = [ "Inflector", "num-format", @@ -10152,7 +10154,7 @@ dependencies = [ name = "stability-test-client" version = "2.0.1" dependencies = [ - "array-bytes 6.1.0", + "array-bytes 6.2.0", "async-trait", "futures", "parity-scale-codec", @@ -10177,7 +10179,7 @@ dependencies = [ name = "stability-test-runtime" version = "1.0.0" dependencies = [ - "array-bytes 6.1.0", + "array-bytes 6.2.0", "frame-executive", "frame-support", "frame-system", @@ -10456,9 +10458,9 @@ dependencies = [ [[package]] name = "substrate-bip39" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49eee6965196b32f882dd2ee85a92b1dbead41b04e53907f269de3b0dc04733c" +checksum = "e620c7098893ba667438b47169c00aacdd9e7c10e042250ce2b60b087ec97328" dependencies = [ "hmac 0.11.0", "pbkdf2 0.8.0", @@ -10564,9 +10566,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -10614,20 +10616,20 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.11" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" +checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" [[package]] name = "tempfile" -version = "3.8.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if", "fastrand 2.0.1", - "redox_syscall 0.3.5", - "rustix 0.38.19", + "redox_syscall 0.4.1", + "rustix 0.38.21", "windows-sys 0.48.0", ] @@ -10648,22 +10650,22 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.49" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.49" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -10785,9 +10787,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.33.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ "backtrace", "bytes", @@ -10797,20 +10799,20 @@ dependencies = [ "parking_lot 0.12.1", "pin-project-lite 0.2.13", "signal-hook-registry", - "socket2 0.5.4", + "socket2 0.5.5", "tokio-macros", "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -10848,9 +10850,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -10897,7 +10899,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", @@ -10947,9 +10949,9 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.39" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2ef2af84856a50c1d430afce2fdded0a4ec7eda868db86409b4543df0797f9" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "log", "pin-project-lite 0.2.13", @@ -10965,7 +10967,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -10990,12 +10992,12 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] @@ -11082,7 +11084,7 @@ dependencies = [ "lazy_static", "rand 0.8.5", "smallvec", - "socket2 0.4.9", + "socket2 0.4.10", "thiserror", "tinyvec", "tokio", @@ -11304,7 +11306,7 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.11", ] [[package]] @@ -11379,9 +11381,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -11389,24 +11391,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" dependencies = [ "cfg-if", "js-sys", @@ -11416,9 +11418,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -11426,22 +11428,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "wasm-instrument" @@ -11594,12 +11596,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" dependencies = [ "anyhow", - "base64 0.21.4", + "base64 0.21.5", "bincode", "directories-next", "file-per-thread-logger", "log", - "rustix 0.36.16", + "rustix 0.36.17", "serde", "sha2 0.10.8", "toml 0.5.11", @@ -11695,7 +11697,7 @@ checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" dependencies = [ "object 0.30.4", "once_cell", - "rustix 0.36.16", + "rustix 0.36.17", ] [[package]] @@ -11726,7 +11728,7 @@ dependencies = [ "memoffset 0.8.0", "paste", "rand 0.8.5", - "rustix 0.36.16", + "rustix 0.36.17", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", @@ -11747,9 +11749,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" dependencies = [ "js-sys", "wasm-bindgen", @@ -11771,7 +11773,7 @@ version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.17.4", + "ring 0.17.5", "untrusted 0.9.0", ] @@ -11911,7 +11913,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f08dfd7a6e3987e255c4dbe710dde5d94d0f0574f8a21afa95d171376c143106" dependencies = [ "log", - "socket2 0.4.9", + "socket2 0.4.10", "thiserror", "tokio", "webrtc-util", @@ -12001,7 +12003,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.19", + "rustix 0.38.21", ] [[package]] @@ -12204,9 +12206,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.17" +version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c" +checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" dependencies = [ "memchr", ] @@ -12313,7 +12315,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -12339,6 +12341,26 @@ dependencies = [ "time", ] +[[package]] +name = "zerocopy" +version = "0.7.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cd369a67c0edfef15010f980c3cbe45d7f651deac2cd67ce097cd801de16557" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2f140bda219a26ccc0cdb03dba58af72590c53b22642577d88a927bc5c87d6b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "zeroize" version = "1.6.0" @@ -12356,7 +12378,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index e8135ec5..c6b1ef6d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -76,8 +76,8 @@ libsecp256k1 = { version = "0.7.1", default-features = false } hex = { version = "0.4.3", default-features = false, features = ["alloc"] } parity-db = "0.4.8" rlp = { version = "0.5", default-features = false } -scale-codec = { package = "parity-scale-codec", version = "3.2.1", default-features = false, features = ["derive"] } -codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } +scale-codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", workspace = true, default-features = false, features = ["derive"] } scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } serde = { version = "1.0", default-features = false, features = ["derive", "alloc"] } serde_json = "1.0" @@ -246,7 +246,7 @@ stbl-core-primitives = { path = "primitives/core", default-features = false } account = { path = "primitives/account", default-features = false } blake2-rfc = { version = "0.2.18", default-features = false } impl-serde = { version = "0.4.0", default-features = false } -parity-scale-codec = { version = "3.0.0", default-features = false, features = [ "derive" ] } +parity-scale-codec = { version = "3.2.2", default-features = false, features = [ "derive" ] } sha3 = { version = "0.9", default-features = false } stability-rpc = { path = "./stability-rpc", default-features = false } stability-rpc-api = { path = "./primitives/stability-rpc-api", default-features = false } diff --git a/client/authorship/Cargo.toml b/client/authorship/Cargo.toml index b39c3bbe..90d760fe 100644 --- a/client/authorship/Cargo.toml +++ b/client/authorship/Cargo.toml @@ -12,7 +12,7 @@ repository = "https://github.com/stabilityprotocol/stability/" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } futures = { workspace = true } futures-timer = { workspace = true } log = { workspace = true } diff --git a/client/authorship/src/authorship.rs b/client/authorship/src/authorship.rs index 2c3c1f01..f11685f8 100644 --- a/client/authorship/src/authorship.rs +++ b/client/authorship/src/authorship.rs @@ -37,7 +37,6 @@ use sp_consensus::{DisableProofRecording, EnableProofRecording, ProofRecording, use sp_core::traits::SpawnNamed; use sp_inherents::InherentData; use sp_runtime::{ - generic::BlockId, traits::{BlakeTwo256, Block as BlockT, Hash as HashT, Header as HeaderT, IdentifyAccount}, Digest, Percent, SaturatedConversion, }; diff --git a/node/Cargo.toml b/node/Cargo.toml index 426fffcc..9f6f3f9d 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -19,7 +19,7 @@ futures = { workspace = true } hex-literal = { workspace = true } jsonrpsee = { workspace = true, features = ["server", "macros"] } log = { workspace = true } -scale-codec = { package = "parity-scale-codec", workspace = true } +scale-codec = { workspace = true, package = "parity-scale-codec" } serde = { workspace = true } # Substrate diff --git a/node/src/rpc/eth.rs b/node/src/rpc/eth.rs index 5264cc62..2117cc6b 100644 --- a/node/src/rpc/eth.rs +++ b/node/src/rpc/eth.rs @@ -17,7 +17,6 @@ use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; use sp_core::H256; use sp_runtime::traits::Block as BlockT; // Frontier -use fc_db::Backend as FrontierBackend; pub use fc_rpc::{EthBlockDataCacheTask, EthConfig, OverrideHandle, StorageOverride, TxPool}; pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool}; pub use fc_storage::overrides_handle; diff --git a/pallets/custom-balances/Cargo.toml b/pallets/custom-balances/Cargo.toml index 0141dfab..5c7c41ad 100644 --- a/pallets/custom-balances/Cargo.toml +++ b/pallets/custom-balances/Cargo.toml @@ -9,7 +9,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } diff --git a/pallets/custom-balances/src/lib.rs b/pallets/custom-balances/src/lib.rs index ed240283..72191036 100644 --- a/pallets/custom-balances/src/lib.rs +++ b/pallets/custom-balances/src/lib.rs @@ -276,7 +276,7 @@ pub mod pallet { } /// Get the maximum amount that `who` can withdraw/transfer successfully. - fn reducible_balance(who: &T::AccountId, preservation: Preservation, force: Fortitude) -> Self::Balance { + fn reducible_balance(who: &T::AccountId, _preservation: Preservation, _force: Fortitude) -> Self::Balance { >::total_balance(who) } @@ -288,7 +288,7 @@ pub mod pallet { fn can_deposit( _who: &T::AccountId, _amount: Self::Balance, - provenance: Provenance, + _provenance: Provenance, ) -> DepositConsequence { DepositConsequence::UnknownAsset } diff --git a/pallets/custom-balances/src/mock.rs b/pallets/custom-balances/src/mock.rs index d47f3cd3..c75209eb 100644 --- a/pallets/custom-balances/src/mock.rs +++ b/pallets/custom-balances/src/mock.rs @@ -69,7 +69,7 @@ parameter_types! { parameter_types! { pub BlockGasLimit: U256 = U256::max_value(); - pub const WeightPerGas: Weight = Weight::from_ref_time(1); + pub const WeightPerGas: Weight = Weight::from_parts(1, 0); pub const GasLimitPovSizeRatio: u64 = 15; } diff --git a/pallets/dnt-fee-controller/Cargo.toml b/pallets/dnt-fee-controller/Cargo.toml index 0316d71f..26075440 100644 --- a/pallets/dnt-fee-controller/Cargo.toml +++ b/pallets/dnt-fee-controller/Cargo.toml @@ -8,7 +8,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } diff --git a/pallets/erc20-manager/Cargo.toml b/pallets/erc20-manager/Cargo.toml index d4c05126..19db9799 100644 --- a/pallets/erc20-manager/Cargo.toml +++ b/pallets/erc20-manager/Cargo.toml @@ -9,7 +9,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } diff --git a/pallets/fee-rewards-vault/Cargo.toml b/pallets/fee-rewards-vault/Cargo.toml index e9720c1e..f29e4eb8 100644 --- a/pallets/fee-rewards-vault/Cargo.toml +++ b/pallets/fee-rewards-vault/Cargo.toml @@ -9,7 +9,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } diff --git a/pallets/root-controller/Cargo.toml b/pallets/root-controller/Cargo.toml index 303cb384..c4816174 100644 --- a/pallets/root-controller/Cargo.toml +++ b/pallets/root-controller/Cargo.toml @@ -8,7 +8,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } diff --git a/pallets/root-controller/src/lib.rs b/pallets/root-controller/src/lib.rs index f213d4b0..c40455be 100644 --- a/pallets/root-controller/src/lib.rs +++ b/pallets/root-controller/src/lib.rs @@ -44,7 +44,7 @@ pub mod pallet { #[pallet::call] impl Pallet { #[pallet::call_index(0)] - #[pallet::weight(0)] + #[pallet::weight({0})] pub fn dispatch_as_root( origin: OriginFor, call: Box<::RuntimeCall>, diff --git a/pallets/root-controller/src/mock.rs b/pallets/root-controller/src/mock.rs index 83540505..0ce3c62a 100644 --- a/pallets/root-controller/src/mock.rs +++ b/pallets/root-controller/src/mock.rs @@ -71,13 +71,12 @@ pub mod logger { pub trait Config: frame_system::Config {} #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(PhantomData); #[pallet::call] impl Pallet { #[pallet::call_index(0)] - #[pallet::weight(0)] + #[pallet::weight({0})] pub fn privileged_i32_log(origin: OriginFor, i: i32) -> DispatchResultWithPostInfo { // Ensure that the `origin` is `Root`. ensure_root(origin)?; @@ -86,7 +85,7 @@ pub mod logger { } #[pallet::call_index(1)] - #[pallet::weight(0)] + #[pallet::weight({0})] pub fn force_fail_log(_: OriginFor) -> DispatchResultWithPostInfo { Err(DispatchError::BadOrigin.into()) } diff --git a/pallets/sponsored-transactions/Cargo.toml b/pallets/sponsored-transactions/Cargo.toml index 42ccafa1..e138d198 100644 --- a/pallets/sponsored-transactions/Cargo.toml +++ b/pallets/sponsored-transactions/Cargo.toml @@ -8,7 +8,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } hex = { workspace = true, default-features = false } scale-info = { workspace = true } sp-core = { workspace = true } diff --git a/pallets/token-fee-controller/supported-tokens-manager/Cargo.toml b/pallets/token-fee-controller/supported-tokens-manager/Cargo.toml index 4f0ed762..55693d85 100644 --- a/pallets/token-fee-controller/supported-tokens-manager/Cargo.toml +++ b/pallets/token-fee-controller/supported-tokens-manager/Cargo.toml @@ -10,7 +10,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } diff --git a/pallets/token-fee-controller/user-fee-selector/Cargo.toml b/pallets/token-fee-controller/user-fee-selector/Cargo.toml index d3e75771..bbe7d846 100644 --- a/pallets/token-fee-controller/user-fee-selector/Cargo.toml +++ b/pallets/token-fee-controller/user-fee-selector/Cargo.toml @@ -10,7 +10,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } diff --git a/pallets/token-fee-controller/validator-fee-selector/Cargo.toml b/pallets/token-fee-controller/validator-fee-selector/Cargo.toml index 77f8605a..643e9564 100644 --- a/pallets/token-fee-controller/validator-fee-selector/Cargo.toml +++ b/pallets/token-fee-controller/validator-fee-selector/Cargo.toml @@ -10,7 +10,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } scale-info = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } diff --git a/pallets/upgrade-runtime-proposal/Cargo.toml b/pallets/upgrade-runtime-proposal/Cargo.toml index 878a82b8..9504fe06 100644 --- a/pallets/upgrade-runtime-proposal/Cargo.toml +++ b/pallets/upgrade-runtime-proposal/Cargo.toml @@ -14,7 +14,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } scale-info = { workspace = true } syn = { workspace = true } -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } stbl-tools = { workspace = true } log = { workspace = true } diff --git a/pallets/upgrade-runtime-proposal/src/lib.rs b/pallets/upgrade-runtime-proposal/src/lib.rs index a0a614a0..8601fd7e 100644 --- a/pallets/upgrade-runtime-proposal/src/lib.rs +++ b/pallets/upgrade-runtime-proposal/src/lib.rs @@ -59,7 +59,7 @@ pub mod pallet { #[pallet::call] impl Pallet { #[pallet::call_index(0)] - #[pallet::weight(0)] + #[pallet::weight({0})] pub fn propose_code(origin: OriginFor, code: Vec) -> DispatchResultWithPostInfo { T::ControlOrigin::ensure_origin(origin)?; @@ -81,7 +81,7 @@ pub mod pallet { } #[pallet::call_index(1)] - #[pallet::weight(0)] + #[pallet::weight({0})] pub fn set_block_application( origin: OriginFor, block_number: T::BlockNumber, @@ -104,7 +104,7 @@ pub mod pallet { } #[pallet::call_index(2)] - #[pallet::weight(0)] + #[pallet::weight({0})] pub fn reject_proposed_code(origin: OriginFor) -> DispatchResultWithPostInfo { ensure_root(origin)?; diff --git a/pallets/validator-keys-controller/Cargo.toml b/pallets/validator-keys-controller/Cargo.toml index 005fc6a3..d37a7bd9 100644 --- a/pallets/validator-keys-controller/Cargo.toml +++ b/pallets/validator-keys-controller/Cargo.toml @@ -11,7 +11,7 @@ sp-runtime = { workspace = true } sp-std = { workspace = true } sp-staking = { workspace = true } log = { workspace = true } -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } diff --git a/pallets/validator-keys-controller/src/lib.rs b/pallets/validator-keys-controller/src/lib.rs index cbe11d6c..5d042eaf 100644 --- a/pallets/validator-keys-controller/src/lib.rs +++ b/pallets/validator-keys-controller/src/lib.rs @@ -62,7 +62,6 @@ pub mod pallet { } #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] #[pallet::without_storage_info] pub struct Pallet(_); @@ -217,7 +216,7 @@ pub mod pallet { #[pallet::call] impl Pallet { #[pallet::call_index(0)] - #[pallet::weight(0)] + #[pallet::weight({0})] pub fn publish_keys( origin: OriginFor, keys: PublishingKeys, diff --git a/pallets/validator-set/Cargo.toml b/pallets/validator-set/Cargo.toml index bba54a90..1e2a9f27 100644 --- a/pallets/validator-set/Cargo.toml +++ b/pallets/validator-set/Cargo.toml @@ -11,7 +11,7 @@ sp-runtime = { workspace = true } sp-std = { workspace = true } sp-staking = { workspace = true } log = { workspace = true } -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } diff --git a/pallets/validator-set/src/lib.rs b/pallets/validator-set/src/lib.rs index 9b8d2023..51a14b7b 100644 --- a/pallets/validator-set/src/lib.rs +++ b/pallets/validator-set/src/lib.rs @@ -75,7 +75,6 @@ pub mod pallet { } #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] #[pallet::without_storage_info] pub struct Pallet(_); @@ -375,7 +374,7 @@ pub mod pallet { /// The origin can be configured using the `AddRemoveOrigin` type in the /// host runtime. Can also be set to sudo/root. #[pallet::call_index(0)] - #[pallet::weight(0)] + #[pallet::weight({0})] pub fn add_validator(origin: OriginFor, validator_id: T::AccountId) -> DispatchResult { T::AddRemoveOrigin::ensure_origin(origin)?; @@ -389,7 +388,7 @@ pub mod pallet { /// The origin can be configured using the `AddRemoveOrigin` type in the /// host runtime. Can also be set to sudo/root. #[pallet::call_index(1)] - #[pallet::weight(0)] + #[pallet::weight({0})] pub fn remove_validator( origin: OriginFor, validator_id: T::AccountId, @@ -407,7 +406,7 @@ pub mod pallet { /// The origin can be configured using the `AddRemoveOrigin` type in the /// host runtime. Can also be set to sudo/root. #[pallet::call_index(2)] - #[pallet::weight(0)] + #[pallet::weight({0})] pub fn update_max_missed_epochs( origin: OriginFor, max_missed_epochs: U256, @@ -423,7 +422,7 @@ pub mod pallet { /// /// For this call, the dispatch origin must be the validator itself. #[pallet::call_index(3)] - #[pallet::weight(0)] + #[pallet::weight({0})] pub fn add_validator_again( origin: OriginFor, heartbeat: Heartbeat, diff --git a/pallets/zero-gas-transactions/Cargo.toml b/pallets/zero-gas-transactions/Cargo.toml index 495bb72d..8f46bfa3 100644 --- a/pallets/zero-gas-transactions/Cargo.toml +++ b/pallets/zero-gas-transactions/Cargo.toml @@ -8,7 +8,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } hex = { workspace = true, default-features = false } scale-info = { workspace = true } sp-core = { workspace = true } diff --git a/precompiles/fee-rewards-vault-controller/Cargo.toml b/precompiles/fee-rewards-vault-controller/Cargo.toml index 5b82174d..8df44a48 100644 --- a/precompiles/fee-rewards-vault-controller/Cargo.toml +++ b/precompiles/fee-rewards-vault-controller/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] # Substrate sp-core = { workspace = true } -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } frame-system = { workspace = true } frame-support = { workspace = true } sp-std = { workspace = true } diff --git a/precompiles/upgrade-runtime-controller/Cargo.toml b/precompiles/upgrade-runtime-controller/Cargo.toml index 294b8d5f..ca73be77 100644 --- a/precompiles/upgrade-runtime-controller/Cargo.toml +++ b/precompiles/upgrade-runtime-controller/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] # Substrate sp-core = { workspace = true } -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } frame-system = { workspace = true } frame-support = { workspace = true } sp-std = { workspace = true } diff --git a/precompiles/utils/Cargo.toml b/precompiles/utils/Cargo.toml index 2b9e0e2a..bbb0469e 100644 --- a/precompiles/utils/Cargo.toml +++ b/precompiles/utils/Cargo.toml @@ -26,7 +26,7 @@ precompile-utils-macro = { path = "macro" } # Substrate frame-support = { workspace = true } frame-system = { workspace = true } -parity-scale-codec = { workspace = true } +parity-scale-codec = { workspace = true, package = "parity-scale-codec" } sp-core = { workspace = true } sp-io = { workspace = true } sp-std = { workspace = true } diff --git a/precompiles/utils/src/precompile_set.rs b/precompiles/utils/src/precompile_set.rs index 10be190c..7834db2b 100644 --- a/precompiles/utils/src/precompile_set.rs +++ b/precompiles/utils/src/precompile_set.rs @@ -29,7 +29,6 @@ use fp_evm::{ }; use frame_support::pallet_prelude::Get; use impl_trait_for_tuples::impl_for_tuples; -use pallet_evm::AddressMapping; use sp_core::{H160, H256}; use sp_std::{ cell::RefCell, collections::btree_map::BTreeMap, marker::PhantomData, ops::RangeInclusive, vec, @@ -342,15 +341,6 @@ pub fn get_address_type( Ok(AddressType::Unknown) } -fn is_address_eoa_or_precompile( - handle: &mut impl PrecompileHandle, - address: H160, -) -> Result { - match get_address_type::(handle, address)? { - AddressType::EOA | AddressType::Precompile => Ok(true), - _ => Ok(false), - } -} pub fn is_precompile_or_fail(address: H160, gas: u64) -> EvmResult { diff --git a/precompiles/utils/src/testing/execution.rs b/precompiles/utils/src/testing/execution.rs index e7f87a8f..23fe56be 100644 --- a/precompiles/utils/src/testing/execution.rs +++ b/precompiles/utils/src/testing/execution.rs @@ -157,8 +157,7 @@ impl<'p, P: PrecompileSet> PrecompilesTester<'p, P> { let res = self.execute(); match res { - Some(Err(PrecompileFailure::Revert { output, .. })) => { - let decoded = decode_revert_message(&output); + Some(Err(PrecompileFailure::Revert { .. })) => { panic!("Shouldn't have reverted"); } Some(Ok(PrecompileOutput { diff --git a/precompiles/validator-controller/Cargo.toml b/precompiles/validator-controller/Cargo.toml index a1e0c5a9..02ff3c11 100644 --- a/precompiles/validator-controller/Cargo.toml +++ b/precompiles/validator-controller/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] # Substrate sp-core = { workspace = true } -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } frame-system = { workspace = true } frame-support = { workspace = true } sp-std = { workspace = true } diff --git a/primitives/fee-compatible-api/Cargo.toml b/primitives/fee-compatible-api/Cargo.toml index 085d447b..a71050bb 100644 --- a/primitives/fee-compatible-api/Cargo.toml +++ b/primitives/fee-compatible-api/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] sp-runtime = { workspace = true} sp-api = { workspace = true} -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } [features] default = ['std'] diff --git a/primitives/runner/Cargo.toml b/primitives/runner/Cargo.toml index 79b52219..4ed75330 100644 --- a/primitives/runner/Cargo.toml +++ b/primitives/runner/Cargo.toml @@ -11,7 +11,7 @@ sp-runtime = { workspace = true } sp-std = { workspace = true } evm = { workspace = true, features = ["with-codec"] } sp-core = { workspace = true, default-features = false } -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } scale-info = { workspace = true} frame-benchmarking = { workspace = true, optional = true } sp-io = { workspace = true } diff --git a/primitives/runner/src/lib.rs b/primitives/runner/src/lib.rs index 27fc8be3..c4279ce2 100644 --- a/primitives/runner/src/lib.rs +++ b/primitives/runner/src/lib.rs @@ -15,7 +15,6 @@ use fp_evm::{ }; use frame_support::{ traits::{ - tokens::{currency::Currency, ExistenceRequirement}, Get, Time, }, weights::Weight, @@ -263,7 +262,6 @@ where _ => used_gas.into(), }; let actual_fee = effective_gas.saturating_mul(total_fee_per_gas); - let actual_base_fee = effective_gas.saturating_mul(base_fee); log::debug!( target: "evm", diff --git a/primitives/stability-rpc-api/Cargo.toml b/primitives/stability-rpc-api/Cargo.toml index 48707f33..35ceeab5 100644 --- a/primitives/stability-rpc-api/Cargo.toml +++ b/primitives/stability-rpc-api/Cargo.toml @@ -9,7 +9,7 @@ sp-runtime = { workspace = true, default-features = false } sp-api = { workspace = true, default-features = false } sp-core = { workspace = true, default-features = false } sp-std = { workspace = true, default-features = false } -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } [features] default = ["std"] diff --git a/primitives/transaction-validator/Cargo.toml b/primitives/transaction-validator/Cargo.toml index 2df7f6f8..9b3756b1 100644 --- a/primitives/transaction-validator/Cargo.toml +++ b/primitives/transaction-validator/Cargo.toml @@ -22,7 +22,7 @@ stbl-tools = { workspace = true } environmental = { workspace = true, optional = true } frame-support = { workspace = true } evm = { workspace = true, features = ["with-codec"] } -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } scale-info = { workspace = true} frame-benchmarking = { workspace = true, optional = true } log = { workspace = true } diff --git a/primitives/zero-gas-transactions-api/Cargo.toml b/primitives/zero-gas-transactions-api/Cargo.toml index 601bdfa7..97b6787e 100644 --- a/primitives/zero-gas-transactions-api/Cargo.toml +++ b/primitives/zero-gas-transactions-api/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] sp-runtime = { workspace = true} sp-api = { workspace = true} -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } fp-ethereum = { workspace = true, default-features = false } sp-std = { workspace = true, default-features = false } diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 009f788c..df9d9145 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -61,11 +61,10 @@ use pallet_grandpa::{ fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList, }; // Frontier -use fp_evm::weight_per_gas; use fp_rpc::TransactionStatus; use pallet_ethereum::{Call::transact, PostLogContent, Transaction as EthereumTransaction}; use pallet_evm::{ - Account as EVMAccount, EnsureAccountId20, FeeCalculator, GasWeightMapping, Runner, + Account as EVMAccount, FeeCalculator, GasWeightMapping, Runner, }; use pallet_sponsored_transactions::Call::send_sponsored_transaction; use pallet_validator_set::SessionBlockManager; @@ -464,7 +463,7 @@ const WEIGHT_PER_GAS: u64 = 20_000; parameter_types! { pub PrecompilesValue: StabilityPrecompiles = StabilityPrecompiles::<_, StabilityFeeController>::new(); - pub WeightPerGas: Weight = Weight::from_ref_time(WEIGHT_PER_GAS); + pub WeightPerGas: Weight = Weight::from_parts(WEIGHT_PER_GAS, u64::MAX); pub const GasLimitPovSizeRatio: u64 = 15; } diff --git a/runtime/src/stability_config.rs b/runtime/src/stability_config.rs index bafbbedd..94aad2cc 100644 --- a/runtime/src/stability_config.rs +++ b/runtime/src/stability_config.rs @@ -12,12 +12,7 @@ const COMPUTATION_BLOCK_TIME_RATIO: (u64, u64) = (2, 3); // 2 third parts of the const COMPUTATION_POWER_MULTIPLIER: u64 = 6; // 6 times more computation power than normal // how much weight for normal extrinsics could be processed in a block -pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_ref_time(WEIGHT_REF_TIME_PER_MILLIS) - .mul(MILLISECS_PER_BLOCK) - .mul(COMPUTATION_POWER_MULTIPLIER) - .mul(COMPUTATION_BLOCK_TIME_RATIO.0) - .div(COMPUTATION_BLOCK_TIME_RATIO.1) // 8_000_000_000_000 - .set_proof_size(u64::MAX); +pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(WEIGHT_REF_TIME_PER_MILLIS * MILLISECS_PER_BLOCK * COMPUTATION_POWER_MULTIPLIER * COMPUTATION_BLOCK_TIME_RATIO.0 / COMPUTATION_BLOCK_TIME_RATIO.1, u64::MAX); // `.set_proof_size`, since migration to WeightV2, we have set the proof size weight for the maximum block. // https://github.com/paritytech/substrate/pull/12277 diff --git a/stability-rpc/Cargo.toml b/stability-rpc/Cargo.toml index f0ee8811..71b5fbe3 100644 --- a/stability-rpc/Cargo.toml +++ b/stability-rpc/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -codec = { package = "parity-scale-codec", workspace = true } +codec = { workspace = true, package = "parity-scale-codec" } scale-info = { workspace = true } jsonrpsee = { workspace = true, features = ["server", "macros"] } lazy_static = { version = "1.4.0", optional = true } diff --git a/test-utils/stability-client/Cargo.toml b/test-utils/stability-client/Cargo.toml index 0b06561d..d01de86c 100644 --- a/test-utils/stability-client/Cargo.toml +++ b/test-utils/stability-client/Cargo.toml @@ -13,7 +13,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] array-bytes = { workspace = true } async-trait = { workspace = true } -codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", default-features = false, features = ["derive"], workspace = true } futures = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } diff --git a/test-utils/stability-root-testing/Cargo.toml b/test-utils/stability-root-testing/Cargo.toml index 40562b82..59b6668d 100644 --- a/test-utils/stability-root-testing/Cargo.toml +++ b/test-utils/stability-root-testing/Cargo.toml @@ -10,7 +10,7 @@ publish = false targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } +codec = { default-features = false, features = ["derive"], workspace = true, package = "parity-scale-codec" } scale-info = { workspace = true } frame-support = { workspace = true } frame-system = { workspace = true } diff --git a/test-utils/stability-runtime-client/Cargo.toml b/test-utils/stability-runtime-client/Cargo.toml index fe31b0ad..6329548f 100644 --- a/test-utils/stability-runtime-client/Cargo.toml +++ b/test-utils/stability-runtime-client/Cargo.toml @@ -10,7 +10,7 @@ publish = false targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", default-features = false, features = ["derive"], workspace = true } futures = { workspace = true } sc-block-builder = { workspace = true } sc-chain-spec = { workspace = true } diff --git a/test-utils/stability-runtime/Cargo.toml b/test-utils/stability-runtime/Cargo.toml index 6511af24..ae20c1f7 100644 --- a/test-utils/stability-runtime/Cargo.toml +++ b/test-utils/stability-runtime/Cargo.toml @@ -17,7 +17,7 @@ sp-consensus-aura = { workspace = true } sp-consensus-babe = { workspace = true } sp-consensus-beefy = { workspace = true } sp-block-builder = { workspace = true } -codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", default-features = false, features = ["derive"], workspace = true } scale-info = { workspace = true } sp-inherents = { workspace = true } sp-keyring = { workspace = true, optional = true } diff --git a/test-utils/stability-runtime/src/lib.rs b/test-utils/stability-runtime/src/lib.rs index 93e76fed..dc8affe8 100644 --- a/test-utils/stability-runtime/src/lib.rs +++ b/test-utils/stability-runtime/src/lib.rs @@ -715,7 +715,7 @@ impl_runtime_apis! { } impl stbl_primitives_fee_compatible_api::CompatibleFeeApi for Runtime { - fn is_compatible_fee(tx: ::Extrinsic, _: RealAccountiD) -> bool { + fn is_compatible_fee(_tx: ::Extrinsic, _: RealAccountiD) -> bool { true } } diff --git a/test-utils/stability-tracing/Cargo.toml b/test-utils/stability-tracing/Cargo.toml index 30216e06..2d8f5a16 100644 --- a/test-utils/stability-tracing/Cargo.toml +++ b/test-utils/stability-tracing/Cargo.toml @@ -17,7 +17,7 @@ targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"] [dependencies] sp-std = { workspace = true } -codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } +codec = { default-features = false, features = ["derive"], workspace = true, package = "parity-scale-codec" } tracing = { workspace = true } tracing-core = { workspace = true } tracing-subscriber = { workspace = true, optional = true } From 15ce9ea4b0c890e53673dc14edf8cd46ccb81357 Mon Sep 17 00:00:00 2001 From: Daniel Blanco Parla Date: Mon, 13 Nov 2023 14:36:22 +0100 Subject: [PATCH 16/37] chore(Cargo): specify codec version --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c6b1ef6d..42f5a43f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -77,7 +77,7 @@ hex = { version = "0.4.3", default-features = false, features = ["alloc"] } parity-db = "0.4.8" rlp = { version = "0.5", default-features = false } scale-codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } -codec = { package = "parity-scale-codec", workspace = true, default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } serde = { version = "1.0", default-features = false, features = ["derive", "alloc"] } serde_json = "1.0" From cac1e48f67b7c0bfabfaf64f2d33548778507991 Mon Sep 17 00:00:00 2001 From: Daniel Blanco Parla Date: Mon, 13 Nov 2023 14:40:20 +0100 Subject: [PATCH 17/37] log(EVM Runner): validator + token --- primitives/runner/src/lib.rs | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/primitives/runner/src/lib.rs b/primitives/runner/src/lib.rs index c4279ce2..d025989a 100644 --- a/primitives/runner/src/lib.rs +++ b/primitives/runner/src/lib.rs @@ -6,24 +6,23 @@ use evm::{ backend::Backend as BackendT, executor::stack::{Accessed, StackExecutor, StackState as StackStateT, StackSubstateMetadata}, gasometer::{GasCost, StorageTarget}, - ExitError, ExitReason, Handler, Transfer, Opcode + ExitError, ExitReason, Handler, Opcode, Transfer, }; use fp_evm::{ AccessedStorage, CallInfo, CreateInfo, ExecutionInfoV2, IsPrecompileResult, Log, PrecompileSet, Vicinity, WeightInfo, ACCOUNT_BASIC_PROOF_SIZE, ACCOUNT_CODES_METADATA_PROOF_SIZE, ACCOUNT_STORAGE_PROOF_SIZE, IS_EMPTY_CHECK_PROOF_SIZE, WRITE_PROOF_SIZE, }; +use frame_support::sp_runtime::traits::UniqueSaturatedInto; use frame_support::{ - traits::{ - Get, Time, - }, + traits::{Get, Time}, weights::Weight, }; -use frame_support::sp_runtime::traits::UniqueSaturatedInto; use pallet_evm::Pallet; use pallet_evm::{ - AccountCodes, AccountStorages, AddressMapping, BalanceOf, BlockHashMapping, Config, Error, - Event, FeeCalculator, Runner as RunnerT, RunnerError, OnCreate, AccountCodesMetadata + AccountCodes, AccountCodesMetadata, AccountStorages, AddressMapping, BalanceOf, + BlockHashMapping, Config, Error, Event, FeeCalculator, OnCreate, Runner as RunnerT, + RunnerError, }; use pallet_user_fee_selector::UserFeeTokenController; use precompile_utils::prelude::keccak256; @@ -148,7 +147,6 @@ where ) -> (ExitReason, R), R: Default, { - // Used to record the external costs in the evm through the StackState implementation let maybe_weight_info = WeightInfo::new_from_weight_limit(weight_limit, proof_size_base_cost).map_err( @@ -157,7 +155,7 @@ where weight, }, )?; - + // The precompile check is only used for transactional invocations. However, here we always // execute the check, because the check has side effects. match precompiles.is_precompile(source, gas_limit) { @@ -178,15 +176,13 @@ where } }; - // Only check the restrictions of EIP-3607 if the source of the EVM operation is from an external transaction. // If the source of this EVM operation is from an internal call, like from `eth_call` or `eth_estimateGas` RPC, // we will skip the checks for the EIP-3607. // // EIP-3607: https://eips.ethereum.org/EIPS/eip-3607 // Do not allow transactions for which `tx.sender` has any code deployed. - if is_transactional && !>::get(source).is_empty() - { + if is_transactional && !>::get(source).is_empty() { return Err(RunnerError { error: Error::::TransactionMustComeFromEOA, weight, @@ -265,7 +261,7 @@ where log::debug!( target: "evm", - "Execution {:?} [source: {:?}, value: {}, gas_limit: {}, actual_fee: {}, used_gas: {}, effective_gas: {}, base_fee: {}, total_fee_per_gas: {}, is_transactional: {}]", + "Execution {:?} [source: {:?}, value: {}, gas_limit: {}, actual_fee: {}, used_gas: {}, effective_gas: {}, base_fee: {}, total_fee_per_gas: {}, is_transactional: {}, miner: {}, token_fee: {}]", reason, source, value, @@ -275,7 +271,9 @@ where effective_gas, base_fee, total_fee_per_gas, - is_transactional + is_transactional, + validator, + token ); if !is_zero_gas_transaction { @@ -1255,7 +1253,6 @@ where } } } - } pub trait OnChargeDecentralizedNativeTokenFee { From aea4d0500a08ae842de7e154ea638b8faf74eb2e Mon Sep 17 00:00:00 2001 From: Daniel Blanco Parla Date: Mon, 13 Nov 2023 16:36:27 +0100 Subject: [PATCH 18/37] hotfix(Runner): on native transfer unhandle proof_size and weight_limit --- primitives/runner/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/primitives/runner/src/lib.rs b/primitives/runner/src/lib.rs index d025989a..0828e23e 100644 --- a/primitives/runner/src/lib.rs +++ b/primitives/runner/src/lib.rs @@ -500,8 +500,8 @@ where access_list.clone(), is_transactional, validate, - weight_limit, - proof_size_base_cost, + None, + None, config, ) } From 9ce62b881653dabaedfc38da32f04a6d3d9a261c Mon Sep 17 00:00:00 2001 From: Daniel Blanco Parla Date: Mon, 13 Nov 2023 17:33:36 +0100 Subject: [PATCH 19/37] feat(Runtime): WeightPerGas & GasPoV update --- runtime/src/lib.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index df9d9145..5fde2b60 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -63,9 +63,7 @@ use pallet_grandpa::{ // Frontier use fp_rpc::TransactionStatus; use pallet_ethereum::{Call::transact, PostLogContent, Transaction as EthereumTransaction}; -use pallet_evm::{ - Account as EVMAccount, FeeCalculator, GasWeightMapping, Runner, -}; +use pallet_evm::{Account as EVMAccount, FeeCalculator, GasWeightMapping, Runner}; use pallet_sponsored_transactions::Call::send_sponsored_transaction; use pallet_validator_set::SessionBlockManager; // A few exports that help ease life for downstream crates. @@ -463,8 +461,8 @@ const WEIGHT_PER_GAS: u64 = 20_000; parameter_types! { pub PrecompilesValue: StabilityPrecompiles = StabilityPrecompiles::<_, StabilityFeeController>::new(); - pub WeightPerGas: Weight = Weight::from_parts(WEIGHT_PER_GAS, u64::MAX); - pub const GasLimitPovSizeRatio: u64 = 15; + pub WeightPerGas: Weight = Weight::from_parts(WEIGHT_PER_GAS, 0); + pub const GasLimitPovSizeRatio: u64 = 4; } impl pallet_evm::Config for Runtime { From cf839b6553bc3c5dcfddc33444aa3beb8d89c53f Mon Sep 17 00:00:00 2001 From: GabrielMartinezRodriguez Date: Tue, 14 Nov 2023 18:12:30 +0100 Subject: [PATCH 20/37] chore: expanded test --- .../macro/tests/expand/precompile.expanded.rs | 383 ----- .../tests/expand/precompile_name.expanded.rs | 37 - .../tests/expand/precompileset.expanded.rs | 1426 ----------------- .../tests/expand/returns_tuple.expanded.rs | 128 -- 4 files changed, 1974 deletions(-) delete mode 100644 precompiles/utils/macro/tests/expand/precompile.expanded.rs delete mode 100644 precompiles/utils/macro/tests/expand/precompile_name.expanded.rs delete mode 100644 precompiles/utils/macro/tests/expand/precompileset.expanded.rs delete mode 100644 precompiles/utils/macro/tests/expand/returns_tuple.expanded.rs diff --git a/precompiles/utils/macro/tests/expand/precompile.expanded.rs b/precompiles/utils/macro/tests/expand/precompile.expanded.rs deleted file mode 100644 index c5c5d5f4..00000000 --- a/precompiles/utils/macro/tests/expand/precompile.expanded.rs +++ /dev/null @@ -1,383 +0,0 @@ -use { - core::marker::PhantomData, precompile_utils::{EvmResult, prelude::*}, - sp_core::{H160, U256}, - frame_support::pallet_prelude::{Get, ConstU32}, -}; -struct BatchPrecompile(PhantomData); -type GetCallDataLimit = ConstU32<42>; -type GetArrayLimit = ConstU32<42>; -impl BatchPrecompile -where - Runtime: Get, -{ - fn pre_check(handle: &mut impl PrecompileHandle) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("pre_check")), - ) - } - fn batch_some( - handle: &mut impl PrecompileHandle, - to: BoundedVec, - value: BoundedVec, - call_data: BoundedVec, GetArrayLimit>, - gas_limit: BoundedVec, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("batch_some")), - ) - } - fn batch_some_until_failure( - handle: &mut impl PrecompileHandle, - to: BoundedVec, - value: BoundedVec, - call_data: BoundedVec, GetArrayLimit>, - gas_limit: BoundedVec, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!( - "not yet implemented: {0}", format_args!("batch_some_until_failure") - ), - ) - } - fn batch_all( - handle: &mut impl PrecompileHandle, - to: BoundedVec, - value: BoundedVec, - call_data: BoundedVec, GetArrayLimit>, - gas_limit: BoundedVec, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("batch_all")), - ) - } - fn fallback(handle: &mut impl PrecompileHandle) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("fallback")), - ) - } -} -#[allow(non_camel_case_types)] -pub enum BatchPrecompileCall -where - Runtime: Get, -{ - batch_all { - to: BoundedVec, - value: BoundedVec, - call_data: BoundedVec, GetArrayLimit>, - gas_limit: BoundedVec, - }, - batch_some { - to: BoundedVec, - value: BoundedVec, - call_data: BoundedVec, GetArrayLimit>, - gas_limit: BoundedVec, - }, - batch_some_until_failure { - to: BoundedVec, - value: BoundedVec, - call_data: BoundedVec, GetArrayLimit>, - gas_limit: BoundedVec, - }, - fallback {}, - #[doc(hidden)] - __phantom(::core::marker::PhantomData<(Runtime)>, ::core::convert::Infallible), -} -impl BatchPrecompileCall -where - Runtime: Get, -{ - pub fn parse_call_data( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::RevertReason; - let input = handle.input(); - let selector = input - .get(0..4) - .map(|s| { - let mut buffer = [0u8; 4]; - buffer.copy_from_slice(s); - u32::from_be_bytes(buffer) - }); - match selector { - Some(2044677020u32) => Self::_parse_batch_some(handle), - Some(2531431096u32) => Self::_parse_batch_all(handle), - Some(3473183175u32) => Self::_parse_batch_some_until_failure(handle), - _ => Self::_parse_fallback(handle), - } - } - fn _parse_batch_all( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - let mut input = handle.read_after_selector()?; - input.expect_arguments(4usize)?; - Ok(Self::batch_all { - to: input.read().in_field("to")?, - value: input.read().in_field("value")?, - call_data: input.read().in_field("callData")?, - gas_limit: input.read().in_field("gasLimit")?, - }) - } - fn _parse_batch_some( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - let mut input = handle.read_after_selector()?; - input.expect_arguments(4usize)?; - Ok(Self::batch_some { - to: input.read().in_field("to")?, - value: input.read().in_field("value")?, - call_data: input.read().in_field("callData")?, - gas_limit: input.read().in_field("gasLimit")?, - }) - } - fn _parse_batch_some_until_failure( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - let mut input = handle.read_after_selector()?; - input.expect_arguments(4usize)?; - Ok(Self::batch_some_until_failure { - to: input.read().in_field("to")?, - value: input.read().in_field("value")?, - call_data: input.read().in_field("callData")?, - gas_limit: input.read().in_field("gasLimit")?, - }) - } - fn _parse_fallback( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - Ok(Self::fallback {}) - } - pub fn execute( - self, - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult<::fp_evm::PrecompileOutput> { - use ::precompile_utils::solidity::codec::Writer; - use ::fp_evm::{PrecompileOutput, ExitSucceed}; - let output = match self { - Self::batch_all { to, value, call_data, gas_limit } => { - let output = >::batch_all(handle, to, value, call_data, gas_limit); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::batch_some { to, value, call_data, gas_limit } => { - let output = >::batch_some(handle, to, value, call_data, gas_limit); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::batch_some_until_failure { to, value, call_data, gas_limit } => { - let output = >::batch_some_until_failure(handle, to, value, call_data, gas_limit); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::fallback {} => { - let output = >::fallback(handle); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::__phantom(_, _) => { - ::core::panicking::panic_fmt( - format_args!("__phantom variant should not be used"), - ) - } - }; - Ok(PrecompileOutput { - exit_status: ExitSucceed::Returned, - output, - }) - } - pub fn supports_selector(selector: u32) -> bool { - match selector { - 2044677020u32 => true, - 2531431096u32 => true, - 3473183175u32 => true, - _ => false, - } - } - pub fn selectors() -> &'static [u32] { - &[2044677020u32, 2531431096u32, 3473183175u32] - } - pub fn batch_all_selectors() -> &'static [u32] { - &[2531431096u32] - } - pub fn batch_some_selectors() -> &'static [u32] { - &[2044677020u32] - } - pub fn batch_some_until_failure_selectors() -> &'static [u32] { - &[3473183175u32] - } - pub fn fallback_selectors() -> &'static [u32] { - &[] - } - pub fn encode(self) -> ::sp_std::vec::Vec { - use ::precompile_utils::solidity::codec::Writer; - match self { - Self::batch_all { to, value, call_data, gas_limit } => { - Writer::new_with_selector(2531431096u32) - .write(to) - .write(value) - .write(call_data) - .write(gas_limit) - .build() - } - Self::batch_some { to, value, call_data, gas_limit } => { - Writer::new_with_selector(2044677020u32) - .write(to) - .write(value) - .write(call_data) - .write(gas_limit) - .build() - } - Self::batch_some_until_failure { to, value, call_data, gas_limit } => { - Writer::new_with_selector(3473183175u32) - .write(to) - .write(value) - .write(call_data) - .write(gas_limit) - .build() - } - Self::fallback {} => Default::default(), - Self::__phantom(_, _) => { - ::core::panicking::panic_fmt( - format_args!("__phantom variant should not be used"), - ) - } - } - } -} -impl From> for ::sp_std::vec::Vec -where - Runtime: Get, -{ - fn from(a: BatchPrecompileCall) -> ::sp_std::vec::Vec { - a.encode() - } -} -impl ::fp_evm::Precompile for BatchPrecompile -where - Runtime: Get, -{ - fn execute( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult<::fp_evm::PrecompileOutput> { - let _: () = >::pre_check(handle)?; - >::parse_call_data(handle)?.execute(handle) - } -} -#[allow(non_snake_case)] -pub(crate) fn __BatchPrecompile_test_solidity_signatures_inner() { - use ::precompile_utils::solidity::Codec; - match ( - &"(address[],uint256[],bytes[],uint64[])", - &<( - BoundedVec, - BoundedVec, - BoundedVec, GetArrayLimit>, - BoundedVec, - ) as Codec>::signature(), - ) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "batch_all" - ), - ), - ); - } - } - }; - match ( - &"(address[],uint256[],bytes[],uint64[])", - &<( - BoundedVec, - BoundedVec, - BoundedVec, GetArrayLimit>, - BoundedVec, - ) as Codec>::signature(), - ) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "batch_some" - ), - ), - ); - } - } - }; - match ( - &"(address[],uint256[],bytes[],uint64[])", - &<( - BoundedVec, - BoundedVec, - BoundedVec, GetArrayLimit>, - BoundedVec, - ) as Codec>::signature(), - ) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "batch_some_until_failure" - ), - ), - ); - } - } - }; - match (&"()", &<() as Codec>::signature()) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "fallback" - ), - ), - ); - } - } - }; -} diff --git a/precompiles/utils/macro/tests/expand/precompile_name.expanded.rs b/precompiles/utils/macro/tests/expand/precompile_name.expanded.rs deleted file mode 100644 index 1d04b9ed..00000000 --- a/precompiles/utils/macro/tests/expand/precompile_name.expanded.rs +++ /dev/null @@ -1,37 +0,0 @@ -struct PrecompileAt(PhantomData<(T, U, V)>); -struct AddressU64; -struct FooPrecompile(PhantomData); -struct BarPrecompile(PhantomData<(R, S)>); -struct MockCheck; -type Precompiles = ( - PrecompileAt, FooPrecompile>, - PrecompileAt, BarPrecompile, (MockCheck, MockCheck)>, -); -#[repr(u64)] -pub enum PrecompileName { - FooPrecompile = 1u64, - BarPrecompile = 2u64, -} -#[automatically_derived] -impl ::core::fmt::Debug for PrecompileName { - fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - ::core::fmt::Formatter::write_str( - f, - match self { - PrecompileName::FooPrecompile => "FooPrecompile", - PrecompileName::BarPrecompile => "BarPrecompile", - }, - ) - } -} -impl PrecompileName { - pub fn from_address(address: sp_core::H160) -> Option { - let _u64 = address.to_low_u64_be(); - if address == sp_core::H160::from_low_u64_be(_u64) { - use num_enum::TryFromPrimitive; - Self::try_from_primitive(_u64).ok() - } else { - None - } - } -} diff --git a/precompiles/utils/macro/tests/expand/precompileset.expanded.rs b/precompiles/utils/macro/tests/expand/precompileset.expanded.rs deleted file mode 100644 index 59163757..00000000 --- a/precompiles/utils/macro/tests/expand/precompileset.expanded.rs +++ /dev/null @@ -1,1426 +0,0 @@ -use { - core::marker::PhantomData, - precompile_utils::{EvmResult, prelude::*, testing::PrecompileTesterExt}, - sp_core::H160, -}; -struct PrecompileSet(PhantomData); -type Discriminant = u32; -type GetAssetsStringLimit = R; -type MockRuntime = ConstU32<42>; -impl PrecompileSet -where - Runtime: Get, -{ - /// PrecompileSet discrimiant. Allows to knows if the address maps to an asset id, - /// and if this is the case which one. - fn discriminant(address: H160) -> Option { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("discriminant")), - ) - } - fn total_supply( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("total_supply")), - ) - } - fn balance_of( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - who: Address, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("balance_of")), - ) - } - fn allowance( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - owner: Address, - spender: Address, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("allowance")), - ) - } - fn approve( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - spender: Address, - value: U256, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("approve")), - ) - } - fn approve_inner( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - owner: H160, - spender: H160, - value: U256, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("approve_inner")), - ) - } - fn transfer( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - to: Address, - value: U256, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("transfer")), - ) - } - fn transfer_from( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - from: Address, - to: Address, - value: U256, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("transfer_from")), - ) - } - fn name( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("name")), - ) - } - fn symbol( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("symbol")), - ) - } - fn decimals( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("decimals")), - ) - } - fn mint( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - to: Address, - value: U256, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("mint")), - ) - } - fn burn( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - from: Address, - value: U256, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("burn")), - ) - } - fn freeze( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - account: Address, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("freeze")), - ) - } - fn thaw( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - account: Address, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("thaw")), - ) - } - fn freeze_asset( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("freeze_asset")), - ) - } - fn thaw_asset( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("thaw_asset")), - ) - } - fn transfer_ownership( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - owner: Address, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("transfer_ownership")), - ) - } - fn set_team( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - issuer: Address, - admin: Address, - freezer: Address, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("set_team")), - ) - } - fn set_metadata( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - name: BoundedString>, - symbol: BoundedString>, - decimals: u8, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("set_metadata")), - ) - } - fn clear_metadata( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("clear_metadata")), - ) - } - fn eip2612_permit( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - owner: Address, - spender: Address, - value: U256, - deadline: U256, - v: u8, - r: H256, - s: H256, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("eip2612_permit")), - ) - } - fn eip2612_nonces( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - owner: Address, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("eip2612_nonces")), - ) - } - fn eip2612_domain_separator( - asset_id: Discriminant, - handle: &mut impl PrecompileHandle, - ) -> EvmResult { - ::core::panicking::panic_fmt( - format_args!( - "not yet implemented: {0}", format_args!("eip2612_domain_separator") - ), - ) - } -} -#[allow(non_camel_case_types)] -pub enum PrecompileSetCall -where - Runtime: Get, -{ - allowance { owner: Address, spender: Address }, - approve { spender: Address, value: U256 }, - balance_of { who: Address }, - burn { from: Address, value: U256 }, - clear_metadata {}, - decimals {}, - eip2612_domain_separator {}, - eip2612_nonces { owner: Address }, - eip2612_permit { - owner: Address, - spender: Address, - value: U256, - deadline: U256, - v: u8, - r: H256, - s: H256, - }, - freeze { account: Address }, - freeze_asset {}, - mint { to: Address, value: U256 }, - name {}, - set_metadata { - name: BoundedString>, - symbol: BoundedString>, - decimals: u8, - }, - set_team { issuer: Address, admin: Address, freezer: Address }, - symbol {}, - thaw { account: Address }, - thaw_asset {}, - total_supply {}, - transfer { to: Address, value: U256 }, - transfer_from { from: Address, to: Address, value: U256 }, - transfer_ownership { owner: Address }, - #[doc(hidden)] - __phantom(::core::marker::PhantomData<(Runtime)>, ::core::convert::Infallible), -} -impl PrecompileSetCall -where - Runtime: Get, -{ - pub fn parse_call_data( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::RevertReason; - let input = handle.input(); - let selector = input - .get(0..4) - .map(|s| { - let mut buffer = [0u8; 4]; - buffer.copy_from_slice(s); - u32::from_be_bytes(buffer) - }); - match selector { - Some(117300739u32) => Self::_parse_name(handle), - Some(157198259u32) => Self::_parse_approve(handle), - Some(404098525u32) => Self::_parse_total_supply(handle), - Some(484305945u32) => Self::_parse_thaw_asset(handle), - Some(599290589u32) => Self::_parse_transfer_from(handle), - Some(826074471u32) => Self::_parse_decimals(handle), - Some(910484757u32) => Self::_parse_eip2612_domain_separator(handle), - Some(936559348u32) => Self::_parse_set_metadata(handle), - Some(1086394137u32) => Self::_parse_mint(handle), - Some(1374431959u32) => Self::_parse_thaw_asset(handle), - Some(1587675670u32) => Self::_parse_thaw(handle), - Some(1804030401u32) => Self::_parse_freeze_asset(handle), - Some(1889567281u32) => Self::_parse_balance_of(handle), - Some(2127478272u32) => Self::_parse_eip2612_nonces(handle), - Some(2367676207u32) => Self::_parse_freeze(handle), - Some(2514000705u32) => Self::_parse_symbol(handle), - Some(2646777772u32) => Self::_parse_burn(handle), - Some(2835717307u32) => Self::_parse_transfer(handle), - Some(3352902745u32) => Self::_parse_set_team(handle), - Some(3552201630u32) => Self::_parse_clear_metadata(handle), - Some(3566436177u32) => Self::_parse_freeze_asset(handle), - Some(3573918927u32) => Self::_parse_eip2612_permit(handle), - Some(3714247998u32) => Self::_parse_allowance(handle), - Some(3999121892u32) => Self::_parse_set_metadata(handle), - Some(4021736498u32) => Self::_parse_clear_metadata(handle), - Some(4030008324u32) => Self::_parse_transfer_ownership(handle), - Some(4076725131u32) => Self::_parse_transfer_ownership(handle), - Some(4173303445u32) => Self::_parse_set_team(handle), - Some(_) => Err(RevertReason::UnknownSelector.into()), - None => Err(RevertReason::read_out_of_bounds("selector").into()), - } - } - fn _parse_allowance( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - let mut input = handle.read_after_selector()?; - input.expect_arguments(2usize)?; - Ok(Self::allowance { - owner: input.read().in_field("owner")?, - spender: input.read().in_field("spender")?, - }) - } - fn _parse_approve( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - let mut input = handle.read_after_selector()?; - input.expect_arguments(2usize)?; - Ok(Self::approve { - spender: input.read().in_field("spender")?, - value: input.read().in_field("value")?, - }) - } - fn _parse_balance_of( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - let mut input = handle.read_after_selector()?; - input.expect_arguments(1usize)?; - Ok(Self::balance_of { - who: input.read().in_field("who")?, - }) - } - fn _parse_burn( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - let mut input = handle.read_after_selector()?; - input.expect_arguments(2usize)?; - Ok(Self::burn { - from: input.read().in_field("from")?, - value: input.read().in_field("value")?, - }) - } - fn _parse_clear_metadata( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - Ok(Self::clear_metadata {}) - } - fn _parse_decimals( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - Ok(Self::decimals {}) - } - fn _parse_eip2612_domain_separator( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::View)?; - Ok(Self::eip2612_domain_separator {}) - } - fn _parse_eip2612_nonces( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::View)?; - let mut input = handle.read_after_selector()?; - input.expect_arguments(1usize)?; - Ok(Self::eip2612_nonces { - owner: input.read().in_field("owner")?, - }) - } - fn _parse_eip2612_permit( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - let mut input = handle.read_after_selector()?; - input.expect_arguments(7usize)?; - Ok(Self::eip2612_permit { - owner: input.read().in_field("owner")?, - spender: input.read().in_field("spender")?, - value: input.read().in_field("value")?, - deadline: input.read().in_field("deadline")?, - v: input.read().in_field("v")?, - r: input.read().in_field("r")?, - s: input.read().in_field("s")?, - }) - } - fn _parse_freeze( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - let mut input = handle.read_after_selector()?; - input.expect_arguments(1usize)?; - Ok(Self::freeze { - account: input.read().in_field("account")?, - }) - } - fn _parse_freeze_asset( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - Ok(Self::freeze_asset {}) - } - fn _parse_mint( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - let mut input = handle.read_after_selector()?; - input.expect_arguments(2usize)?; - Ok(Self::mint { - to: input.read().in_field("to")?, - value: input.read().in_field("value")?, - }) - } - fn _parse_name( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - Ok(Self::name {}) - } - fn _parse_set_metadata( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - let mut input = handle.read_after_selector()?; - input.expect_arguments(3usize)?; - Ok(Self::set_metadata { - name: input.read().in_field("name")?, - symbol: input.read().in_field("symbol")?, - decimals: input.read().in_field("decimals")?, - }) - } - fn _parse_set_team( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - let mut input = handle.read_after_selector()?; - input.expect_arguments(3usize)?; - Ok(Self::set_team { - issuer: input.read().in_field("issuer")?, - admin: input.read().in_field("admin")?, - freezer: input.read().in_field("freezer")?, - }) - } - fn _parse_symbol( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - Ok(Self::symbol {}) - } - fn _parse_thaw( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - let mut input = handle.read_after_selector()?; - input.expect_arguments(1usize)?; - Ok(Self::thaw { - account: input.read().in_field("account")?, - }) - } - fn _parse_thaw_asset( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - Ok(Self::thaw_asset {}) - } - fn _parse_total_supply( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - Ok(Self::total_supply {}) - } - fn _parse_transfer( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - let mut input = handle.read_after_selector()?; - input.expect_arguments(2usize)?; - Ok(Self::transfer { - to: input.read().in_field("to")?, - value: input.read().in_field("value")?, - }) - } - fn _parse_transfer_from( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - let mut input = handle.read_after_selector()?; - input.expect_arguments(3usize)?; - Ok(Self::transfer_from { - from: input.read().in_field("from")?, - to: input.read().in_field("to")?, - value: input.read().in_field("value")?, - }) - } - fn _parse_transfer_ownership( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - let mut input = handle.read_after_selector()?; - input.expect_arguments(1usize)?; - Ok(Self::transfer_ownership { - owner: input.read().in_field("owner")?, - }) - } - pub fn execute( - self, - discriminant: Discriminant, - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult<::fp_evm::PrecompileOutput> { - use ::precompile_utils::solidity::codec::Writer; - use ::fp_evm::{PrecompileOutput, ExitSucceed}; - let output = match self { - Self::allowance { owner, spender } => { - let output = >::allowance(discriminant, handle, owner, spender); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::approve { spender, value } => { - let output = >::approve(discriminant, handle, spender, value); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::balance_of { who } => { - let output = >::balance_of(discriminant, handle, who); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::burn { from, value } => { - let output = >::burn(discriminant, handle, from, value); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::clear_metadata {} => { - let output = >::clear_metadata(discriminant, handle); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::decimals {} => { - let output = >::decimals(discriminant, handle); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::eip2612_domain_separator {} => { - let output = >::eip2612_domain_separator(discriminant, handle); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::eip2612_nonces { owner } => { - let output = >::eip2612_nonces(discriminant, handle, owner); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::eip2612_permit { owner, spender, value, deadline, v, r, s } => { - let output = >::eip2612_permit( - discriminant, - handle, - owner, - spender, - value, - deadline, - v, - r, - s, - ); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::freeze { account } => { - let output = >::freeze(discriminant, handle, account); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::freeze_asset {} => { - let output = >::freeze_asset(discriminant, handle); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::mint { to, value } => { - let output = >::mint(discriminant, handle, to, value); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::name {} => { - let output = >::name(discriminant, handle); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::set_metadata { name, symbol, decimals } => { - let output = >::set_metadata(discriminant, handle, name, symbol, decimals); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::set_team { issuer, admin, freezer } => { - let output = >::set_team(discriminant, handle, issuer, admin, freezer); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::symbol {} => { - let output = >::symbol(discriminant, handle); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::thaw { account } => { - let output = >::thaw(discriminant, handle, account); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::thaw_asset {} => { - let output = >::thaw_asset(discriminant, handle); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::total_supply {} => { - let output = >::total_supply(discriminant, handle); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::transfer { to, value } => { - let output = >::transfer(discriminant, handle, to, value); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::transfer_from { from, to, value } => { - let output = >::transfer_from(discriminant, handle, from, to, value); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::transfer_ownership { owner } => { - let output = >::transfer_ownership(discriminant, handle, owner); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::__phantom(_, _) => { - ::core::panicking::panic_fmt( - format_args!("__phantom variant should not be used"), - ) - } - }; - Ok(PrecompileOutput { - exit_status: ExitSucceed::Returned, - output, - }) - } - pub fn supports_selector(selector: u32) -> bool { - match selector { - 117300739u32 => true, - 157198259u32 => true, - 404098525u32 => true, - 484305945u32 => true, - 599290589u32 => true, - 826074471u32 => true, - 910484757u32 => true, - 936559348u32 => true, - 1086394137u32 => true, - 1374431959u32 => true, - 1587675670u32 => true, - 1804030401u32 => true, - 1889567281u32 => true, - 2127478272u32 => true, - 2367676207u32 => true, - 2514000705u32 => true, - 2646777772u32 => true, - 2835717307u32 => true, - 3352902745u32 => true, - 3552201630u32 => true, - 3566436177u32 => true, - 3573918927u32 => true, - 3714247998u32 => true, - 3999121892u32 => true, - 4021736498u32 => true, - 4030008324u32 => true, - 4076725131u32 => true, - 4173303445u32 => true, - _ => false, - } - } - pub fn selectors() -> &'static [u32] { - &[ - 117300739u32, - 157198259u32, - 404098525u32, - 484305945u32, - 599290589u32, - 826074471u32, - 910484757u32, - 936559348u32, - 1086394137u32, - 1374431959u32, - 1587675670u32, - 1804030401u32, - 1889567281u32, - 2127478272u32, - 2367676207u32, - 2514000705u32, - 2646777772u32, - 2835717307u32, - 3352902745u32, - 3552201630u32, - 3566436177u32, - 3573918927u32, - 3714247998u32, - 3999121892u32, - 4021736498u32, - 4030008324u32, - 4076725131u32, - 4173303445u32, - ] - } - pub fn allowance_selectors() -> &'static [u32] { - &[3714247998u32] - } - pub fn approve_selectors() -> &'static [u32] { - &[157198259u32] - } - pub fn balance_of_selectors() -> &'static [u32] { - &[1889567281u32] - } - pub fn burn_selectors() -> &'static [u32] { - &[2646777772u32] - } - pub fn clear_metadata_selectors() -> &'static [u32] { - &[4021736498u32, 3552201630u32] - } - pub fn decimals_selectors() -> &'static [u32] { - &[826074471u32] - } - pub fn eip2612_domain_separator_selectors() -> &'static [u32] { - &[910484757u32] - } - pub fn eip2612_nonces_selectors() -> &'static [u32] { - &[2127478272u32] - } - pub fn eip2612_permit_selectors() -> &'static [u32] { - &[3573918927u32] - } - pub fn freeze_selectors() -> &'static [u32] { - &[2367676207u32] - } - pub fn freeze_asset_selectors() -> &'static [u32] { - &[3566436177u32, 1804030401u32] - } - pub fn mint_selectors() -> &'static [u32] { - &[1086394137u32] - } - pub fn name_selectors() -> &'static [u32] { - &[117300739u32] - } - pub fn set_metadata_selectors() -> &'static [u32] { - &[936559348u32, 3999121892u32] - } - pub fn set_team_selectors() -> &'static [u32] { - &[3352902745u32, 4173303445u32] - } - pub fn symbol_selectors() -> &'static [u32] { - &[2514000705u32] - } - pub fn thaw_selectors() -> &'static [u32] { - &[1587675670u32] - } - pub fn thaw_asset_selectors() -> &'static [u32] { - &[1374431959u32, 484305945u32] - } - pub fn total_supply_selectors() -> &'static [u32] { - &[404098525u32] - } - pub fn transfer_selectors() -> &'static [u32] { - &[2835717307u32] - } - pub fn transfer_from_selectors() -> &'static [u32] { - &[599290589u32] - } - pub fn transfer_ownership_selectors() -> &'static [u32] { - &[4076725131u32, 4030008324u32] - } - pub fn encode(self) -> ::sp_std::vec::Vec { - use ::precompile_utils::solidity::codec::Writer; - match self { - Self::allowance { owner, spender } => { - Writer::new_with_selector(3714247998u32) - .write(owner) - .write(spender) - .build() - } - Self::approve { spender, value } => { - Writer::new_with_selector(157198259u32) - .write(spender) - .write(value) - .build() - } - Self::balance_of { who } => { - Writer::new_with_selector(1889567281u32).write(who).build() - } - Self::burn { from, value } => { - Writer::new_with_selector(2646777772u32).write(from).write(value).build() - } - Self::clear_metadata {} => Writer::new_with_selector(4021736498u32).build(), - Self::decimals {} => Writer::new_with_selector(826074471u32).build(), - Self::eip2612_domain_separator {} => { - Writer::new_with_selector(910484757u32).build() - } - Self::eip2612_nonces { owner } => { - Writer::new_with_selector(2127478272u32).write(owner).build() - } - Self::eip2612_permit { owner, spender, value, deadline, v, r, s } => { - Writer::new_with_selector(3573918927u32) - .write(owner) - .write(spender) - .write(value) - .write(deadline) - .write(v) - .write(r) - .write(s) - .build() - } - Self::freeze { account } => { - Writer::new_with_selector(2367676207u32).write(account).build() - } - Self::freeze_asset {} => Writer::new_with_selector(3566436177u32).build(), - Self::mint { to, value } => { - Writer::new_with_selector(1086394137u32).write(to).write(value).build() - } - Self::name {} => Writer::new_with_selector(117300739u32).build(), - Self::set_metadata { name, symbol, decimals } => { - Writer::new_with_selector(936559348u32) - .write(name) - .write(symbol) - .write(decimals) - .build() - } - Self::set_team { issuer, admin, freezer } => { - Writer::new_with_selector(3352902745u32) - .write(issuer) - .write(admin) - .write(freezer) - .build() - } - Self::symbol {} => Writer::new_with_selector(2514000705u32).build(), - Self::thaw { account } => { - Writer::new_with_selector(1587675670u32).write(account).build() - } - Self::thaw_asset {} => Writer::new_with_selector(1374431959u32).build(), - Self::total_supply {} => Writer::new_with_selector(404098525u32).build(), - Self::transfer { to, value } => { - Writer::new_with_selector(2835717307u32).write(to).write(value).build() - } - Self::transfer_from { from, to, value } => { - Writer::new_with_selector(599290589u32) - .write(from) - .write(to) - .write(value) - .build() - } - Self::transfer_ownership { owner } => { - Writer::new_with_selector(4076725131u32).write(owner).build() - } - Self::__phantom(_, _) => { - ::core::panicking::panic_fmt( - format_args!("__phantom variant should not be used"), - ) - } - } - } -} -impl From> for ::sp_std::vec::Vec -where - Runtime: Get, -{ - fn from(a: PrecompileSetCall) -> ::sp_std::vec::Vec { - a.encode() - } -} -impl ::fp_evm::PrecompileSet for PrecompileSet -where - Runtime: Get, -{ - fn execute( - &self, - handle: &mut impl PrecompileHandle, - ) -> Option<::precompile_utils::EvmResult<::fp_evm::PrecompileOutput>> { - let discriminant = match >::discriminant(handle.code_address()) { - Some(d) => d, - None => return None, - }; - Some( - >::parse_call_data(handle) - .and_then(|call| call.execute(discriminant, handle)), - ) - } - fn is_precompile(&self, address: H160, gas: u64) -> ::fp_evm::IsPrecompileResult { - >::discriminant(address, gas).is_some() - } -} -#[allow(non_snake_case)] -pub(crate) fn __PrecompileSet_test_solidity_signatures_inner() -where - Runtime: Get, -{ - use ::precompile_utils::solidity::Codec; - match (&"(address,address)", &<(Address, Address) as Codec>::signature()) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "allowance" - ), - ), - ); - } - } - }; - match (&"(address,uint256)", &<(Address, U256) as Codec>::signature()) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "approve" - ), - ), - ); - } - } - }; - match (&"(address)", &<(Address,) as Codec>::signature()) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "balance_of" - ), - ), - ); - } - } - }; - match (&"(address,uint256)", &<(Address, U256) as Codec>::signature()) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "burn" - ), - ), - ); - } - } - }; - match (&"()", &<() as Codec>::signature()) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "clear_metadata" - ), - ), - ); - } - } - }; - match (&"()", &<() as Codec>::signature()) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "decimals" - ), - ), - ); - } - } - }; - match (&"()", &<() as Codec>::signature()) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "eip2612_domain_separator" - ), - ), - ); - } - } - }; - match (&"(address)", &<(Address,) as Codec>::signature()) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "eip2612_nonces" - ), - ), - ); - } - } - }; - match ( - &"(address,address,uint256,uint256,uint8,bytes32,bytes32)", - &<(Address, Address, U256, U256, u8, H256, H256) as Codec>::signature(), - ) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "eip2612_permit" - ), - ), - ); - } - } - }; - match (&"(address)", &<(Address,) as Codec>::signature()) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "freeze" - ), - ), - ); - } - } - }; - match (&"()", &<() as Codec>::signature()) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "freeze_asset" - ), - ), - ); - } - } - }; - match (&"(address,uint256)", &<(Address, U256) as Codec>::signature()) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "mint" - ), - ), - ); - } - } - }; - match (&"()", &<() as Codec>::signature()) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "name" - ), - ), - ); - } - } - }; - match ( - &"(string,string,uint8)", - &<( - BoundedString>, - BoundedString>, - u8, - ) as Codec>::signature(), - ) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "set_metadata" - ), - ), - ); - } - } - }; - match ( - &"(address,address,address)", - &<(Address, Address, Address) as Codec>::signature(), - ) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "set_team" - ), - ), - ); - } - } - }; - match (&"()", &<() as Codec>::signature()) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "symbol" - ), - ), - ); - } - } - }; - match (&"(address)", &<(Address,) as Codec>::signature()) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "thaw" - ), - ), - ); - } - } - }; - match (&"()", &<() as Codec>::signature()) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "thaw_asset" - ), - ), - ); - } - } - }; - match (&"()", &<() as Codec>::signature()) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "total_supply" - ), - ), - ); - } - } - }; - match (&"(address,uint256)", &<(Address, U256) as Codec>::signature()) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "transfer" - ), - ), - ); - } - } - }; - match ( - &"(address,address,uint256)", - &<(Address, Address, U256) as Codec>::signature(), - ) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "transfer_from" - ), - ), - ); - } - } - }; - match (&"(address)", &<(Address,) as Codec>::signature()) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "transfer_ownership" - ), - ), - ); - } - } - }; -} diff --git a/precompiles/utils/macro/tests/expand/returns_tuple.expanded.rs b/precompiles/utils/macro/tests/expand/returns_tuple.expanded.rs deleted file mode 100644 index 1f4f4642..00000000 --- a/precompiles/utils/macro/tests/expand/returns_tuple.expanded.rs +++ /dev/null @@ -1,128 +0,0 @@ -use { - precompile_utils::{EvmResult, prelude::*}, - sp_core::{H160, U256}, -}; -struct ExamplePrecompile; -impl ExamplePrecompile { - fn example( - handle: &mut impl PrecompileHandle, - ) -> EvmResult<(Address, U256, UnboundedBytes)> { - ::core::panicking::panic_fmt( - format_args!("not yet implemented: {0}", format_args!("example")), - ) - } -} -#[allow(non_camel_case_types)] -pub enum ExamplePrecompileCall { - example {}, - #[doc(hidden)] - __phantom(::core::marker::PhantomData<()>, ::core::convert::Infallible), -} -impl ExamplePrecompileCall { - pub fn parse_call_data( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::RevertReason; - let input = handle.input(); - let selector = input - .get(0..4) - .map(|s| { - let mut buffer = [0u8; 4]; - buffer.copy_from_slice(s); - u32::from_be_bytes(buffer) - }); - match selector { - Some(1412775727u32) => Self::_parse_example(handle), - Some(_) => Err(RevertReason::UnknownSelector.into()), - None => Err(RevertReason::read_out_of_bounds("selector").into()), - } - } - fn _parse_example( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult { - use ::precompile_utils::solidity::revert::InjectBacktrace; - use ::precompile_utils::solidity::modifier::FunctionModifier; - use ::precompile_utils::evm::handle::PrecompileHandleExt; - handle.check_function_modifier(FunctionModifier::NonPayable)?; - Ok(Self::example {}) - } - pub fn execute( - self, - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult<::fp_evm::PrecompileOutput> { - use ::precompile_utils::solidity::codec::Writer; - use ::fp_evm::{PrecompileOutput, ExitSucceed}; - let output = match self { - Self::example {} => { - let output = ::example(handle); - ::precompile_utils::solidity::encode_return_value(output?) - } - Self::__phantom(_, _) => { - ::core::panicking::panic_fmt( - format_args!("__phantom variant should not be used"), - ) - } - }; - Ok(PrecompileOutput { - exit_status: ExitSucceed::Returned, - output, - }) - } - pub fn supports_selector(selector: u32) -> bool { - match selector { - 1412775727u32 => true, - _ => false, - } - } - pub fn selectors() -> &'static [u32] { - &[1412775727u32] - } - pub fn example_selectors() -> &'static [u32] { - &[1412775727u32] - } - pub fn encode(self) -> ::sp_std::vec::Vec { - use ::precompile_utils::solidity::codec::Writer; - match self { - Self::example {} => Writer::new_with_selector(1412775727u32).build(), - Self::__phantom(_, _) => { - ::core::panicking::panic_fmt( - format_args!("__phantom variant should not be used"), - ) - } - } - } -} -impl From for ::sp_std::vec::Vec { - fn from(a: ExamplePrecompileCall) -> ::sp_std::vec::Vec { - a.encode() - } -} -impl ::fp_evm::Precompile for ExamplePrecompile { - fn execute( - handle: &mut impl PrecompileHandle, - ) -> ::precompile_utils::EvmResult<::fp_evm::PrecompileOutput> { - ::parse_call_data(handle)?.execute(handle) - } -} -#[allow(non_snake_case)] -pub(crate) fn __ExamplePrecompile_test_solidity_signatures_inner() { - use ::precompile_utils::solidity::Codec; - match (&"()", &<() as Codec>::signature()) { - (left_val, right_val) => { - if !(*left_val == *right_val) { - let kind = ::core::panicking::AssertKind::Eq; - ::core::panicking::assert_failed( - kind, - &*left_val, - &*right_val, - ::core::option::Option::Some( - format_args!( - "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", - "example" - ), - ), - ); - } - } - }; -} From bd46c869cddc46aa7da7aaab7549537c7fdf3310 Mon Sep 17 00:00:00 2001 From: GabrielMartinezRodriguez Date: Tue, 14 Nov 2023 22:47:10 +0100 Subject: [PATCH 21/37] fix: expand and ui test --- .../precompile/codec/no-output.stderr | 2 +- .../codec/output-dont-impl-codec.stderr | 2 +- .../codec/output-wrong-error-result.stderr | 4 +- .../discriminant/dont-return-option.stderr | 6 +- .../discriminant/missing-param.stderr | 4 +- .../return-incomplete-option.stderr | 6 +- .../discriminant/too-many-arguments.stderr | 6 +- .../discriminant/type-mismatch-1.stderr | 8 +- .../discriminant/type-mismatch-2.stderr | 6 +- .../precompile/handle/missing.stderr | 2 +- .../precompile/handle/set-missing.stderr | 2 +- .../precompile/pre-check/no-parameter.stderr | 2 +- .../pre-check/too-many-parameters.stderr | 2 +- .../macro/tests/expand/precompile.expanded.rs | 393 ++++++++++++++++++ .../tests/expand/precompile_name.expanded.rs | 37 ++ .../tests/expand/precompileset.expanded.rs | 9 + .../tests/expand/returns_tuple.expanded.rs | 130 ++++++ precompiles/utils/macro/tests/tests.rs | 2 +- 18 files changed, 596 insertions(+), 27 deletions(-) create mode 100644 precompiles/utils/macro/tests/expand/precompile.expanded.rs create mode 100644 precompiles/utils/macro/tests/expand/precompile_name.expanded.rs create mode 100644 precompiles/utils/macro/tests/expand/precompileset.expanded.rs create mode 100644 precompiles/utils/macro/tests/expand/returns_tuple.expanded.rs diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/codec/no-output.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/codec/no-output.stderr index 7a2758d0..6e0dcb27 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/codec/no-output.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/codec/no-output.stderr @@ -2,4 +2,4 @@ error: A precompile method must have a return type of `EvmResult<_>` (exposed by --> tests/compile-fail/precompile/codec/no-output.rs:24:2 | 24 | fn foo(test: &mut impl PrecompileHandle) { - | ^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-dont-impl-codec.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-dont-impl-codec.stderr index 52ba67e6..1d45cd1a 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-dont-impl-codec.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-dont-impl-codec.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `String: Codec` is not satisfied --> tests/compile-fail/precompile/codec/output-dont-impl-codec.rs:26:46 | 26 | fn foo(test: &mut impl PrecompileHandle) -> EvmResult { - | ^^^^^^^^^ the trait `Codec` is not implemented for `String` + | ^^^^^^^^^^^^^^^^^ the trait `Codec` is not implemented for `String` | = help: the following other types implement trait `Codec`: () diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-wrong-error-result.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-wrong-error-result.stderr index fa1fc8f7..b2dff2fd 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-wrong-error-result.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/codec/output-wrong-error-result.stderr @@ -1,8 +1,8 @@ error[E0277]: `?` couldn't convert the error to `PrecompileFailure` - --> tests/compile-fail/precompile/codec/output-wrong-error-result.rs:25:51 + --> tests/compile-fail/precompile/codec/output-wrong-error-result.rs:25:63 | 25 | fn foo(test: &mut impl PrecompileHandle) -> Result<(), String> { - | ^ the trait `From` is not implemented for `PrecompileFailure` + | ^ the trait `From` is not implemented for `PrecompileFailure` | = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait = help: the following other types implement trait `From`: diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/dont-return-option.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/dont-return-option.stderr index 66d90708..465985f8 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/dont-return-option.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/dont-return-option.stderr @@ -1,5 +1,5 @@ -error: The discriminant function must return an Option<_> (no type alias) - --> tests/compile-fail/precompile/discriminant/dont-return-option.rs:25:36 +error: The discriminant function must only take code address (H160) and remaining gas (u64) as parameters. + --> tests/compile-fail/precompile/discriminant/dont-return-option.rs:25:2 | 25 | fn discriminant(address: H160) -> u32 { - | ^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-param.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-param.stderr index 3026b5ce..675b3eb8 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-param.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/missing-param.stderr @@ -1,5 +1,5 @@ -error: The discriminant function must only take the code address (H160) as parameter. +error: The discriminant function must only take code address (H160) and remaining gas (u64) as parameters. --> tests/compile-fail/precompile/discriminant/missing-param.rs:25:2 | 25 | fn discriminant() -> Option { - | ^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/return-incomplete-option.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/return-incomplete-option.stderr index dc6db9f6..619306fa 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/return-incomplete-option.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/return-incomplete-option.stderr @@ -1,5 +1,5 @@ -error: The discriminant function must return an Option<_> (no type alias) - --> tests/compile-fail/precompile/discriminant/return-incomplete-option.rs:25:36 +error: The discriminant function must only take code address (H160) and remaining gas (u64) as parameters. + --> tests/compile-fail/precompile/discriminant/return-incomplete-option.rs:25:2 | 25 | fn discriminant(address: H160) -> Option { - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/too-many-arguments.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/too-many-arguments.stderr index a1b6e878..d02874d3 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/too-many-arguments.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/too-many-arguments.stderr @@ -1,5 +1,5 @@ -error: The discriminant function must only take the code address (H160) as parameter. - --> tests/compile-fail/precompile/discriminant/too-many-arguments.rs:25:2 +error: The discriminant function must return an DiscriminantResult<_> (no type alias) + --> tests/compile-fail/precompile/discriminant/too-many-arguments.rs:25:48 | 25 | fn discriminant(address: H160, other: u32) -> Option { - | ^^ + | ^^^^^^ diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-1.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-1.stderr index 8d999769..af3e4e16 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-1.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-1.stderr @@ -1,5 +1,5 @@ -error: All discriminants must have the same type (found u64 before) - --> tests/compile-fail/precompile/discriminant/type-mismatch-1.rs:30:24 +error: The discriminant function must only take code address (H160) and remaining gas (u64) as parameters. + --> tests/compile-fail/precompile/discriminant/type-mismatch-1.rs:25:2 | -30 | fn foo(_discriminant: u32, test: &mut impl PrecompileHandle) -> EvmResult { - | ^^^ +25 | fn discriminant(address: H160) -> Option { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-2.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-2.stderr index d5ed6750..4c411005 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-2.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/discriminant/type-mismatch-2.stderr @@ -1,5 +1,5 @@ -error: All discriminants must have the same type (found u32 before) - --> tests/compile-fail/precompile/discriminant/type-mismatch-2.rs:30:43 +error: The discriminant function must only take code address (H160) and remaining gas (u64) as parameters. + --> tests/compile-fail/precompile/discriminant/type-mismatch-2.rs:30:2 | 30 | fn discriminant(address: H160) -> Option { - | ^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/handle/missing.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/handle/missing.stderr index 2760a719..b79a6222 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/handle/missing.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/handle/missing.stderr @@ -2,4 +2,4 @@ error: Precompile methods must have at least 1 parameter (the PrecompileHandle) --> tests/compile-fail/precompile/handle/missing.rs:24:2 | 24 | fn foo() { - | ^^ + | ^^^^^^^^ diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/handle/set-missing.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/handle/set-missing.stderr index 8f0a10d8..3af4a41c 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/handle/set-missing.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/handle/set-missing.stderr @@ -2,4 +2,4 @@ error: PrecompileSet methods must have at least 2 parameters (the precompile ins --> tests/compile-fail/precompile/handle/set-missing.rs:25:2 | 25 | fn foo(_: u32) { - | ^^ + | ^^^^^^^^^^^^^^ diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/no-parameter.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/no-parameter.stderr index 406806c5..ef264dd9 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/no-parameter.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/no-parameter.stderr @@ -2,4 +2,4 @@ error: Precompile methods must have at least 1 parameter (the PrecompileHandle) --> tests/compile-fail/precompile/pre-check/no-parameter.rs:24:2 | 24 | fn pre_check() { - | ^^ + | ^^^^^^^^^^^^^^ diff --git a/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/too-many-parameters.stderr b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/too-many-parameters.stderr index 474b5c9d..0d4af4e8 100644 --- a/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/too-many-parameters.stderr +++ b/precompiles/utils/macro/tests/compile-fail/precompile/pre-check/too-many-parameters.stderr @@ -2,4 +2,4 @@ error: Precompile pre_check method must have exactly 1 parameter (the Precompile --> tests/compile-fail/precompile/pre-check/too-many-parameters.rs:24:2 | 24 | fn pre_check(_: &mut impl PrecompileHandle, _: u32) { - | ^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/precompiles/utils/macro/tests/expand/precompile.expanded.rs b/precompiles/utils/macro/tests/expand/precompile.expanded.rs new file mode 100644 index 00000000..b0544e0c --- /dev/null +++ b/precompiles/utils/macro/tests/expand/precompile.expanded.rs @@ -0,0 +1,393 @@ +use { + core::marker::PhantomData, precompile_utils::{EvmResult, prelude::*}, + sp_core::{H160, U256}, + frame_support::pallet_prelude::{Get, ConstU32}, +}; +struct BatchPrecompile(PhantomData); +type GetCallDataLimit = ConstU32<42>; +type GetArrayLimit = ConstU32<42>; +impl BatchPrecompile +where + Runtime: Get, +{ + fn pre_check(handle: &mut impl PrecompileHandle) -> EvmResult { + { + ::core::panicking::panic_fmt( + format_args!("not yet implemented: {0}", format_args!("pre_check")), + ); + } + } + fn batch_some( + handle: &mut impl PrecompileHandle, + to: BoundedVec, + value: BoundedVec, + call_data: BoundedVec, GetArrayLimit>, + gas_limit: BoundedVec, + ) -> EvmResult { + { + ::core::panicking::panic_fmt( + format_args!("not yet implemented: {0}", format_args!("batch_some")), + ); + } + } + fn batch_some_until_failure( + handle: &mut impl PrecompileHandle, + to: BoundedVec, + value: BoundedVec, + call_data: BoundedVec, GetArrayLimit>, + gas_limit: BoundedVec, + ) -> EvmResult { + { + ::core::panicking::panic_fmt( + format_args!( + "not yet implemented: {0}", format_args!("batch_some_until_failure"), + ), + ); + } + } + fn batch_all( + handle: &mut impl PrecompileHandle, + to: BoundedVec, + value: BoundedVec, + call_data: BoundedVec, GetArrayLimit>, + gas_limit: BoundedVec, + ) -> EvmResult { + { + ::core::panicking::panic_fmt( + format_args!("not yet implemented: {0}", format_args!("batch_all")), + ); + } + } + fn fallback(handle: &mut impl PrecompileHandle) -> EvmResult { + { + ::core::panicking::panic_fmt( + format_args!("not yet implemented: {0}", format_args!("fallback")), + ); + } + } +} +#[allow(non_camel_case_types)] +pub enum BatchPrecompileCall +where + Runtime: Get, +{ + batch_all { + to: BoundedVec, + value: BoundedVec, + call_data: BoundedVec, GetArrayLimit>, + gas_limit: BoundedVec, + }, + batch_some { + to: BoundedVec, + value: BoundedVec, + call_data: BoundedVec, GetArrayLimit>, + gas_limit: BoundedVec, + }, + batch_some_until_failure { + to: BoundedVec, + value: BoundedVec, + call_data: BoundedVec, GetArrayLimit>, + gas_limit: BoundedVec, + }, + fallback {}, + #[doc(hidden)] + __phantom(::core::marker::PhantomData<(Runtime)>, ::core::convert::Infallible), +} +impl BatchPrecompileCall +where + Runtime: Get, +{ + pub fn parse_call_data( + handle: &mut impl PrecompileHandle, + ) -> ::precompile_utils::EvmResult { + use ::precompile_utils::solidity::revert::RevertReason; + let input = handle.input(); + let selector = input + .get(0..4) + .map(|s| { + let mut buffer = [0u8; 4]; + buffer.copy_from_slice(s); + u32::from_be_bytes(buffer) + }); + match selector { + Some(2044677020u32) => Self::_parse_batch_some(handle), + Some(2531431096u32) => Self::_parse_batch_all(handle), + Some(3473183175u32) => Self::_parse_batch_some_until_failure(handle), + _ => Self::_parse_fallback(handle), + } + } + fn _parse_batch_all( + handle: &mut impl PrecompileHandle, + ) -> ::precompile_utils::EvmResult { + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; + handle.check_function_modifier(FunctionModifier::NonPayable)?; + let mut input = handle.read_after_selector()?; + input.expect_arguments(4usize)?; + Ok(Self::batch_all { + to: input.read().in_field("to")?, + value: input.read().in_field("value")?, + call_data: input.read().in_field("callData")?, + gas_limit: input.read().in_field("gasLimit")?, + }) + } + fn _parse_batch_some( + handle: &mut impl PrecompileHandle, + ) -> ::precompile_utils::EvmResult { + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; + handle.check_function_modifier(FunctionModifier::NonPayable)?; + let mut input = handle.read_after_selector()?; + input.expect_arguments(4usize)?; + Ok(Self::batch_some { + to: input.read().in_field("to")?, + value: input.read().in_field("value")?, + call_data: input.read().in_field("callData")?, + gas_limit: input.read().in_field("gasLimit")?, + }) + } + fn _parse_batch_some_until_failure( + handle: &mut impl PrecompileHandle, + ) -> ::precompile_utils::EvmResult { + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; + handle.check_function_modifier(FunctionModifier::NonPayable)?; + let mut input = handle.read_after_selector()?; + input.expect_arguments(4usize)?; + Ok(Self::batch_some_until_failure { + to: input.read().in_field("to")?, + value: input.read().in_field("value")?, + call_data: input.read().in_field("callData")?, + gas_limit: input.read().in_field("gasLimit")?, + }) + } + fn _parse_fallback( + handle: &mut impl PrecompileHandle, + ) -> ::precompile_utils::EvmResult { + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; + handle.check_function_modifier(FunctionModifier::NonPayable)?; + Ok(Self::fallback {}) + } + pub fn execute( + self, + handle: &mut impl PrecompileHandle, + ) -> ::precompile_utils::EvmResult<::fp_evm::PrecompileOutput> { + use ::precompile_utils::solidity::codec::Writer; + use ::fp_evm::{PrecompileOutput, ExitSucceed}; + let output = match self { + Self::batch_all { to, value, call_data, gas_limit } => { + let output = >::batch_all(handle, to, value, call_data, gas_limit); + ::precompile_utils::solidity::encode_return_value(output?) + } + Self::batch_some { to, value, call_data, gas_limit } => { + let output = >::batch_some(handle, to, value, call_data, gas_limit); + ::precompile_utils::solidity::encode_return_value(output?) + } + Self::batch_some_until_failure { to, value, call_data, gas_limit } => { + let output = >::batch_some_until_failure(handle, to, value, call_data, gas_limit); + ::precompile_utils::solidity::encode_return_value(output?) + } + Self::fallback {} => { + let output = >::fallback(handle); + ::precompile_utils::solidity::encode_return_value(output?) + } + Self::__phantom(_, _) => { + ::core::panicking::panic_fmt( + format_args!("__phantom variant should not be used"), + ); + } + }; + Ok(PrecompileOutput { + exit_status: ExitSucceed::Returned, + output, + }) + } + pub fn supports_selector(selector: u32) -> bool { + match selector { + 2044677020u32 => true, + 2531431096u32 => true, + 3473183175u32 => true, + _ => false, + } + } + pub fn selectors() -> &'static [u32] { + &[2044677020u32, 2531431096u32, 3473183175u32] + } + pub fn batch_all_selectors() -> &'static [u32] { + &[2531431096u32] + } + pub fn batch_some_selectors() -> &'static [u32] { + &[2044677020u32] + } + pub fn batch_some_until_failure_selectors() -> &'static [u32] { + &[3473183175u32] + } + pub fn fallback_selectors() -> &'static [u32] { + &[] + } + pub fn encode(self) -> ::sp_std::vec::Vec { + use ::precompile_utils::solidity::codec::Writer; + match self { + Self::batch_all { to, value, call_data, gas_limit } => { + Writer::new_with_selector(2531431096u32) + .write(to) + .write(value) + .write(call_data) + .write(gas_limit) + .build() + } + Self::batch_some { to, value, call_data, gas_limit } => { + Writer::new_with_selector(2044677020u32) + .write(to) + .write(value) + .write(call_data) + .write(gas_limit) + .build() + } + Self::batch_some_until_failure { to, value, call_data, gas_limit } => { + Writer::new_with_selector(3473183175u32) + .write(to) + .write(value) + .write(call_data) + .write(gas_limit) + .build() + } + Self::fallback {} => Default::default(), + Self::__phantom(_, _) => { + ::core::panicking::panic_fmt( + format_args!("__phantom variant should not be used"), + ); + } + } + } +} +impl From> for ::sp_std::vec::Vec +where + Runtime: Get, +{ + fn from(a: BatchPrecompileCall) -> ::sp_std::vec::Vec { + a.encode() + } +} +impl ::fp_evm::Precompile for BatchPrecompile +where + Runtime: Get, +{ + fn execute( + handle: &mut impl PrecompileHandle, + ) -> ::precompile_utils::EvmResult<::fp_evm::PrecompileOutput> { + let _: () = >::pre_check(handle)?; + >::parse_call_data(handle)?.execute(handle) + } +} +#[allow(non_snake_case)] +pub(crate) fn __BatchPrecompile_test_solidity_signatures_inner() { + use ::precompile_utils::solidity::Codec; + match ( + &"(address[],uint256[],bytes[],uint64[])", + &<( + BoundedVec, + BoundedVec, + BoundedVec, GetArrayLimit>, + BoundedVec, + ) as Codec>::signature(), + ) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::Some( + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "batch_all", + ), + ), + ); + } + } + }; + match ( + &"(address[],uint256[],bytes[],uint64[])", + &<( + BoundedVec, + BoundedVec, + BoundedVec, GetArrayLimit>, + BoundedVec, + ) as Codec>::signature(), + ) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::Some( + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "batch_some", + ), + ), + ); + } + } + }; + match ( + &"(address[],uint256[],bytes[],uint64[])", + &<( + BoundedVec, + BoundedVec, + BoundedVec, GetArrayLimit>, + BoundedVec, + ) as Codec>::signature(), + ) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::Some( + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "batch_some_until_failure", + ), + ), + ); + } + } + }; + match (&"()", &<() as Codec>::signature()) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::Some( + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "fallback", + ), + ), + ); + } + } + }; +} diff --git a/precompiles/utils/macro/tests/expand/precompile_name.expanded.rs b/precompiles/utils/macro/tests/expand/precompile_name.expanded.rs new file mode 100644 index 00000000..1d04b9ed --- /dev/null +++ b/precompiles/utils/macro/tests/expand/precompile_name.expanded.rs @@ -0,0 +1,37 @@ +struct PrecompileAt(PhantomData<(T, U, V)>); +struct AddressU64; +struct FooPrecompile(PhantomData); +struct BarPrecompile(PhantomData<(R, S)>); +struct MockCheck; +type Precompiles = ( + PrecompileAt, FooPrecompile>, + PrecompileAt, BarPrecompile, (MockCheck, MockCheck)>, +); +#[repr(u64)] +pub enum PrecompileName { + FooPrecompile = 1u64, + BarPrecompile = 2u64, +} +#[automatically_derived] +impl ::core::fmt::Debug for PrecompileName { + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::write_str( + f, + match self { + PrecompileName::FooPrecompile => "FooPrecompile", + PrecompileName::BarPrecompile => "BarPrecompile", + }, + ) + } +} +impl PrecompileName { + pub fn from_address(address: sp_core::H160) -> Option { + let _u64 = address.to_low_u64_be(); + if address == sp_core::H160::from_low_u64_be(_u64) { + use num_enum::TryFromPrimitive; + Self::try_from_primitive(_u64).ok() + } else { + None + } + } +} diff --git a/precompiles/utils/macro/tests/expand/precompileset.expanded.rs b/precompiles/utils/macro/tests/expand/precompileset.expanded.rs new file mode 100644 index 00000000..c318930b --- /dev/null +++ b/precompiles/utils/macro/tests/expand/precompileset.expanded.rs @@ -0,0 +1,9 @@ +use { + core::marker::PhantomData, + precompile_utils::{EvmResult, prelude::*, testing::PrecompileTesterExt}, + sp_core::H160, +}; +struct PrecompileSet(PhantomData); +type Discriminant = u32; +type GetAssetsStringLimit = R; +type MockRuntime = ConstU32<42>; diff --git a/precompiles/utils/macro/tests/expand/returns_tuple.expanded.rs b/precompiles/utils/macro/tests/expand/returns_tuple.expanded.rs new file mode 100644 index 00000000..6e0c2b91 --- /dev/null +++ b/precompiles/utils/macro/tests/expand/returns_tuple.expanded.rs @@ -0,0 +1,130 @@ +use { + precompile_utils::{EvmResult, prelude::*}, + sp_core::{H160, U256}, +}; +struct ExamplePrecompile; +impl ExamplePrecompile { + fn example( + handle: &mut impl PrecompileHandle, + ) -> EvmResult<(Address, U256, UnboundedBytes)> { + { + ::core::panicking::panic_fmt( + format_args!("not yet implemented: {0}", format_args!("example")), + ); + } + } +} +#[allow(non_camel_case_types)] +pub enum ExamplePrecompileCall { + example {}, + #[doc(hidden)] + __phantom(::core::marker::PhantomData<()>, ::core::convert::Infallible), +} +impl ExamplePrecompileCall { + pub fn parse_call_data( + handle: &mut impl PrecompileHandle, + ) -> ::precompile_utils::EvmResult { + use ::precompile_utils::solidity::revert::RevertReason; + let input = handle.input(); + let selector = input + .get(0..4) + .map(|s| { + let mut buffer = [0u8; 4]; + buffer.copy_from_slice(s); + u32::from_be_bytes(buffer) + }); + match selector { + Some(1412775727u32) => Self::_parse_example(handle), + Some(_) => Err(RevertReason::UnknownSelector.into()), + None => Err(RevertReason::read_out_of_bounds("selector").into()), + } + } + fn _parse_example( + handle: &mut impl PrecompileHandle, + ) -> ::precompile_utils::EvmResult { + use ::precompile_utils::solidity::revert::InjectBacktrace; + use ::precompile_utils::solidity::modifier::FunctionModifier; + use ::precompile_utils::evm::handle::PrecompileHandleExt; + handle.check_function_modifier(FunctionModifier::NonPayable)?; + Ok(Self::example {}) + } + pub fn execute( + self, + handle: &mut impl PrecompileHandle, + ) -> ::precompile_utils::EvmResult<::fp_evm::PrecompileOutput> { + use ::precompile_utils::solidity::codec::Writer; + use ::fp_evm::{PrecompileOutput, ExitSucceed}; + let output = match self { + Self::example {} => { + let output = ::example(handle); + ::precompile_utils::solidity::encode_return_value(output?) + } + Self::__phantom(_, _) => { + ::core::panicking::panic_fmt( + format_args!("__phantom variant should not be used"), + ); + } + }; + Ok(PrecompileOutput { + exit_status: ExitSucceed::Returned, + output, + }) + } + pub fn supports_selector(selector: u32) -> bool { + match selector { + 1412775727u32 => true, + _ => false, + } + } + pub fn selectors() -> &'static [u32] { + &[1412775727u32] + } + pub fn example_selectors() -> &'static [u32] { + &[1412775727u32] + } + pub fn encode(self) -> ::sp_std::vec::Vec { + use ::precompile_utils::solidity::codec::Writer; + match self { + Self::example {} => Writer::new_with_selector(1412775727u32).build(), + Self::__phantom(_, _) => { + ::core::panicking::panic_fmt( + format_args!("__phantom variant should not be used"), + ); + } + } + } +} +impl From for ::sp_std::vec::Vec { + fn from(a: ExamplePrecompileCall) -> ::sp_std::vec::Vec { + a.encode() + } +} +impl ::fp_evm::Precompile for ExamplePrecompile { + fn execute( + handle: &mut impl PrecompileHandle, + ) -> ::precompile_utils::EvmResult<::fp_evm::PrecompileOutput> { + ::parse_call_data(handle)?.execute(handle) + } +} +#[allow(non_snake_case)] +pub(crate) fn __ExamplePrecompile_test_solidity_signatures_inner() { + use ::precompile_utils::solidity::Codec; + match (&"()", &<() as Codec>::signature()) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::Some( + format_args!( + "{0} function signature doesn\'t match (left: attribute, right: computed from Rust types)", + "example", + ), + ), + ); + } + } + }; +} diff --git a/precompiles/utils/macro/tests/tests.rs b/precompiles/utils/macro/tests/tests.rs index 921656f5..f531a4db 100644 --- a/precompiles/utils/macro/tests/tests.rs +++ b/precompiles/utils/macro/tests/tests.rs @@ -49,5 +49,5 @@ fn expand() { // CI checks the expension don't change // macrotest::expand("tests/expand/**/*.rs"); - macrotest::expand_without_refresh("tests/expand/**/*.rs"); + macrotest::expand("tests/expand/**/*.rs"); } From c66a8f3c26808559344a3e226fb73c6099f2a630 Mon Sep 17 00:00:00 2001 From: GabrielMartinezRodriguez Date: Wed, 15 Nov 2023 09:54:06 +0100 Subject: [PATCH 22/37] fix: expanded --- Cargo.lock | 48 +++++++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8c461067..5cbdff7e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -905,10 +905,11 @@ checksum = "fd6c0e7b807d60291f42f33f58480c0bfafe28ed08286446f45e463728cf9c1c" [[package]] name = "cc" -version = "1.0.84" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f8e7c90afad890484a21653d08b6e209ae34770fb5ee298f9c699fcc1e5c856" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ + "jobserver", "libc", ] @@ -2446,9 +2447,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f69037fe1b785e84986b4f2cbcf647381876a00671d25ceef715d7812dd7e1dd" +checksum = "53a56f0780318174bad1c127063fd0c5fdfb35398e3cd79ffaab931a6c79df80" [[package]] name = "file-per-thread-logger" @@ -2919,7 +2920,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eeb4ed9e12f43b7fa0baae3f9cdda28352770132ef2e09a23760c29cae8bd47" dependencies = [ - "rustix 0.38.21", + "rustix 0.38.24", "windows-sys 0.48.0", ] @@ -3405,9 +3406,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f95b9abcae896730d42b78e09c155ed4ddf82c07b4de772c64aee5b2d8b7c150" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -3727,7 +3728,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi 0.3.3", - "rustix 0.38.21", + "rustix 0.38.24", "windows-sys 0.48.0", ] @@ -3755,6 +3756,15 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +[[package]] +name = "jobserver" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" version = "0.3.65" @@ -4686,7 +4696,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.38.21", + "rustix 0.38.24", ] [[package]] @@ -7433,9 +7443,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.21" +version = "0.38.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" +checksum = "9ad981d6c340a49cdc40a1028d9c6084ec7e9fa33fcb839cab656a267071e234" dependencies = [ "bitflags 2.4.1", "errno", @@ -10629,15 +10639,15 @@ dependencies = [ "cfg-if", "fastrand 2.0.1", "redox_syscall 0.4.1", - "rustix 0.38.21", + "rustix 0.38.24", "windows-sys 0.48.0", ] [[package]] name = "termcolor" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" +checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" dependencies = [ "winapi-util", ] @@ -12003,7 +12013,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.21", + "rustix 0.38.24", ] [[package]] @@ -12343,18 +12353,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.25" +version = "0.7.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd369a67c0edfef15010f980c3cbe45d7f651deac2cd67ce097cd801de16557" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.25" +version = "0.7.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f140bda219a26ccc0cdb03dba58af72590c53b22642577d88a927bc5c87d6b" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" dependencies = [ "proc-macro2", "quote", From cd8083b88c7b21d91b390a647738773442fd919b Mon Sep 17 00:00:00 2001 From: GabrielMartinezRodriguez Date: Wed, 15 Nov 2023 12:04:07 +0100 Subject: [PATCH 23/37] chore --- docker/test/optimized.Dockerfile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/docker/test/optimized.Dockerfile b/docker/test/optimized.Dockerfile index fa0cd67a..da5a18f8 100644 --- a/docker/test/optimized.Dockerfile +++ b/docker/test/optimized.Dockerfile @@ -1,7 +1,17 @@ -FROM ghcr.io/stabilityprotocol/stability-test:latest +FROM rustlang/rust:nightly WORKDIR /stability +# Upcd dates core parts +RUN apt-get update -y && \ + apt-get install -y cmake pkg-config libssl-dev git gcc build-essential clang libclang-dev protobuf-compiler + +# Install rust wasm. Needed for substrate wasm engine +RUN rustup target add wasm32-unknown-unknown + +# Install cargo expand. Needed for testing +RUN cargo install cargo-expand + # Copy source code COPY node ./node COPY runtime ./runtime @@ -14,5 +24,3 @@ COPY stability-rpc ./stability-rpc COPY Cargo.lock Cargo.toml rust-toolchain.toml ./ RUN cargo build --release --tests - -CMD [ "cargo", "test", "--release", "--verbose" ] From 7ea3f98f8707c377773e26b994f6b8c7286f61cf Mon Sep 17 00:00:00 2001 From: GabrielMartinezRodriguez Date: Wed, 15 Nov 2023 12:28:39 +0100 Subject: [PATCH 24/37] chore: remove optimized test image --- .github/workflows/build-test.yml | 37 -------------------------------- .github/workflows/test.yml | 2 +- docker/test/Dockerfile | 2 ++ docker/test/optimized.Dockerfile | 26 ---------------------- 4 files changed, 3 insertions(+), 64 deletions(-) delete mode 100644 .github/workflows/build-test.yml delete mode 100644 docker/test/optimized.Dockerfile diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml deleted file mode 100644 index 29dedbc6..00000000 --- a/.github/workflows/build-test.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Build Test Image - -on: - workflow_dispatch: - push: - branches: ["main"] - -env: - CARGO_TERM_COLOR: always - REGISTRY: ghcr.io - IMAGE_NAME: stability-test -jobs: - test: - runs-on: self-hosted - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - registry: ${{ env.REGISTRY }} - username: $ - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build docker image for testing - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - with: - context: . - file: ./docker/test/Dockerfile - push: true - cache-from: type=gha - cache-to: type=gha,mode=max - tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest, ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{github.sha}} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e1fa705d..ee3c04f6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,7 +32,7 @@ jobs: uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: context: . - file: ./docker/test/optimized.Dockerfile + file: ./docker/test/Dockerfile load: true cache-from: type=gha cache-to: type=gha,mode=max diff --git a/docker/test/Dockerfile b/docker/test/Dockerfile index da5a18f8..a4ae54b9 100644 --- a/docker/test/Dockerfile +++ b/docker/test/Dockerfile @@ -24,3 +24,5 @@ COPY stability-rpc ./stability-rpc COPY Cargo.lock Cargo.toml rust-toolchain.toml ./ RUN cargo build --release --tests + +CMD [ "cargo", "test", "--release", "--verbose" ] diff --git a/docker/test/optimized.Dockerfile b/docker/test/optimized.Dockerfile deleted file mode 100644 index da5a18f8..00000000 --- a/docker/test/optimized.Dockerfile +++ /dev/null @@ -1,26 +0,0 @@ -FROM rustlang/rust:nightly - -WORKDIR /stability - -# Upcd dates core parts -RUN apt-get update -y && \ - apt-get install -y cmake pkg-config libssl-dev git gcc build-essential clang libclang-dev protobuf-compiler - -# Install rust wasm. Needed for substrate wasm engine -RUN rustup target add wasm32-unknown-unknown - -# Install cargo expand. Needed for testing -RUN cargo install cargo-expand - -# Copy source code -COPY node ./node -COPY runtime ./runtime -COPY precompiles ./precompiles -COPY pallets ./pallets -COPY primitives ./primitives -COPY test-utils ./test-utils -COPY client ./client -COPY stability-rpc ./stability-rpc -COPY Cargo.lock Cargo.toml rust-toolchain.toml ./ - -RUN cargo build --release --tests From 28c6e702c44803b0a7cf81d091886da9bb1b3fe7 Mon Sep 17 00:00:00 2001 From: Carlos Lostao Date: Wed, 15 Nov 2023 10:16:38 +0100 Subject: [PATCH 25/37] update: merge conflicts --- node/src/chain_spec/mod.rs | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/node/src/chain_spec/mod.rs b/node/src/chain_spec/mod.rs index 6d6385b8..d8142ad7 100644 --- a/node/src/chain_spec/mod.rs +++ b/node/src/chain_spec/mod.rs @@ -1,6 +1,6 @@ use serde::{Deserialize, Serialize}; -use sp_core::{bytes::from_hex, ecdsa, H160, H256, U256}; use sp_consensus_grandpa::AuthorityId as GrandpaId; +use sp_core::{bytes::from_hex, ecdsa, H160, H256, U256}; use stability_runtime::{AccountId, GenesisConfig, Precompiles, ValidatorFeeSelectorConfig}; use std::{collections::BTreeMap, str::FromStr, vec}; // Substrate @@ -146,19 +146,17 @@ pub fn base_genesis( accounts: { let mut map = BTreeMap::new(); let revert_bytecode = vec![0x60, 0x00, 0x60, 0x00, 0xFD]; - Precompiles::used_addresses() - .into_iter() - .for_each(|addr| { - map.insert( - H160(addr.0), - fp_evm::GenesisAccount { - nonce: Default::default(), - balance: Default::default(), - storage: Default::default(), - code: revert_bytecode.clone(), - }, - ); - }); + Precompiles::used_addresses().into_iter().for_each(|addr| { + map.insert( + H160(addr.0), + fp_evm::GenesisAccount { + nonce: Default::default(), + balance: Default::default(), + storage: Default::default(), + code: revert_bytecode.clone(), + }, + ); + }); map.insert(initial_default_token, fp_evm::GenesisAccount { nonce: Default::default(), balance: Default::default(), From d58a4b03abcdf05719bb308656a9647f0e7e3af5 Mon Sep 17 00:00:00 2001 From: Carlos Lostao Date: Wed, 15 Nov 2023 11:59:38 +0100 Subject: [PATCH 26/37] fix: merge conflicts --- Cargo.lock | 396 ++++-- Cargo.toml | 24 +- node/Cargo.toml | 6 + node/src/client.rs | 19 +- node/src/rpc/eth.rs | 20 +- node/src/rpc/mod.rs | 12 + node/src/rpc/tracing.rs | 123 ++ node/src/service.rs | 40 +- runtime/Cargo.toml | 14 + runtime/src/lib.rs | 89 ++ vendor/client/evm-tracing/Cargo.toml | 22 + .../evm-tracing/src/formatters/blockscout.rs | 92 ++ .../evm-tracing/src/formatters/call_tracer.rs | 314 +++++ .../client/evm-tracing/src/formatters/mod.rs | 35 + .../client/evm-tracing/src/formatters/raw.rs | 37 + .../src/formatters/trace_filter.rs | 134 ++ vendor/client/evm-tracing/src/lib.rs | 21 + .../evm-tracing/src/listeners/call_list.rs | 1130 +++++++++++++++++ .../client/evm-tracing/src/listeners/mod.rs | 21 + .../client/evm-tracing/src/listeners/raw.rs | 339 +++++ vendor/client/evm-tracing/src/types/block.rs | 97 ++ vendor/client/evm-tracing/src/types/mod.rs | 113 ++ .../evm-tracing/src/types/serialization.rs | 113 ++ vendor/client/evm-tracing/src/types/single.rs | 102 ++ vendor/client/rpc/debug/Cargo.toml | 39 + vendor/client/rpc/debug/README.md | 94 ++ vendor/client/rpc/debug/src/lib.rs | 598 +++++++++ vendor/client/rpc/trace/Cargo.toml | 45 + vendor/client/rpc/trace/src/lib.rs | 926 ++++++++++++++ vendor/client/rpc/txpool/Cargo.toml | 32 + vendor/client/rpc/txpool/src/lib.rs | 189 +++ vendor/primitives/ext/Cargo.toml | 31 + vendor/primitives/ext/src/lib.rs | 82 ++ vendor/primitives/rpc/debug/Cargo.toml | 39 + vendor/primitives/rpc/debug/src/lib.rs | 66 + .../rpc/evm-tracing-events/Cargo.toml | 36 + .../rpc/evm-tracing-events/src/evm.rs | 257 ++++ .../rpc/evm-tracing-events/src/gasometer.rs | 114 ++ .../rpc/evm-tracing-events/src/lib.rs | 116 ++ .../rpc/evm-tracing-events/src/runtime.rs | 326 +++++ vendor/primitives/rpc/txpool/Cargo.toml | 30 + vendor/primitives/rpc/txpool/src/lib.rs | 54 + vendor/rpc-core/debug/Cargo.toml | 19 + vendor/rpc-core/debug/src/lib.rs | 48 + vendor/rpc-core/trace/Cargo.toml | 17 + vendor/rpc-core/trace/src/lib.rs | 50 + vendor/rpc-core/txpool/Cargo.toml | 17 + vendor/rpc-core/txpool/src/lib.rs | 34 + vendor/rpc-core/txpool/src/types/content.rs | 111 ++ vendor/rpc-core/txpool/src/types/inspect.rs | 63 + vendor/rpc-core/txpool/src/types/mod.rs | 38 + vendor/rpc-core/types/Cargo.toml | 13 + vendor/rpc-core/types/src/lib.rs | 48 + vendor/runtime/evm_tracer/Cargo.toml | 47 + vendor/runtime/evm_tracer/src/lib.rs | 117 ++ 55 files changed, 6908 insertions(+), 101 deletions(-) create mode 100644 node/src/rpc/tracing.rs create mode 100644 vendor/client/evm-tracing/Cargo.toml create mode 100644 vendor/client/evm-tracing/src/formatters/blockscout.rs create mode 100644 vendor/client/evm-tracing/src/formatters/call_tracer.rs create mode 100644 vendor/client/evm-tracing/src/formatters/mod.rs create mode 100644 vendor/client/evm-tracing/src/formatters/raw.rs create mode 100644 vendor/client/evm-tracing/src/formatters/trace_filter.rs create mode 100644 vendor/client/evm-tracing/src/lib.rs create mode 100644 vendor/client/evm-tracing/src/listeners/call_list.rs create mode 100644 vendor/client/evm-tracing/src/listeners/mod.rs create mode 100644 vendor/client/evm-tracing/src/listeners/raw.rs create mode 100644 vendor/client/evm-tracing/src/types/block.rs create mode 100644 vendor/client/evm-tracing/src/types/mod.rs create mode 100644 vendor/client/evm-tracing/src/types/serialization.rs create mode 100644 vendor/client/evm-tracing/src/types/single.rs create mode 100644 vendor/client/rpc/debug/Cargo.toml create mode 100644 vendor/client/rpc/debug/README.md create mode 100644 vendor/client/rpc/debug/src/lib.rs create mode 100644 vendor/client/rpc/trace/Cargo.toml create mode 100644 vendor/client/rpc/trace/src/lib.rs create mode 100644 vendor/client/rpc/txpool/Cargo.toml create mode 100644 vendor/client/rpc/txpool/src/lib.rs create mode 100644 vendor/primitives/ext/Cargo.toml create mode 100644 vendor/primitives/ext/src/lib.rs create mode 100644 vendor/primitives/rpc/debug/Cargo.toml create mode 100644 vendor/primitives/rpc/debug/src/lib.rs create mode 100644 vendor/primitives/rpc/evm-tracing-events/Cargo.toml create mode 100644 vendor/primitives/rpc/evm-tracing-events/src/evm.rs create mode 100644 vendor/primitives/rpc/evm-tracing-events/src/gasometer.rs create mode 100644 vendor/primitives/rpc/evm-tracing-events/src/lib.rs create mode 100644 vendor/primitives/rpc/evm-tracing-events/src/runtime.rs create mode 100644 vendor/primitives/rpc/txpool/Cargo.toml create mode 100644 vendor/primitives/rpc/txpool/src/lib.rs create mode 100644 vendor/rpc-core/debug/Cargo.toml create mode 100644 vendor/rpc-core/debug/src/lib.rs create mode 100644 vendor/rpc-core/trace/Cargo.toml create mode 100644 vendor/rpc-core/trace/src/lib.rs create mode 100644 vendor/rpc-core/txpool/Cargo.toml create mode 100644 vendor/rpc-core/txpool/src/lib.rs create mode 100644 vendor/rpc-core/txpool/src/types/content.rs create mode 100644 vendor/rpc-core/txpool/src/types/inspect.rs create mode 100644 vendor/rpc-core/txpool/src/types/mod.rs create mode 100644 vendor/rpc-core/types/Cargo.toml create mode 100644 vendor/rpc-core/types/src/lib.rs create mode 100644 vendor/runtime/evm_tracer/Cargo.toml create mode 100644 vendor/runtime/evm_tracer/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 5cbdff7e..971b56ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2193,13 +2193,27 @@ dependencies = [ "sha3 0.10.8", ] +[[package]] +name = "evm-tracing-events" +version = "0.1.0" +dependencies = [ + "environmental", + "ethereum", + "ethereum-types", + "evm", + "evm-gasometer", + "evm-runtime", + "parity-scale-codec", + "sp-runtime-interface", +] + [[package]] name = "exit-future" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures", + "futures 0.3.29", ] [[package]] @@ -2293,7 +2307,7 @@ dependencies = [ "fp-consensus", "fp-rpc", "fp-storage", - "futures", + "futures 0.3.29", "kvdb-rocksdb", "log", "parity-db", @@ -2321,12 +2335,12 @@ dependencies = [ "fc-storage", "fp-consensus", "fp-rpc", - "futures", + "futures 0.3.29", "futures-timer", "log", "parking_lot 0.12.1", "sc-client-api", - "sc-utils", + "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", "sp-api", "sp-blockchain", "sp-consensus", @@ -2351,7 +2365,7 @@ dependencies = [ "fp-evm", "fp-rpc", "fp-storage", - "futures", + "futures 0.3.29", "hex", "jsonrpsee", "libsecp256k1", @@ -2370,7 +2384,7 @@ dependencies = [ "sc-service", "sc-transaction-pool", "sc-transaction-pool-api", - "sc-utils", + "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", "serde", "sp-api", "sp-block-builder", @@ -2480,7 +2494,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36530797b9bf31cd4ff126dcfee8170f86b00cfdcea3269d73133cc0415945c3" dependencies = [ "either", - "futures", + "futures 0.3.29", "futures-timer", "log", "num-traits", @@ -2930,6 +2944,12 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" +[[package]] +name = "futures" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" + [[package]] name = "futures" version = "0.3.29" @@ -3051,6 +3071,7 @@ version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ + "futures 0.1.31", "futures-channel", "futures-core", "futures-io", @@ -3322,6 +3343,9 @@ name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] [[package]] name = "hex-literal" @@ -3571,7 +3595,7 @@ dependencies = [ "async-io", "core-foundation", "fnv", - "futures", + "futures 0.3.29", "if-addrs", "ipnet", "log", @@ -3991,7 +4015,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f210d259724eae82005b5c48078619b7745edb7b76de370b03f8ba59ea103097" dependencies = [ "bytes", - "futures", + "futures 0.3.29", "futures-timer", "getrandom 0.2.11", "instant", @@ -4050,7 +4074,7 @@ checksum = "3c1df63c0b582aa434fb09b2d86897fa2b419ffeccf934b36f87fcedc8e835c2" dependencies = [ "either", "fnv", - "futures", + "futures 0.3.29", "futures-timer", "instant", "libp2p-identity", @@ -4076,7 +4100,7 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "146ff7034daae62077c415c2376b8057368042df6ab95f5432ad5e88568b1554" dependencies = [ - "futures", + "futures 0.3.29", "libp2p-core", "log", "parking_lot 0.12.1", @@ -4092,7 +4116,7 @@ checksum = "5455f472243e63b9c497ff320ded0314254a9eb751799a39c283c6f20b793f3c" dependencies = [ "asynchronous-codec", "either", - "futures", + "futures 0.3.29", "futures-timer", "libp2p-core", "libp2p-identity", @@ -4135,7 +4159,7 @@ dependencies = [ "bytes", "either", "fnv", - "futures", + "futures 0.3.29", "futures-timer", "instant", "libp2p-core", @@ -4159,7 +4183,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19983e1f949f979a928f2c603de1cf180cc0dc23e4ac93a62651ccb18341460b" dependencies = [ "data-encoding", - "futures", + "futures 0.3.29", "if-watch", "libp2p-core", "libp2p-identity", @@ -4195,7 +4219,7 @@ checksum = "9c3673da89d29936bc6435bafc638e2f184180d554ce844db65915113f86ec5e" dependencies = [ "bytes", "curve25519-dalek 3.2.0", - "futures", + "futures 0.3.29", "libp2p-core", "libp2p-identity", "log", @@ -4217,7 +4241,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e57759c19c28a73ef1eb3585ca410cefb72c1a709fcf6de1612a378e4219202" dependencies = [ "either", - "futures", + "futures 0.3.29", "futures-timer", "instant", "libp2p-core", @@ -4234,7 +4258,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6b26abd81cd2398382a1edfe739b539775be8a90fa6914f39b2ab49571ec735" dependencies = [ "bytes", - "futures", + "futures 0.3.29", "futures-timer", "if-watch", "libp2p-core", @@ -4256,7 +4280,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ffdb374267d42dc5ed5bc53f6e601d4a64ac5964779c6e40bb9e4f14c1e30d5" dependencies = [ "async-trait", - "futures", + "futures 0.3.29", "instant", "libp2p-core", "libp2p-identity", @@ -4273,7 +4297,7 @@ checksum = "903b3d592d7694e56204d211f29d31bc004be99386644ba8731fc3e3ef27b296" dependencies = [ "either", "fnv", - "futures", + "futures 0.3.29", "futures-timer", "instant", "libp2p-core", @@ -4303,7 +4327,7 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d33698596d7722d85d3ab0c86c2c322254fce1241e91208e3679b4eb3026cf" dependencies = [ - "futures", + "futures 0.3.29", "futures-timer", "if-watch", "libc", @@ -4319,7 +4343,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff08d13d0dc66e5e9ba6279c1de417b84fa0d0adc3b03e5732928c180ec02781" dependencies = [ - "futures", + "futures 0.3.29", "futures-rustls", "libp2p-core", "libp2p-identity", @@ -4338,7 +4362,7 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77dff9d32353a5887adb86c8afc1de1a94d9e8c3bc6df8b2201d7cdf5c848f43" dependencies = [ - "futures", + "futures 0.3.29", "js-sys", "libp2p-core", "parity-send-wrapper", @@ -4355,7 +4379,7 @@ dependencies = [ "async-trait", "asynchronous-codec", "bytes", - "futures", + "futures 0.3.29", "futures-timer", "hex", "if-watch", @@ -4384,7 +4408,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "111273f7b3d3510524c752e8b7a5314b7f7a1fee7e68161c01a7d72cbb06db9f" dependencies = [ "either", - "futures", + "futures 0.3.29", "futures-rustls", "libp2p-core", "log", @@ -4402,7 +4426,7 @@ version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd21d950662700a385d4c6d68e2f5f54d778e97068cdd718522222ef513bda" dependencies = [ - "futures", + "futures 0.3.29", "libp2p-core", "log", "thiserror", @@ -4821,6 +4845,181 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "moonbeam-client-evm-tracing" +version = "0.1.0" +dependencies = [ + "ethereum-types", + "evm-tracing-events", + "hex", + "moonbeam-rpc-primitives-debug", + "parity-scale-codec", + "serde", + "serde_json", + "sp-std", +] + +[[package]] +name = "moonbeam-evm-tracer" +version = "0.1.0" +dependencies = [ + "ethereum-types", + "evm", + "evm-gasometer", + "evm-runtime", + "evm-tracing-events", + "fp-evm", + "moonbeam-primitives-ext", + "pallet-evm", + "parity-scale-codec", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "moonbeam-primitives-ext" +version = "0.1.0" +dependencies = [ + "ethereum-types", + "evm-tracing-events", + "parity-scale-codec", + "sp-externalities", + "sp-runtime-interface", + "sp-std", +] + +[[package]] +name = "moonbeam-rpc-core-debug" +version = "0.1.0" +dependencies = [ + "ethereum-types", + "futures 0.3.29", + "jsonrpsee", + "moonbeam-client-evm-tracing", + "moonbeam-rpc-core-types", + "serde", + "serde_json", + "sp-core", +] + +[[package]] +name = "moonbeam-rpc-core-trace" +version = "0.6.0" +dependencies = [ + "ethereum-types", + "futures 0.3.29", + "jsonrpsee", + "moonbeam-client-evm-tracing", + "moonbeam-rpc-core-types", + "serde", + "serde_json", +] + +[[package]] +name = "moonbeam-rpc-core-types" +version = "0.1.0" +dependencies = [ + "ethereum-types", + "serde", + "serde_json", +] + +[[package]] +name = "moonbeam-rpc-debug" +version = "0.1.0" +dependencies = [ + "ethereum", + "ethereum-types", + "fc-consensus", + "fc-db", + "fc-rpc", + "fc-storage", + "fp-rpc", + "futures 0.3.29", + "hex-literal 0.4.1", + "jsonrpsee", + "moonbeam-client-evm-tracing", + "moonbeam-rpc-core-debug", + "moonbeam-rpc-core-types", + "moonbeam-rpc-primitives-debug", + "sc-client-api", + "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36)", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-core", + "sp-io", + "sp-runtime", + "tokio", +] + +[[package]] +name = "moonbeam-rpc-primitives-debug" +version = "0.1.0" +dependencies = [ + "environmental", + "ethereum", + "ethereum-types", + "hex", + "parity-scale-codec", + "serde", + "sp-api", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "moonbeam-rpc-primitives-txpool" +version = "0.6.0" +dependencies = [ + "ethereum", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "moonbeam-rpc-trace" +version = "0.6.0" +dependencies = [ + "ethereum", + "ethereum-types", + "fc-consensus", + "fc-rpc", + "fc-rpc-core", + "fc-storage", + "fp-rpc", + "futures 0.3.29", + "jsonrpsee", + "log", + "moonbeam-client-evm-tracing", + "moonbeam-rpc-core-trace", + "moonbeam-rpc-core-types", + "moonbeam-rpc-primitives-debug", + "sc-client-api", + "sc-network", + "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36)", + "serde", + "sha3 0.9.1", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-io", + "sp-runtime", + "sp-std", + "sp-transaction-pool", + "substrate-prometheus-endpoint", + "tokio", + "tracing", +] + [[package]] name = "multiaddr" version = "0.17.1" @@ -4908,7 +5107,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8552ab875c1313b97b8d20cb857b9fd63e2d1d6a0a1b53ce9821e575405f27a" dependencies = [ "bytes", - "futures", + "futures 0.3.29", "log", "pin-project", "smallvec", @@ -5014,7 +5213,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" dependencies = [ "bytes", - "futures", + "futures 0.3.29", "log", "netlink-packet-core", "netlink-sys", @@ -5029,7 +5228,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" dependencies = [ "bytes", - "futures", + "futures 0.3.29", "libc", "log", "tokio", @@ -7315,7 +7514,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" dependencies = [ - "futures", + "futures 0.3.29", "log", "netlink-packet-route", "netlink-proto", @@ -7512,7 +7711,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04" dependencies = [ - "futures", + "futures 0.3.29", "pin-project", "static_assertions", ] @@ -7606,7 +7805,7 @@ dependencies = [ "chrono", "clap", "fdlimit", - "futures", + "futures 0.3.29", "libp2p-identity", "log", "names", @@ -7622,7 +7821,7 @@ dependencies = [ "sc-service", "sc-telemetry", "sc-tracing", - "sc-utils", + "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", "serde", "serde_json", "sp-blockchain", @@ -7643,13 +7842,13 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "fnv", - "futures", + "futures 0.3.29", "log", "parity-scale-codec", "parking_lot 0.12.1", "sc-executor", "sc-transaction-pool-api", - "sc-utils", + "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", "sp-api", "sp-blockchain", "sp-consensus", @@ -7696,14 +7895,14 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", - "futures", + "futures 0.3.29", "futures-timer", "libp2p-identity", "log", "mockall", "parking_lot 0.12.1", "sc-client-api", - "sc-utils", + "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", "serde", "sp-api", "sp-blockchain", @@ -7721,7 +7920,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", - "futures", + "futures 0.3.29", "log", "parity-scale-codec", "sc-block-builder", @@ -7751,7 +7950,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "async-trait", "fork-tree", - "futures", + "futures 0.3.29", "log", "num-bigint", "num-rational", @@ -7804,7 +8003,7 @@ dependencies = [ "dyn-clone", "finality-grandpa", "fork-tree", - "futures", + "futures 0.3.29", "futures-timer", "log", "parity-scale-codec", @@ -7818,7 +8017,7 @@ dependencies = [ "sc-network-common", "sc-network-gossip", "sc-telemetry", - "sc-utils", + "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", "serde_json", "sp-api", "sp-application-crypto", @@ -7840,7 +8039,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "assert_matches", "async-trait", - "futures", + "futures 0.3.29", "futures-timer", "jsonrpsee", "log", @@ -7874,7 +8073,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", - "futures", + "futures 0.3.29", "futures-timer", "log", "parity-scale-codec", @@ -7949,7 +8148,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "ansi_term", - "futures", + "futures 0.3.29", "futures-timer", "log", "sc-client-api", @@ -7985,7 +8184,7 @@ dependencies = [ "bytes", "either", "fnv", - "futures", + "futures 0.3.29", "futures-timer", "ip_network", "libp2p", @@ -8002,7 +8201,7 @@ dependencies = [ "sc-consensus", "sc-network-common", "sc-peerset", - "sc-utils", + "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", "serde", "serde_json", "smallvec", @@ -8025,7 +8224,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "async-channel", "cid", - "futures", + "futures 0.3.29", "libp2p-identity", "log", "prost", @@ -8048,14 +8247,14 @@ dependencies = [ "async-trait", "bitflags 1.3.2", "bytes", - "futures", + "futures 0.3.29", "futures-timer", "libp2p-identity", "parity-scale-codec", "prost-build", "sc-consensus", "sc-peerset", - "sc-utils", + "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", "serde", "smallvec", "sp-blockchain", @@ -8073,7 +8272,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "ahash 0.8.6", - "futures", + "futures 0.3.29", "futures-timer", "libp2p", "log", @@ -8093,7 +8292,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "array-bytes 4.2.0", "async-channel", - "futures", + "futures 0.3.29", "libp2p-identity", "log", "parity-scale-codec", @@ -8118,7 +8317,7 @@ dependencies = [ "async-channel", "async-trait", "fork-tree", - "futures", + "futures 0.3.29", "futures-timer", "libp2p", "log", @@ -8132,7 +8331,7 @@ dependencies = [ "sc-network", "sc-network-common", "sc-peerset", - "sc-utils", + "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", "smallvec", "sp-arithmetic", "sp-blockchain", @@ -8150,7 +8349,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "array-bytes 4.2.0", - "futures", + "futures 0.3.29", "libp2p", "log", "parity-scale-codec", @@ -8158,7 +8357,7 @@ dependencies = [ "sc-network", "sc-network-common", "sc-peerset", - "sc-utils", + "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", "sp-consensus", "sp-runtime", "substrate-prometheus-endpoint", @@ -8172,7 +8371,7 @@ dependencies = [ "array-bytes 4.2.0", "bytes", "fnv", - "futures", + "futures 0.3.29", "futures-timer", "hyper", "hyper-rustls", @@ -8186,7 +8385,7 @@ dependencies = [ "sc-network", "sc-network-common", "sc-peerset", - "sc-utils", + "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", "sp-api", "sp-core", "sp-offchain", @@ -8200,12 +8399,12 @@ name = "sc-peerset" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "futures", + "futures 0.3.29", "libp2p-identity", "log", "parking_lot 0.12.1", "partial_sort", - "sc-utils", + "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", "serde_json", "sp-arithmetic", "wasm-timer", @@ -8225,7 +8424,7 @@ name = "sc-rpc" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "futures", + "futures 0.3.29", "jsonrpsee", "log", "parity-scale-codec", @@ -8236,7 +8435,7 @@ dependencies = [ "sc-rpc-api", "sc-tracing", "sc-transaction-pool-api", - "sc-utils", + "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", "serde_json", "sp-api", "sp-blockchain", @@ -8291,7 +8490,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "array-bytes 4.2.0", - "futures", + "futures 0.3.29", "futures-util", "hex", "jsonrpsee", @@ -8319,7 +8518,7 @@ dependencies = [ "async-trait", "directories", "exit-future", - "futures", + "futures 0.3.29", "futures-timer", "jsonrpsee", "log", @@ -8351,7 +8550,7 @@ dependencies = [ "sc-tracing", "sc-transaction-pool", "sc-transaction-pool-api", - "sc-utils", + "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", "serde", "serde_json", "sp-api", @@ -8395,10 +8594,10 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "clap", "fs4", - "futures", + "futures 0.3.29", "log", "sc-client-db", - "sc-utils", + "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", "sp-core", "thiserror", "tokio", @@ -8409,7 +8608,7 @@ name = "sc-sysinfo" version = "6.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "futures", + "futures 0.3.29", "libc", "log", "rand 0.8.5", @@ -8429,13 +8628,13 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "chrono", - "futures", + "futures 0.3.29", "libp2p", "log", "parking_lot 0.12.1", "pin-project", "rand 0.8.5", - "sc-utils", + "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", "serde", "serde_json", "thiserror", @@ -8490,7 +8689,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", - "futures", + "futures 0.3.29", "futures-timer", "linked-hash-map", "log", @@ -8499,7 +8698,7 @@ dependencies = [ "parking_lot 0.12.1", "sc-client-api", "sc-transaction-pool-api", - "sc-utils", + "sc-utils 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43)", "serde", "sp-api", "sp-blockchain", @@ -8517,7 +8716,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", - "futures", + "futures 0.3.29", "log", "serde", "sp-blockchain", @@ -8525,13 +8724,26 @@ dependencies = [ "thiserror", ] +[[package]] +name = "sc-utils" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.36#cb4f2491b00af7d7817f3a54209c26b20faa1f51" +dependencies = [ + "futures 0.3.29", + "futures-timer", + "lazy_static", + "log", + "parking_lot 0.12.1", + "prometheus", +] + [[package]] name = "sc-utils" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-channel", - "futures", + "futures 0.3.29", "futures-timer", "lazy_static", "log", @@ -9052,7 +9264,7 @@ dependencies = [ "base64 0.13.1", "bytes", "flate2", - "futures", + "futures 0.3.29", "http", "httparse", "log", @@ -9138,7 +9350,7 @@ name = "sp-blockchain" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "futures", + "futures 0.3.29", "log", "lru 0.8.1", "parity-scale-codec", @@ -9157,7 +9369,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", - "futures", + "futures 0.3.29", "log", "sp-core", "sp-inherents", @@ -9266,7 +9478,7 @@ dependencies = [ "bs58", "dyn-clonable", "ed25519-zebra", - "futures", + "futures 0.3.29", "hash-db 0.16.0", "hash256-std-hasher", "impl-serde", @@ -9376,7 +9588,7 @@ dependencies = [ "bytes", "ed25519 1.5.3", "ed25519-dalek 1.0.1", - "futures", + "futures 0.3.29", "libsecp256k1", "log", "parity-scale-codec", @@ -9410,7 +9622,7 @@ name = "sp-keystore" version = "0.13.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "futures", + "futures 0.3.29", "parity-scale-codec", "parking_lot 0.12.1", "serde", @@ -9946,10 +10158,15 @@ dependencies = [ "frame-benchmarking-cli", "frame-system", "frame-system-rpc-runtime-api", - "futures", + "futures 0.3.29", "hex-literal 0.4.1", "jsonrpsee", "log", + "moonbeam-primitives-ext", + "moonbeam-rpc-debug", + "moonbeam-rpc-primitives-debug", + "moonbeam-rpc-primitives-txpool", + "moonbeam-rpc-trace", "pallet-transaction-payment", "pallet-transaction-payment-rpc", "pallet-transaction-payment-rpc-runtime-api", @@ -9999,6 +10216,7 @@ dependencies = [ "substrate-build-script-utils", "substrate-frame-rpc-system", "substrate-prometheus-endpoint", + "tokio", ] [[package]] @@ -10074,6 +10292,10 @@ dependencies = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "log", + "moonbeam-evm-tracer", + "moonbeam-primitives-ext", + "moonbeam-rpc-primitives-debug", + "moonbeam-rpc-primitives-txpool", "pallet-aura", "pallet-balances", "pallet-base-fee", @@ -10166,7 +10388,7 @@ version = "2.0.1" dependencies = [ "array-bytes 6.2.0", "async-trait", - "futures", + "futures 0.3.29", "parity-scale-codec", "sc-client-api", "sc-client-db", @@ -10194,7 +10416,7 @@ dependencies = [ "frame-support", "frame-system", "frame-system-rpc-runtime-api", - "futures", + "futures 0.3.29", "log", "memory-db", "pallet-babe", @@ -10246,7 +10468,7 @@ dependencies = [ name = "stability-test-runtime-client" version = "2.0.0" dependencies = [ - "futures", + "futures 0.3.29", "parity-scale-codec", "sc-block-builder", "sc-chain-spec", @@ -10308,7 +10530,7 @@ dependencies = [ "account", "bytes", "ethereum", - "futures", + "futures 0.3.29", "futures-timer", "hex", "log", @@ -10506,7 +10728,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "frame-system-rpc-runtime-api", - "futures", + "futures 0.3.29", "jsonrpsee", "log", "parity-scale-codec", @@ -11157,7 +11379,7 @@ checksum = "4712ee30d123ec7ae26d1e1b218395a16c87cdbaf4b3925d170d684af62ea5e8" dependencies = [ "async-trait", "base64 0.13.1", - "futures", + "futures 0.3.29", "log", "md-5", "rand 0.8.5", @@ -11510,7 +11732,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ - "futures", + "futures 0.3.29", "js-sys", "parking_lot 0.11.2", "pin-utils", @@ -12334,7 +12556,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5d9ba232399af1783a58d8eb26f6b5006fbefe2dc9ef36bd283324792d03ea5" dependencies = [ - "futures", + "futures 0.3.29", "log", "nohash-hasher", "parking_lot 0.12.1", diff --git a/Cargo.toml b/Cargo.toml index 42f5a43f..dd89032d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,7 +69,6 @@ bn = { package = "substrate-bn", version = "0.6", default-features = false } environmental = { version = "1.1.4", default-features = false } ethereum = { version = "0.14.0", default-features = false } ethereum-types = { version = "0.14.1", default-features = false } -evm = { git = "https://github.com/rust-blockchain/evm", rev = "b7b82c7e1fc57b7449d6dfa6826600de37cc1e65", default-features = false } jsonrpsee = "0.16.2" kvdb-rocksdb = "0.19.0" libsecp256k1 = { version = "0.7.1", default-features = false } @@ -122,6 +121,8 @@ sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/parityt sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } sc-proposer-metrics = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43"} sc-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +sc-finality-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sc-utils = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } # Substrate Primitive sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } @@ -258,4 +259,23 @@ ark-bls12-377 = { version = "0.4.0", default-features = false, features = ["curv ark-bw6-761 = { version = "0.4.0", default-features = false } ark-ec = { version = "0.4.0", default-features = false } ark-ff = { version = "0.4.0", default-features = false } -ark-std = { version = "0.4.0", default-features = false } \ No newline at end of file +ark-std = { version = "0.4.0", default-features = false } + +moonbeam-primitives-ext = { path = "vendor/primitives/ext", default-features = false } +moonbeam-evm-tracer = { path = "vendor/runtime/evm_tracer", default-features = false } +moonbeam-rpc-primitives-debug = { path = "vendor/primitives/rpc/debug", default-features = false } +evm-tracing-events = { path = "vendor/primitives/rpc/evm-tracing-events", default-features = false } +moonbeam-rpc-primitives-txpool = { path = "vendor/primitives/rpc/txpool", default-features = false } +evm = { git = "https://github.com/rust-blockchain/evm", rev = "b7b82c7e1fc57b7449d6dfa6826600de37cc1e65", default-features = false } +evm-gasometer = { git = "https://github.com/rust-blockchain/evm", rev = "b7b82c7e1fc57b7449d6dfa6826600de37cc1e65", default-features = false } +evm-runtime = { git = "https://github.com/rust-blockchain/evm", rev = "b7b82c7e1fc57b7449d6dfa6826600de37cc1e65", default-features = false } +moonbeam-rpc-debug = { path = "vendor/client/rpc/debug" } +moonbeam-rpc-trace = { path = "vendor/client/rpc/trace" } +moonbeam-rpc-txpool = { path = "vendor/client/rpc/txpool" } +moonbeam-client-evm-tracing = { path = "vendor/client/evm-tracing" } +moonbeam-rpc-core-debug = { path = "vendor/rpc-core/debug" } +moonbeam-rpc-core-trace = { path = "vendor/rpc-core/trace" } +moonbeam-rpc-core-types = { path = "vendor/rpc-core/types" } +moonbeam-rpc-core-txpool = { path = "vendor/rpc-core/txpool" } + +substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } diff --git a/node/Cargo.toml b/node/Cargo.toml index 9f6f3f9d..86bb0537 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -90,6 +90,12 @@ account = { workspace = true, features = ["default"] } stbl-core-primitives = { workspace = true, features = ["default"] } stability-rpc = { workspace = true } stbl-tools = { workspace = true } +moonbeam-primitives-ext = { workspace = true } +moonbeam-rpc-primitives-debug = { workspace = true } +moonbeam-rpc-primitives-txpool = { workspace = true } +moonbeam-rpc-debug = { workspace = true } +moonbeam-rpc-trace = { workspace = true } +tokio = { workspace = true } [build-dependencies] substrate-build-script-utils = { workspace = true } diff --git a/node/src/client.rs b/node/src/client.rs index 661f2561..1c6e544a 100644 --- a/node/src/client.rs +++ b/node/src/client.rs @@ -16,10 +16,13 @@ pub type Client = FullClient + sp_session::SessionKeys + sp_transaction_pool::runtime_api::TaggedTransactionQueue + + moonbeam_rpc_primitives_debug::DebugRuntimeApi + + moonbeam_rpc_primitives_txpool::TxPoolRuntimeApi where >::StateBackend: sp_api::StateBackend, { @@ -54,7 +59,9 @@ where + sp_block_builder::BlockBuilder + sp_offchain::OffchainWorkerApi + sp_session::SessionKeys - + sp_transaction_pool::runtime_api::TaggedTransactionQueue, + + sp_transaction_pool::runtime_api::TaggedTransactionQueue + + moonbeam_rpc_primitives_debug::DebugRuntimeApi + + moonbeam_rpc_primitives_txpool::TxPoolRuntimeApi, >::StateBackend: sp_api::StateBackend, { } @@ -69,6 +76,8 @@ pub trait RuntimeApiCollection: + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + stbl_primitives_fee_compatible_api::CompatibleFeeApi + stbl_primitives_zero_gas_transactions_api::ZeroGasTransactionApi + + moonbeam_rpc_primitives_debug::DebugRuntimeApi + + moonbeam_rpc_primitives_txpool::TxPoolRuntimeApi where >::StateBackend: sp_api::StateBackend, { @@ -83,7 +92,9 @@ where + frame_system_rpc_runtime_api::AccountNonceApi + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + stbl_primitives_fee_compatible_api::CompatibleFeeApi - + stbl_primitives_zero_gas_transactions_api::ZeroGasTransactionApi, + + stbl_primitives_zero_gas_transactions_api::ZeroGasTransactionApi + + moonbeam_rpc_primitives_txpool::TxPoolRuntimeApi + + moonbeam_rpc_primitives_debug::DebugRuntimeApi, >::StateBackend: sp_api::StateBackend, { } diff --git a/node/src/rpc/eth.rs b/node/src/rpc/eth.rs index 2117cc6b..770f9ce1 100644 --- a/node/src/rpc/eth.rs +++ b/node/src/rpc/eth.rs @@ -1,6 +1,8 @@ use std::{collections::BTreeMap, sync::Arc}; use jsonrpsee::RpcModule; +use moonbeam_rpc_debug::{Debug, DebugServer}; +use moonbeam_rpc_trace::{Trace, TraceServer}; // Substrate use sc_client_api::{ backend::{Backend, StorageProvider}, @@ -16,12 +18,15 @@ use sp_block_builder::BlockBuilder as BlockBuilderApi; use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; use sp_core::H256; use sp_runtime::traits::Block as BlockT; +use sp_runtime::traits::Header as HeaderT; // Frontier pub use fc_rpc::{EthBlockDataCacheTask, EthConfig, OverrideHandle, StorageOverride, TxPool}; pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool}; pub use fc_storage::overrides_handle; use fp_rpc::{ConvertTransaction, ConvertTransactionRuntimeApi, EthereumRuntimeRPCApi}; +use super::TracingConfig; + /// Extra dependencies for Ethereum compatibility. pub struct EthDeps { /// The client instance to use. @@ -95,9 +100,11 @@ pub fn create_eth>( fc_mapping_sync::EthereumBlockNotification, >, >, + optional_tracing_config: Option, ) -> Result, Box> where B: BlockT, + B::Header: HeaderT, C: CallApiAt + ProvideRuntimeApi, C::Api: BlockBuilderApi + ConvertTransactionRuntimeApi + EthereumRuntimeRPCApi, C: BlockchainEvents + 'static, @@ -196,8 +203,17 @@ where .into_rpc(), )?; - io.merge(Web3::new(client).into_rpc())?; - io.merge(tx_pool.into_rpc())?; + io.merge(Web3::new(client.clone()).into_rpc())?; + + if let Some(tracing_config) = optional_tracing_config { + if let Some(debug_requester) = tracing_config.tracing_requesters.debug { + io.merge(Debug::new(debug_requester).into_rpc())?; + } + + if let Some(trace_requester) = tracing_config.tracing_requesters.trace { + io.merge(Trace::new(client, trace_requester, 20).into_rpc())?; + } + } Ok(io) } diff --git a/node/src/rpc/mod.rs b/node/src/rpc/mod.rs index 05b5e17f..17c2ed78 100644 --- a/node/src/rpc/mod.rs +++ b/node/src/rpc/mod.rs @@ -21,6 +21,9 @@ use stbl_primitives_zero_gas_transactions_api::ZeroGasTransactionApi; // Runtime use stability_runtime::{opaque::Block, AccountId, Balance, Hash, Index}; +mod tracing; +pub use self::tracing::*; + mod eth; pub use self::eth::{create_eth, overrides_handle, EthDeps}; @@ -49,6 +52,10 @@ where type RuntimeStorageOverride = fc_rpc::frontier_backend_client::SystemAccountId20StorageOverride; } +pub struct TracingConfig { + pub tracing_requesters: RpcRequesters, + pub trace_filter_max_count: u32, +} /// Instantiate all Full RPC extensions. pub fn create_full( @@ -59,6 +66,7 @@ pub fn create_full( fc_mapping_sync::EthereumBlockNotification, >, >, + optional_tracing_config: Option, ) -> Result, Box> where C: CallApiAt + ProvideRuntimeApi, @@ -74,10 +82,13 @@ where + HeaderMetadata + StorageProvider, BE: Backend + 'static, + C::Api: moonbeam_rpc_primitives_debug::DebugRuntimeApi, P: TransactionPool + 'static, A: ChainApi + 'static, CT: fp_rpc::ConvertTransaction<::Extrinsic> + Send + Sync + 'static, { + use moonbeam_rpc_debug::*; + use moonbeam_rpc_trace::*; use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; use sc_consensus_manual_seal::rpc::{ManualSeal, ManualSealApiServer}; use stability_rpc::{StabilityRpc, StabilityRpcEndpointsServer}; @@ -110,6 +121,7 @@ where eth, subscription_task_executor, pubsub_notification_sinks, + optional_tracing_config, )?; Ok(io) diff --git a/node/src/rpc/tracing.rs b/node/src/rpc/tracing.rs new file mode 100644 index 00000000..04d6d441 --- /dev/null +++ b/node/src/rpc/tracing.rs @@ -0,0 +1,123 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +use std::time::Duration; + +use super::*; + +use fc_db::Backend as BackendT; +use fc_rpc::OverrideHandle; +use fp_rpc::EthereumRuntimeRPCApi; +use moonbeam_rpc_debug::{DebugHandler, DebugRequester}; +use moonbeam_rpc_trace::{CacheRequester as TraceFilterCacheRequester, CacheTask}; +use sc_client_api::BlockOf; +use sc_service::TaskManager; +use sp_core::{traits::SpawnEssentialNamed, H256}; +use sp_runtime::traits::Header as HeaderT; +use tokio::sync::Semaphore; +use sp_runtime::traits::BlakeTwo256; +use sc_client_api::StateBackend; +use sp_block_builder::BlockBuilder; +use fc_db::BackendReader; + +#[derive(Clone)] +pub struct RpcRequesters { + pub debug: Option, + pub trace: Option, +} + +// Spawn the tasks that are required to run a Moonbeam tracing node. +pub fn spawn_tracing_tasks( + task_manager: &TaskManager, + client: Arc, + backend: Arc, + frontier_backend: Arc + Send + Sync>, + overrides: Arc>, + prometheus_registry : Option, +) -> RpcRequesters +where + C: ProvideRuntimeApi + BlockOf, + C: StorageProvider, + C: HeaderBackend + HeaderMetadata + 'static, + C: BlockchainEvents, + C: Send + Sync + 'static, + C::Api: EthereumRuntimeRPCApi + moonbeam_rpc_primitives_debug::DebugRuntimeApi, + C::Api: BlockBuilder, + B: BlockT + Send + Sync + 'static, + B::Header: HeaderT, + BE: Backend + 'static, + BE::State: StateBackend, +{ + let ethapi_max_permits = 1000; + let trace_enabled = true; + let debug_enabled = true; + let permit_pool = Arc::new(Semaphore::new(ethapi_max_permits as usize)); + let tracing_raw_max_memory_usage = 1024 * 1024; + let ethapi_trace_cache_duration = 3600; + + let (trace_filter_task, trace_filter_requester) = if trace_enabled { + let (trace_filter_task, trace_filter_requester) = CacheTask::create( + Arc::clone(&client), + Arc::clone(&backend), + Duration::from_secs(ethapi_trace_cache_duration), + Arc::clone(&permit_pool), + Arc::clone(&overrides), + prometheus_registry.clone() + ); + (Some(trace_filter_task), Some(trace_filter_requester)) + } else { + (None, None) + }; + + let (debug_task, debug_requester) = if debug_enabled { + let (debug_task, debug_requester) = DebugHandler::task( + Arc::clone(&client), + Arc::clone(&backend), + Arc::clone(&frontier_backend), + Arc::clone(&permit_pool), + Arc::clone(&overrides), + tracing_raw_max_memory_usage, + ); + (Some(debug_task), Some(debug_requester)) + } else { + (None, None) + }; + + // `trace_filter` cache task. Essential. + // Proxies rpc requests to it's handler. + if let Some(trace_filter_task) = trace_filter_task { + task_manager.spawn_essential_handle().spawn( + "trace-filter-cache", + Some("eth-tracing"), + trace_filter_task, + ); + } + + // `debug` task if enabled. Essential. + // Proxies rpc requests to it's handler. + if let Some(debug_task) = debug_task { + task_manager.spawn_essential_handle().spawn( + "ethapi-debug", + Some("eth-tracing"), + debug_task, + ); + } + + RpcRequesters { + debug: debug_requester, + trace: trace_filter_requester, + } +} diff --git a/node/src/service.rs b/node/src/service.rs index 874e77d7..43cedce4 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -2,19 +2,24 @@ use std::{cell::RefCell, path::Path, sync::Arc, time::Duration}; +use fc_rpc::OverrideHandle; use futures::{channel::mpsc, prelude::*}; // Substrate use prometheus_endpoint::Registry; use sc_client_api::{BlockBackend, StateBackendFor}; use sc_consensus::BasicQueue; -use sc_executor::NativeExecutionDispatch; +use sc_executor::{NativeElseWasmExecutor, NativeExecutionDispatch}; use sc_network_common::sync::warp::WarpSyncParams; -use sc_service::{error::Error as ServiceError, Configuration, PartialComponents, TaskManager}; +use sc_service::{ + error::Error as ServiceError, Configuration, PartialComponents, SpawnTaskHandle, TaskManager, +}; use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker}; use sp_api::{ConstructRuntimeApi, TransactionFor}; +use sp_core::traits::SpawnEssentialNamed; use sp_runtime::traits::BlakeTwo256; use sp_trie::PrefixedMemoryDB; use stbl_primitives_zero_gas_transactions_api::ZeroGasTransactionApi; +use tokio::sync::Semaphore; // Runtime use sc_service::KeystoreContainer; use stability_runtime::{opaque::Block, Hash, TransactionConverter}; @@ -26,6 +31,7 @@ use crate::{ new_frontier_partial, spawn_frontier_tasks, BackendType, EthCompatRuntimeApiCollection, FrontierBackend, FrontierBlockImport, FrontierPartialComponents, }, + rpc::TracingConfig, }; pub use crate::{ client::{Client, TemplateRuntimeExecutor}, @@ -68,7 +74,7 @@ where RuntimeApi: ConstructRuntimeApi>, RuntimeApi: Send + Sync + 'static, RuntimeApi::RuntimeApi: BaseRuntimeApiCollection> - + EthCompatRuntimeApiCollection>, + + EthCompatRuntimeApiCollection>, Executor: NativeExecutionDispatch + 'static, BIQ: FnOnce( Arc>, @@ -295,7 +301,6 @@ where build_aura_grandpa_import_queue:: }; - let PartialComponents { client, backend, @@ -407,10 +412,23 @@ where forced_parent_hashes: None, }; + let tracing_requesters = crate::rpc::spawn_tracing_tasks( + &task_manager, + client.clone(), + backend.clone(), + match frontier_backend.clone() { + fc_db::Backend::KeyValue(b) => Arc::new(b), + fc_db::Backend::Sql(b) => Arc::new(b), + }, + eth_rpc_params.overrides.clone(), + prometheus_registry.clone() + ); + let rpc_builder = { let client = client.clone(); let pool = transaction_pool.clone(); let pubsub_notification_sinks = pubsub_notification_sinks.clone(); + let tracing_requesters = tracing_requesters.clone(); Box::new(move |deny_unsafe, subscription_task_executor| { let deps = crate::rpc::FullDeps { @@ -429,6 +447,10 @@ where deps, subscription_task_executor, pubsub_notification_sinks.clone(), + Some(TracingConfig { + tracing_requesters: tracing_requesters.clone(), + trace_filter_max_count: 2000u32, + }), ) .map_err(Into::into) }) @@ -452,7 +474,7 @@ where spawn_frontier_tasks( &task_manager, client.clone(), - backend, + backend.clone(), frontier_backend, filter_pool, overrides, @@ -695,7 +717,13 @@ pub async fn build_full( sealing: Option, stability_config: StabilityConfiguration, ) -> Result { - new_full::(config, eth_config, sealing, stability_config).await + new_full::( + config, + eth_config, + sealing, + stability_config, + ) + .await } pub fn new_chain_ops( diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index b587a7af..13a3cad4 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -67,9 +67,17 @@ std = [ 'stbl-core-primitives/std', 'stbl-primitives-zero-gas-transactions-api/std', 'stability-rpc-api/std', + "moonbeam-evm-tracer/std", + "moonbeam-rpc-primitives-debug/std", + "moonbeam-rpc-primitives-txpool/std", ] with-paritydb-weights = [] with-rocksdb-weights = [] +evm-tracing = [ + "moonbeam-evm-tracer", + "moonbeam-rpc-primitives-debug", + "moonbeam-rpc-primitives-txpool", +] [build-dependencies] substrate-wasm-builder = { workspace = true, optional = true } @@ -169,3 +177,9 @@ stbl-transaction-validator = { workspace = true } stbl-core-primitives = { workspace = true } account = { workspace = true } stability-rpc-api = { workspace = true } + +# Moonbeam evm tracer dependencies +moonbeam-evm-tracer = { workspace = true, optional = true, default-features = false } +moonbeam-primitives-ext = { workspace = true, optional = true, default-features = false } +moonbeam-rpc-primitives-debug = { workspace = true, optional = true, default-features = false } +moonbeam-rpc-primitives-txpool = { workspace = true, optional = true, default-features = false } diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 5fde2b60..2c3db0b3 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -66,6 +66,7 @@ use pallet_ethereum::{Call::transact, PostLogContent, Transaction as EthereumTra use pallet_evm::{Account as EVMAccount, FeeCalculator, GasWeightMapping, Runner}; use pallet_sponsored_transactions::Call::send_sponsored_transaction; use pallet_validator_set::SessionBlockManager; +extern crate moonbeam_rpc_primitives_txpool; // A few exports that help ease life for downstream crates. pub use frame_support::{ construct_runtime, @@ -1276,6 +1277,94 @@ impl_runtime_apis! { } } + impl moonbeam_rpc_primitives_debug::DebugRuntimeApi for Runtime { + fn trace_transaction( + extrinsics: Vec<::Extrinsic>, + traced_transaction: &pallet_ethereum::Transaction, + ) -> Result< + (), + sp_runtime::DispatchError, + > { + use moonbeam_evm_tracer::tracer::EvmTracer; + + // Apply the a subset of extrinsics: all the substrate-specific or ethereum + // transactions that preceded the requested transaction. + for ext in extrinsics.into_iter() { + let _ = match &ext.0.function { + RuntimeCall::Ethereum(pallet_ethereum::Call::transact { transaction }) => { + if transaction == traced_transaction { + EvmTracer::new().trace(|| Executive::apply_extrinsic(ext)); + return Ok(()); + } else { + Executive::apply_extrinsic(ext) + } + } + _ => Executive::apply_extrinsic(ext), + }; + } + Err(sp_runtime::DispatchError::Other( + "Failed to find Ethereum transaction among the extrinsics.", + )) + } + + fn trace_block( + extrinsics: Vec<::Extrinsic>, + known_transactions: Vec, + ) -> Result< + (), + sp_runtime::DispatchError, + > { + use moonbeam_evm_tracer::tracer::EvmTracer; + + let mut config = ::config().clone(); + config.estimate = true; + + // Apply all extrinsics. Ethereum extrinsics are traced. + for ext in extrinsics.into_iter() { + match &ext.0.function { + RuntimeCall::Ethereum(pallet_ethereum::Call::transact { transaction }) => { + if known_transactions.contains(&transaction.hash()) { + // Each known extrinsic is a new call stack. + EvmTracer::emit_new(); + EvmTracer::new().trace(|| Executive::apply_extrinsic(ext)); + } else { + let _ = Executive::apply_extrinsic(ext); + } + } + _ => { + let _ = Executive::apply_extrinsic(ext); + } + }; + } + + Ok(()) + } + } + + impl moonbeam_rpc_primitives_txpool::TxPoolRuntimeApi for Runtime { + fn extrinsic_filter( + xts_ready: Vec<::Extrinsic>, + xts_future: Vec<::Extrinsic>, + ) -> moonbeam_rpc_primitives_txpool::TxPoolResponse { + moonbeam_rpc_primitives_txpool::TxPoolResponse { + ready: xts_ready + .into_iter() + .filter_map(|xt| match xt.0.function { + RuntimeCall::Ethereum(pallet_ethereum::Call::transact { transaction }) => Some(transaction), + _ => None, + }) + .collect(), + future: xts_future + .into_iter() + .filter_map(|xt| match xt.0.function { + RuntimeCall::Ethereum(pallet_ethereum::Call::transact { transaction }) => Some(transaction), + _ => None, + }) + .collect(), + } + } + } + impl stbl_primitives_zero_gas_transactions_api::ZeroGasTransactionApi for Runtime { fn convert_zero_gas_transaction(transaction: EthereumTransaction, validator_signature: Vec) -> ::Extrinsic { UncheckedExtrinsic::new_unsigned( diff --git a/vendor/client/evm-tracing/Cargo.toml b/vendor/client/evm-tracing/Cargo.toml new file mode 100644 index 00000000..3a65c763 --- /dev/null +++ b/vendor/client/evm-tracing/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "moonbeam-client-evm-tracing" +authors = { workspace = true } +edition = "2021" +homepage = "https://moonbeam.network" +license = "GPL-3.0-only" +repository = { workspace = true } +version = "0.1.0" + +[dependencies] +ethereum-types = { workspace = true, features = [ "std" ] } +hex = { workspace = true, features = [ "serde" ] } +serde = { workspace = true, features = [ "derive", "std" ] } +serde_json = { workspace = true } + +# Moonbeam +evm-tracing-events = { workspace = true, features = [ "std" ] } +moonbeam-rpc-primitives-debug = { workspace = true, features = [ "std" ] } + +# Substrate +parity-scale-codec = { workspace = true, features = [ "std" ] } +sp-std = { workspace = true, features = [ "std" ] } diff --git a/vendor/client/evm-tracing/src/formatters/blockscout.rs b/vendor/client/evm-tracing/src/formatters/blockscout.rs new file mode 100644 index 00000000..c880c6c3 --- /dev/null +++ b/vendor/client/evm-tracing/src/formatters/blockscout.rs @@ -0,0 +1,92 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +use crate::listeners::call_list::Listener; +use crate::types::serialization::*; +use crate::types::{ + single::{Call, TransactionTrace}, + CallResult, CallType, CreateResult, +}; +use ethereum_types::{H160, U256}; +use parity_scale_codec::{Decode, Encode}; +use serde::Serialize; + +pub struct Formatter; + +impl super::ResponseFormatter for Formatter { + type Listener = Listener; + type Response = TransactionTrace; + + fn format(listener: Listener) -> Option { + if let Some(entry) = listener.entries.last() { + return Some(TransactionTrace::CallList( + entry + .into_iter() + .map(|(_, value)| Call::Blockscout(value.clone())) + .collect(), + )); + } + None + } +} + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode, Serialize)] +#[serde(rename_all = "lowercase", tag = "type")] +pub enum BlockscoutCallInner { + Call { + #[serde(rename(serialize = "callType"))] + /// Type of call. + call_type: CallType, + to: H160, + #[serde(serialize_with = "bytes_0x_serialize")] + input: Vec, + /// "output" or "error" field + #[serde(flatten)] + res: CallResult, + }, + Create { + #[serde(serialize_with = "bytes_0x_serialize")] + init: Vec, + #[serde(flatten)] + res: CreateResult, + }, + SelfDestruct { + #[serde(skip)] + balance: U256, + to: H160, + }, +} + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct BlockscoutCall { + pub from: H160, + /// Indices of parent calls. + pub trace_address: Vec, + /// Number of children calls. + /// Not needed for Blockscout, but needed for `crate::block` + /// types that are build from this type. + #[serde(skip)] + pub subtraces: u32, + /// Sends funds to the (payable) function + pub value: U256, + /// Remaining gas in the runtime. + pub gas: U256, + /// Gas used by this context. + pub gas_used: U256, + #[serde(flatten)] + pub inner: BlockscoutCallInner, +} diff --git a/vendor/client/evm-tracing/src/formatters/call_tracer.rs b/vendor/client/evm-tracing/src/formatters/call_tracer.rs new file mode 100644 index 00000000..dc91ee60 --- /dev/null +++ b/vendor/client/evm-tracing/src/formatters/call_tracer.rs @@ -0,0 +1,314 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +use super::blockscout::BlockscoutCallInner; +use crate::types::{ + single::{Call, TransactionTrace}, + CallResult, CallType, CreateResult, +}; + +use crate::listeners::call_list::Listener; + +use crate::types::serialization::*; +use serde::Serialize; + +use ethereum_types::{H160, U256}; +use parity_scale_codec::{Decode, Encode}; +use sp_std::{cmp::Ordering, vec::Vec}; + +pub struct Formatter; + +impl super::ResponseFormatter for Formatter { + type Listener = Listener; + type Response = Vec; + + fn format(mut listener: Listener) -> Option> { + // Remove empty BTreeMaps pushed to `entries`. + // I.e. InvalidNonce or other pallet_evm::runner exits + listener.entries.retain(|x| !x.is_empty()); + let mut traces = Vec::new(); + for entry in listener.entries.iter() { + let mut result: Vec = entry + .into_iter() + .map(|(_, it)| { + let from = it.from; + let trace_address = it.trace_address.clone(); + let value = it.value; + let gas = it.gas; + let gas_used = it.gas_used; + let inner = it.inner.clone(); + Call::CallTracer(CallTracerCall { + from: from, + gas: gas, + gas_used: gas_used, + trace_address: Some(trace_address.clone()), + inner: match inner.clone() { + BlockscoutCallInner::Call { + input, + to, + res, + call_type, + } => CallTracerInner::Call { + call_type: match call_type { + CallType::Call => "CALL".as_bytes().to_vec(), + CallType::CallCode => "CALLCODE".as_bytes().to_vec(), + CallType::DelegateCall => "DELEGATECALL".as_bytes().to_vec(), + CallType::StaticCall => "STATICCALL".as_bytes().to_vec(), + }, + to, + input, + res, + value: Some(value), + }, + BlockscoutCallInner::Create { init, res } => CallTracerInner::Create { + input: init, + error: match res { + CreateResult::Success { .. } => None, + CreateResult::Error { ref error } => Some(error.clone()), + }, + to: match res { + CreateResult::Success { + created_contract_address_hash, + .. + } => Some(created_contract_address_hash), + CreateResult::Error { .. } => None, + }, + output: match res { + CreateResult::Success { + created_contract_code, + .. + } => Some(created_contract_code), + CreateResult::Error { .. } => None, + }, + value: value, + call_type: "CREATE".as_bytes().to_vec(), + }, + BlockscoutCallInner::SelfDestruct { balance, to } => { + CallTracerInner::SelfDestruct { + value: balance, + to, + call_type: "SELFDESTRUCT".as_bytes().to_vec(), + } + } + }, + calls: Vec::new(), + }) + }) + .collect(); + // Geth's `callTracer` expects a tree of nested calls and we have a stack. + // + // We iterate over the sorted stack, and push each children to it's + // parent (the item which's `trace_address` matches &T[0..T.len()-1]) until there + // is a single item on the list. + // + // The last remaining item is the context call with all it's descendants. I.e. + // + // # Input + // [] + // [0] + // [0,0] + // [0,0,0] + // [0,1] + // [0,1,0] + // [0,1,1] + // [0,1,2] + // [1] + // [1,0] + // + // # Sorted + // [0,0,0] -> pop 0 and push to [0,0] + // [0,1,0] -> pop 0 and push to [0,1] + // [0,1,1] -> pop 1 and push to [0,1] + // [0,1,2] -> pop 2 and push to [0,1] + // [0,0] -> pop 0 and push to [0] + // [0,1] -> pop 1 and push to [0] + // [1,0] -> pop 0 and push to [1] + // [0] -> pop 0 and push to root + // [1] -> pop 1 and push to root + // [] + // + // # Result + // root { + // calls: { + // 0 { 0 { 0 }, 1 { 0, 1, 2 }}, + // 1 { 0 }, + // } + // } + if result.len() > 1 { + // Sort the stack. Assume there is no `Ordering::Equal`, as we are + // sorting by index. + // + // We consider an item to be `Ordering::Less` when: + // - Is closer to the root or + // - Is greater than its sibling. + result.sort_by(|a, b| match (a, b) { + ( + Call::CallTracer(CallTracerCall { + trace_address: Some(a), + .. + }), + Call::CallTracer(CallTracerCall { + trace_address: Some(b), + .. + }), + ) => { + let a_len = a.len(); + let b_len = b.len(); + let sibling_greater_than = |a: &Vec, b: &Vec| -> bool { + for (i, a_value) in a.iter().enumerate() { + if a_value > &b[i] { + return true; + } else if a_value < &b[i] { + return false; + } else { + continue; + } + } + return false; + }; + if b_len > a_len || (a_len == b_len && sibling_greater_than(&a, &b)) { + Ordering::Less + } else { + Ordering::Greater + } + } + _ => unreachable!(), + }); + // Stack pop-and-push. + while result.len() > 1 { + let mut last = result + .pop() + .expect("result.len() > 1, so pop() necessarily returns an element"); + // Find the parent index. + if let Some(index) = + result + .iter() + .position(|current| match (last.clone(), current) { + ( + Call::CallTracer(CallTracerCall { + trace_address: Some(a), + .. + }), + Call::CallTracer(CallTracerCall { + trace_address: Some(b), + .. + }), + ) => { + &b[..] + == a.get(0..a.len() - 1).expect( + "non-root element while traversing trace result", + ) + } + _ => unreachable!(), + }) { + // Remove `trace_address` from result. + if let Call::CallTracer(CallTracerCall { + ref mut trace_address, + .. + }) = last + { + *trace_address = None; + } + // Push the children to parent. + if let Some(Call::CallTracer(CallTracerCall { calls, .. })) = + result.get_mut(index) + { + calls.push(last); + } + } + } + } + // Remove `trace_address` from result. + if let Some(Call::CallTracer(CallTracerCall { trace_address, .. })) = result.get_mut(0) + { + *trace_address = None; + } + if result.len() == 1 { + traces.push(TransactionTrace::CallListNested(result.pop().expect( + "result.len() == 1, so pop() necessarily returns this element", + ))); + } + } + if traces.is_empty() { + return None; + } + return Some(traces); + } +} + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct CallTracerCall { + pub from: H160, + + /// Indices of parent calls. Used to build the Etherscan nested response. + #[serde(skip_serializing_if = "Option::is_none")] + pub trace_address: Option>, + + /// Remaining gas in the runtime. + pub gas: U256, + /// Gas used by this context. + pub gas_used: U256, + + #[serde(flatten)] + pub inner: CallTracerInner, + + #[serde(skip_serializing_if = "Vec::is_empty")] + pub calls: Vec, +} + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode, Serialize)] +#[serde(untagged)] +pub enum CallTracerInner { + Call { + #[serde(rename = "type", serialize_with = "opcode_serialize")] + call_type: Vec, + to: H160, + #[serde(serialize_with = "bytes_0x_serialize")] + input: Vec, + /// "output" or "error" field + #[serde(flatten)] + res: CallResult, + + #[serde(skip_serializing_if = "Option::is_none")] + value: Option, + }, + Create { + #[serde(rename = "type", serialize_with = "opcode_serialize")] + call_type: Vec, + #[serde(serialize_with = "bytes_0x_serialize")] + input: Vec, + #[serde(skip_serializing_if = "Option::is_none")] + to: Option, + #[serde( + skip_serializing_if = "Option::is_none", + serialize_with = "option_bytes_0x_serialize" + )] + output: Option>, + #[serde( + skip_serializing_if = "Option::is_none", + serialize_with = "option_string_serialize" + )] + error: Option>, + value: U256, + }, + SelfDestruct { + #[serde(rename = "type", serialize_with = "opcode_serialize")] + call_type: Vec, + to: H160, + value: U256, + }, +} diff --git a/vendor/client/evm-tracing/src/formatters/mod.rs b/vendor/client/evm-tracing/src/formatters/mod.rs new file mode 100644 index 00000000..22935fa8 --- /dev/null +++ b/vendor/client/evm-tracing/src/formatters/mod.rs @@ -0,0 +1,35 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +pub mod blockscout; +pub mod call_tracer; +pub mod raw; +pub mod trace_filter; + +pub use blockscout::Formatter as Blockscout; +pub use call_tracer::Formatter as CallTracer; +pub use raw::Formatter as Raw; +pub use trace_filter::Formatter as TraceFilter; + +use evm_tracing_events::Listener; +use serde::Serialize; + +pub trait ResponseFormatter { + type Listener: Listener; + type Response: Serialize; + + fn format(listener: Self::Listener) -> Option; +} diff --git a/vendor/client/evm-tracing/src/formatters/raw.rs b/vendor/client/evm-tracing/src/formatters/raw.rs new file mode 100644 index 00000000..d3588e2f --- /dev/null +++ b/vendor/client/evm-tracing/src/formatters/raw.rs @@ -0,0 +1,37 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +use crate::listeners::raw::Listener; +use crate::types::single::TransactionTrace; + +pub struct Formatter; + +impl super::ResponseFormatter for Formatter { + type Listener = Listener; + type Response = TransactionTrace; + + fn format(listener: Listener) -> Option { + if listener.remaining_memory_usage.is_none() { + None + } else { + Some(TransactionTrace::Raw { + struct_logs: listener.struct_logs, + gas: listener.final_gas.into(), + return_value: listener.return_value, + }) + } + } +} diff --git a/vendor/client/evm-tracing/src/formatters/trace_filter.rs b/vendor/client/evm-tracing/src/formatters/trace_filter.rs new file mode 100644 index 00000000..570b8947 --- /dev/null +++ b/vendor/client/evm-tracing/src/formatters/trace_filter.rs @@ -0,0 +1,134 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +use super::blockscout::BlockscoutCallInner as CallInner; +use crate::listeners::call_list::Listener; +use crate::types::{ + block::{ + TransactionTrace, TransactionTraceAction, TransactionTraceOutput, TransactionTraceResult, + }, + CallResult, CreateResult, CreateType, +}; +use ethereum_types::H256; + +pub struct Formatter; + +impl super::ResponseFormatter for Formatter { + type Listener = Listener; + type Response = Vec; + + fn format(mut listener: Listener) -> Option> { + // Remove empty BTreeMaps pushed to `entries`. + // I.e. InvalidNonce or other pallet_evm::runner exits + listener.entries.retain(|x| !x.is_empty()); + let mut traces = Vec::new(); + for (eth_tx_index, entry) in listener.entries.iter().enumerate() { + let mut tx_traces: Vec<_> = entry + .into_iter() + .map(|(_, trace)| match trace.inner.clone() { + CallInner::Call { + input, + to, + res, + call_type, + } => TransactionTrace { + action: TransactionTraceAction::Call { + call_type, + from: trace.from, + gas: trace.gas, + input, + to, + value: trace.value, + }, + // Can't be known here, must be inserted upstream. + block_hash: H256::default(), + // Can't be known here, must be inserted upstream. + block_number: 0, + output: match res { + CallResult::Output(output) => { + TransactionTraceOutput::Result(TransactionTraceResult::Call { + gas_used: trace.gas_used, + output, + }) + } + CallResult::Error(error) => TransactionTraceOutput::Error(error), + }, + subtraces: trace.subtraces, + trace_address: trace.trace_address.clone(), + // Can't be known here, must be inserted upstream. + transaction_hash: H256::default(), + transaction_position: eth_tx_index as u32, + }, + CallInner::Create { init, res } => { + TransactionTrace { + action: TransactionTraceAction::Create { + creation_method: CreateType::Create, + from: trace.from, + gas: trace.gas, + init, + value: trace.value, + }, + // Can't be known here, must be inserted upstream. + block_hash: H256::default(), + // Can't be known here, must be inserted upstream. + block_number: 0, + output: match res { + CreateResult::Success { + created_contract_address_hash, + created_contract_code, + } => { + TransactionTraceOutput::Result(TransactionTraceResult::Create { + gas_used: trace.gas_used, + code: created_contract_code, + address: created_contract_address_hash, + }) + } + CreateResult::Error { error } => { + TransactionTraceOutput::Error(error) + } + }, + subtraces: trace.subtraces, + trace_address: trace.trace_address.clone(), + // Can't be known here, must be inserted upstream. + transaction_hash: H256::default(), + transaction_position: eth_tx_index as u32, + } + } + CallInner::SelfDestruct { balance, to } => TransactionTrace { + action: TransactionTraceAction::Suicide { + address: trace.from, + balance, + refund_address: to, + }, + // Can't be known here, must be inserted upstream. + block_hash: H256::default(), + // Can't be known here, must be inserted upstream. + block_number: 0, + output: TransactionTraceOutput::Result(TransactionTraceResult::Suicide), + subtraces: trace.subtraces, + trace_address: trace.trace_address.clone(), + // Can't be known here, must be inserted upstream. + transaction_hash: H256::default(), + transaction_position: eth_tx_index as u32, + }, + }) + .collect(); + + traces.append(&mut tx_traces); + } + Some(traces) + } +} diff --git a/vendor/client/evm-tracing/src/lib.rs b/vendor/client/evm-tracing/src/lib.rs new file mode 100644 index 00000000..1c964b43 --- /dev/null +++ b/vendor/client/evm-tracing/src/lib.rs @@ -0,0 +1,21 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! This crate contains the client-side part that interacts with our "v2" tracing design. + +pub mod formatters; +pub mod listeners; +pub mod types; diff --git a/vendor/client/evm-tracing/src/listeners/call_list.rs b/vendor/client/evm-tracing/src/listeners/call_list.rs new file mode 100644 index 00000000..eda78804 --- /dev/null +++ b/vendor/client/evm-tracing/src/listeners/call_list.rs @@ -0,0 +1,1130 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +use crate::formatters::blockscout::BlockscoutCall as Call; +use crate::formatters::blockscout::BlockscoutCallInner as CallInner; +use crate::types::{CallResult, CallType, ContextType, CreateResult}; +use ethereum_types::{H160, U256}; +use evm_tracing_events::{ + runtime::{Capture, ExitError, ExitReason, ExitSucceed}, + Event, EvmEvent, GasometerEvent, Listener as ListenerT, RuntimeEvent, StepEventFilter, +}; +use std::{collections::btree_map::BTreeMap, vec, vec::Vec}; + +/// Enum of the different "modes" of tracer for multiple runtime versions and +/// the kind of EVM events that are emitted. +enum TracingVersion { + /// The first event of the transaction is `EvmEvent::TransactX`. It goes along other events + /// such as `EvmEvent::Exit`. All contexts should have clear start/end boundaries. + EarlyTransact, + /// Older version in which the events above didn't existed. + /// It means that we cannot rely on those events to perform any task, and must rely only + /// on other events. + Legacy, +} + +pub struct Listener { + /// Version of the tracing. + /// Defaults to legacy, and switch to a more modern version if recently added events are + /// received. + version: TracingVersion, + + // Transaction cost that must be added to the first context cost. + transaction_cost: u64, + + // Final logs. + pub entries: Vec>, + // Next index to use. + entries_next_index: u32, + // Stack of contexts with data to keep between events. + context_stack: Vec, + + // Type of the next call. + // By default is None and corresponds to the root call, which + // can be determined using the `is_static` field of the `Call` event. + // Then by looking at call traps events we can set this value to the correct + // call type, to be used when the following `Call` event is received. + call_type: Option, + + /// When `EvmEvent::TransactX` is received it creates its own context. However it will usually + /// be followed by an `EvmEvent::Call/Create` that will also create a context, which must be + /// prevented. It must however not be skipped if `EvmEvent::TransactX` was not received + /// (in legacy mode). + skip_next_context: bool, + + // /// To handle EvmEvent::Exit no emitted by previous runtimes versions, + // /// entries are not inserted directly in `self.entries`. + // pending_entries: Vec<(u32, Call)>, + /// See `RuntimeEvent::StepResult` event explanatioins. + step_result_entry: Option<(u32, Call)>, + + /// When tracing a block `Event::CallListNew` is emitted before each Ethereum transaction is + /// processed. Since we use that event to **finish** the transaction, we must ignore the first + /// one. + call_list_first_transaction: bool, + + /// True if only the `GasometerEvent::RecordTransaction` event has been received. + /// Allow to correctly handle transactions that cannot pay for the tx data in Legacy mode. + record_transaction_event_only: bool, +} + +struct Context { + entries_index: u32, + + context_type: ContextType, + + from: H160, + trace_address: Vec, + subtraces: u32, + value: U256, + + gas: u64, + start_gas: Option, + + // input / data + data: Vec, + // to / create address + to: H160, +} + +impl Default for Listener { + fn default() -> Self { + Self { + version: TracingVersion::Legacy, + transaction_cost: 0, + + entries: vec![], + entries_next_index: 0, + + context_stack: vec![], + + call_type: None, + step_result_entry: None, + skip_next_context: false, + call_list_first_transaction: true, + record_transaction_event_only: false, + } + } +} + +impl Listener { + pub fn using R>(&mut self, f: F) -> R { + evm_tracing_events::using(self, f) + } + + /// Called at the end of each transaction when tracing. + /// Allow to insert the pending entries regardless of which runtime version + /// is used (with or without EvmEvent::Exit). + pub fn finish_transaction(&mut self) { + // remove any leftover context + let mut context_stack = vec![]; + core::mem::swap(&mut self.context_stack, &mut context_stack); + + // if there is a left over there have been an early exit. + // we generate an entry from it and discord any inner context. + if let Some(context) = context_stack.into_iter().next() { + let mut gas_used = context.start_gas.unwrap_or(0) - context.gas; + if context.entries_index == 0 { + gas_used += self.transaction_cost; + } + + let entry = match context.context_type { + ContextType::Call(call_type) => { + let res = CallResult::Error( + b"early exit (out of gas, stack overflow, direct call to precompile, ...)" + .to_vec(), + ); + Call { + from: context.from, + trace_address: context.trace_address, + subtraces: context.subtraces, + value: context.value, + gas: context.gas.into(), + gas_used: gas_used.into(), + inner: CallInner::Call { + call_type, + to: context.to, + input: context.data, + res, + }, + } + } + ContextType::Create => { + let res = CreateResult::Error { + error: b"early exit (out of gas, stack overflow, direct call to precompile, ...)".to_vec(), + }; + + Call { + value: context.value, + trace_address: context.trace_address, + subtraces: context.subtraces, + gas: context.gas.into(), + gas_used: gas_used.into(), + from: context.from, + inner: CallInner::Create { + init: context.data, + res, + }, + } + } + }; + + self.insert_entry(context.entries_index, entry); + // Since only this context/entry is kept, we need update entries_next_index too. + self.entries_next_index = context.entries_index + 1; + } + // However if the transaction had a too low gas limit to pay for the data cost itself, + // and `EvmEvent::Exit` is not emitted in **Legacy mode**, then it has never produced any + // context (and exited **early in the transaction**). + else if self.record_transaction_event_only { + let res = CallResult::Error( + b"transaction could not pay its own data cost (impossible to gather more info)" + .to_vec(), + ); + + let entry = Call { + from: H160::repeat_byte(0), + trace_address: vec![], + subtraces: 0, + value: 0.into(), + gas: 0.into(), + gas_used: 0.into(), + inner: CallInner::Call { + call_type: CallType::Call, + to: H160::repeat_byte(0), + input: vec![], + res, + }, + }; + + self.insert_entry(self.entries_next_index, entry); + self.entries_next_index += 1; + } + } + + pub fn gasometer_event(&mut self, event: GasometerEvent) { + match event { + GasometerEvent::RecordCost { snapshot, .. } + | GasometerEvent::RecordDynamicCost { snapshot, .. } + | GasometerEvent::RecordStipend { snapshot, .. } => { + if let Some(context) = self.context_stack.last_mut() { + if context.start_gas.is_none() { + context.start_gas = Some(snapshot.gas()); + } + context.gas = snapshot.gas(); + } + } + GasometerEvent::RecordTransaction { cost, .. } => { + self.transaction_cost = cost; + self.record_transaction_event_only = true; + } + // We ignore other kinds of message if any (new ones may be added in the future). + #[allow(unreachable_patterns)] + _ => (), + } + } + + pub fn runtime_event(&mut self, event: RuntimeEvent) { + match event { + RuntimeEvent::StepResult { + result: Err(Capture::Trap(opcode)), + .. + } => { + if let Some(ContextType::Call(call_type)) = ContextType::from(opcode) { + self.call_type = Some(call_type) + } + } + RuntimeEvent::StepResult { + result: Err(Capture::Exit(reason)), + return_value, + } => { + if let Some((key, entry)) = self.pop_context_to_entry(reason, return_value) { + match self.version { + TracingVersion::Legacy => { + // In Legacy mode we directly insert the entry. + self.insert_entry(key, entry); + } + TracingVersion::EarlyTransact => { + // In EarlyTransact mode this context must be used if this event is + // emitted. However the context of `EvmEvent::Exit` must be used if + // `StepResult` is skipped. For that reason we store this generated + // entry in a temporary value, and deal with it in `EvmEvent::Exit` that + // will be called in all cases. + self.step_result_entry = Some((key, entry)); + } + } + } + } + // We ignore other kinds of message if any (new ones may be added in the future). + #[allow(unreachable_patterns)] + _ => (), + } + } + + pub fn evm_event(&mut self, event: EvmEvent) { + match event { + EvmEvent::TransactCall { + caller, + address, + value, + data, + .. + } => { + self.record_transaction_event_only = false; + self.version = TracingVersion::EarlyTransact; + self.context_stack.push(Context { + entries_index: self.entries_next_index, + + context_type: ContextType::Call(CallType::Call), + + from: caller, + trace_address: vec![], + subtraces: 0, + value, + + gas: 0, + start_gas: None, + + data, + to: address, + }); + + self.entries_next_index += 1; + self.skip_next_context = true; + } + + EvmEvent::TransactCreate { + caller, + value, + init_code, + address, + .. + } => { + self.record_transaction_event_only = false; + self.version = TracingVersion::EarlyTransact; + self.context_stack.push(Context { + entries_index: self.entries_next_index, + + context_type: ContextType::Create, + + from: caller, + trace_address: vec![], + subtraces: 0, + value, + + gas: 0, + start_gas: None, + + data: init_code, + to: address, + }); + + self.entries_next_index += 1; + self.skip_next_context = true; + } + + EvmEvent::TransactCreate2 { + caller, + value, + init_code, + address, + .. + } => { + self.record_transaction_event_only = false; + self.version = TracingVersion::EarlyTransact; + self.context_stack.push(Context { + entries_index: self.entries_next_index, + + context_type: ContextType::Create, + + from: caller, + trace_address: vec![], + subtraces: 0, + value, + + gas: 0, + start_gas: None, + + data: init_code, + to: address, + }); + + self.entries_next_index += 1; + self.skip_next_context = true; + } + + EvmEvent::Call { + code_address, + input, + is_static, + context, + .. + } => { + self.record_transaction_event_only = false; + + let call_type = match (self.call_type, is_static) { + (None, true) => CallType::StaticCall, + (None, false) => CallType::Call, + (Some(call_type), _) => call_type, + }; + + if !self.skip_next_context { + let trace_address = if let Some(context) = self.context_stack.last_mut() { + let mut trace_address = context.trace_address.clone(); + trace_address.push(context.subtraces); + context.subtraces += 1; + trace_address + } else { + vec![] + }; + + // For subcalls we want to have "from" always be the parent context address + // instead of `context.caller`, since the latter will not have the correct + // value inside a DelegateCall. + let from = if let Some(parent_context) = self.context_stack.last() { + parent_context.to.clone() + } else { + context.caller + }; + + self.context_stack.push(Context { + entries_index: self.entries_next_index, + + context_type: ContextType::Call(call_type), + + from, + trace_address, + subtraces: 0, + value: context.apparent_value, + + gas: 0, + start_gas: None, + + data: input.to_vec(), + to: code_address, + }); + + self.entries_next_index += 1; + } else { + self.skip_next_context = false; + } + } + + EvmEvent::Create { + caller, + address, + // scheme, + value, + init_code, + .. + } => { + self.record_transaction_event_only = false; + + if !self.skip_next_context { + let trace_address = if let Some(context) = self.context_stack.last_mut() { + let mut trace_address = context.trace_address.clone(); + trace_address.push(context.subtraces); + context.subtraces += 1; + trace_address + } else { + vec![] + }; + + self.context_stack.push(Context { + entries_index: self.entries_next_index, + + context_type: ContextType::Create, + + from: caller, + trace_address, + subtraces: 0, + value, + + gas: 0, + start_gas: None, + + data: init_code.to_vec(), + to: address, + }); + + self.entries_next_index += 1; + } else { + self.skip_next_context = false; + } + } + EvmEvent::Suicide { + address, + target, + balance, + } => { + let trace_address = if let Some(context) = self.context_stack.last_mut() { + let mut trace_address = context.trace_address.clone(); + trace_address.push(context.subtraces); + context.subtraces += 1; + trace_address + } else { + vec![] + }; + + self.insert_entry( + self.entries_next_index, + Call { + from: address, // this contract is self destructing + trace_address, + subtraces: 0, + value: 0.into(), + gas: 0.into(), + gas_used: 0.into(), + inner: CallInner::SelfDestruct { + to: target, + balance, + }, + }, + ); + self.entries_next_index += 1; + } + EvmEvent::Exit { + reason, + return_value, + } => { + // We know we're in `TracingVersion::EarlyTransact` mode. + + self.record_transaction_event_only = false; + + let entry = self + .step_result_entry + .take() + .or_else(|| self.pop_context_to_entry(reason, return_value)); + + if let Some((key, entry)) = entry { + self.insert_entry(key, entry); + } + } + EvmEvent::PrecompileSubcall { .. } => { + // In a precompile subcall there is no CALL opcode result to observe, thus + // we need this new event. Precompile subcall might use non-standard call + // behavior (like batch precompile does) thus we simply consider this a call. + self.call_type = Some(CallType::Call); + } + + // We ignore other kinds of message if any (new ones may be added in the future). + #[allow(unreachable_patterns)] + _ => (), + } + } + + fn insert_entry(&mut self, key: u32, entry: Call) { + if let Some(ref mut last) = self.entries.last_mut() { + last.insert(key, entry); + } else { + let mut btree_map = BTreeMap::new(); + btree_map.insert(key, entry); + self.entries.push(btree_map); + } + } + + fn pop_context_to_entry( + &mut self, + reason: ExitReason, + return_value: Vec, + ) -> Option<(u32, Call)> { + if let Some(context) = self.context_stack.pop() { + let mut gas_used = context.start_gas.unwrap_or(0) - context.gas; + if context.entries_index == 0 { + gas_used += self.transaction_cost; + } + + Some(( + context.entries_index, + match context.context_type { + ContextType::Call(call_type) => { + let res = match &reason { + ExitReason::Succeed(ExitSucceed::Returned) => { + CallResult::Output(return_value.to_vec()) + } + ExitReason::Succeed(_) => CallResult::Output(vec![]), + ExitReason::Error(error) => CallResult::Error(error_message(error)), + + ExitReason::Revert(_) => { + CallResult::Error(b"execution reverted".to_vec()) + } + ExitReason::Fatal(_) => CallResult::Error(vec![]), + }; + + Call { + from: context.from, + trace_address: context.trace_address, + subtraces: context.subtraces, + value: context.value, + gas: context.gas.into(), + gas_used: gas_used.into(), + inner: CallInner::Call { + call_type, + to: context.to, + input: context.data, + res, + }, + } + } + ContextType::Create => { + let res = match &reason { + ExitReason::Succeed(_) => CreateResult::Success { + created_contract_address_hash: context.to, + created_contract_code: return_value.to_vec(), + }, + ExitReason::Error(error) => CreateResult::Error { + error: error_message(error), + }, + ExitReason::Revert(_) => CreateResult::Error { + error: b"execution reverted".to_vec(), + }, + ExitReason::Fatal(_) => CreateResult::Error { error: vec![] }, + }; + + Call { + value: context.value, + trace_address: context.trace_address, + subtraces: context.subtraces, + gas: context.gas.into(), + gas_used: gas_used.into(), + from: context.from, + inner: CallInner::Create { + init: context.data, + res, + }, + } + } + }, + )) + } else { + None + } + } +} + +fn error_message(error: &ExitError) -> Vec { + match error { + ExitError::StackUnderflow => "stack underflow", + ExitError::StackOverflow => "stack overflow", + ExitError::InvalidJump => "invalid jump", + ExitError::InvalidRange => "invalid range", + ExitError::DesignatedInvalid => "designated invalid", + ExitError::CallTooDeep => "call too deep", + ExitError::CreateCollision => "create collision", + ExitError::CreateContractLimit => "create contract limit", + ExitError::OutOfOffset => "out of offset", + ExitError::OutOfGas => "out of gas", + ExitError::OutOfFund => "out of funds", + ExitError::Other(err) => err, + _ => "unexpected error", + } + .as_bytes() + .to_vec() +} + +impl ListenerT for Listener { + fn event(&mut self, event: Event) { + match event { + Event::Gasometer(gasometer_event) => self.gasometer_event(gasometer_event), + Event::Runtime(runtime_event) => self.runtime_event(runtime_event), + Event::Evm(evm_event) => self.evm_event(evm_event), + Event::CallListNew() => { + if !self.call_list_first_transaction { + self.finish_transaction(); + self.skip_next_context = false; + self.entries.push(BTreeMap::new()); + } else { + self.call_list_first_transaction = false; + } + } + }; + } + + fn step_event_filter(&self) -> StepEventFilter { + StepEventFilter { + enable_memory: false, + enable_stack: false, + } + } +} + +#[cfg(test)] +#[allow(unused)] +mod tests { + use super::*; + use ethereum_types::H256; + use evm_tracing_events::{ + evm::CreateScheme, + gasometer::Snapshot, + runtime::{Memory, Stack}, + Context as EvmContext, + }; + + enum TestEvmEvent { + Call, + Create, + Suicide, + Exit, + TransactCall, + TransactCreate, + TransactCreate2, + } + + enum TestRuntimeEvent { + Step, + StepResult, + SLoad, + SStore, + } + + enum TestGasometerEvent { + RecordCost, + RecordRefund, + RecordStipend, + RecordDynamicCost, + RecordTransaction, + } + + fn test_context() -> EvmContext { + EvmContext { + address: H160::default(), + caller: H160::default(), + apparent_value: U256::zero(), + } + } + + fn test_create_scheme() -> CreateScheme { + CreateScheme::Legacy { + caller: H160::default(), + } + } + + fn test_stack() -> Option { + None + } + + fn test_memory() -> Option { + None + } + + fn test_snapshot() -> Snapshot { + Snapshot { + gas_limit: 0u64, + memory_gas: 0u64, + used_gas: 0u64, + refunded_gas: 0i64, + } + } + + fn test_emit_evm_event( + event_type: TestEvmEvent, + is_static: bool, + exit_reason: Option, + ) -> EvmEvent { + match event_type { + TestEvmEvent::Call => EvmEvent::Call { + code_address: H160::default(), + transfer: None, + input: Vec::new(), + target_gas: None, + is_static, + context: test_context(), + }, + TestEvmEvent::Create => EvmEvent::Create { + caller: H160::default(), + address: H160::default(), + scheme: test_create_scheme(), + value: U256::zero(), + init_code: Vec::new(), + target_gas: None, + }, + TestEvmEvent::Suicide => EvmEvent::Suicide { + address: H160::default(), + target: H160::default(), + balance: U256::zero(), + }, + TestEvmEvent::Exit => EvmEvent::Exit { + reason: exit_reason.unwrap(), + return_value: Vec::new(), + }, + TestEvmEvent::TransactCall => EvmEvent::TransactCall { + caller: H160::default(), + address: H160::default(), + value: U256::zero(), + data: Vec::new(), + gas_limit: 0u64, + }, + TestEvmEvent::TransactCreate => EvmEvent::TransactCreate { + caller: H160::default(), + value: U256::zero(), + init_code: Vec::new(), + gas_limit: 0u64, + address: H160::default(), + }, + TestEvmEvent::TransactCreate2 => EvmEvent::TransactCreate2 { + caller: H160::default(), + value: U256::zero(), + init_code: Vec::new(), + salt: H256::default(), + gas_limit: 0u64, + address: H160::default(), + }, + } + } + + fn test_emit_runtime_event(event_type: TestRuntimeEvent) -> RuntimeEvent { + match event_type { + TestRuntimeEvent::Step => RuntimeEvent::Step { + context: test_context(), + opcode: Vec::new(), + position: Ok(0u64), + stack: test_stack(), + memory: test_memory(), + }, + TestRuntimeEvent::StepResult => RuntimeEvent::StepResult { + result: Ok(()), + return_value: Vec::new(), + }, + TestRuntimeEvent::SLoad => RuntimeEvent::SLoad { + address: H160::default(), + index: H256::default(), + value: H256::default(), + }, + TestRuntimeEvent::SStore => RuntimeEvent::SStore { + address: H160::default(), + index: H256::default(), + value: H256::default(), + }, + } + } + + fn test_emit_gasometer_event(event_type: TestGasometerEvent) -> GasometerEvent { + match event_type { + TestGasometerEvent::RecordCost => GasometerEvent::RecordCost { + cost: 0u64, + snapshot: test_snapshot(), + }, + TestGasometerEvent::RecordRefund => GasometerEvent::RecordRefund { + refund: 0i64, + snapshot: test_snapshot(), + }, + TestGasometerEvent::RecordStipend => GasometerEvent::RecordStipend { + stipend: 0u64, + snapshot: test_snapshot(), + }, + TestGasometerEvent::RecordDynamicCost => GasometerEvent::RecordDynamicCost { + gas_cost: 0u64, + memory_gas: 0u64, + gas_refund: 0i64, + snapshot: test_snapshot(), + }, + TestGasometerEvent::RecordTransaction => GasometerEvent::RecordTransaction { + cost: 0u64, + snapshot: test_snapshot(), + }, + } + } + + fn do_transact_call_event(listener: &mut Listener) { + listener.evm_event(test_emit_evm_event(TestEvmEvent::TransactCall, false, None)); + } + + fn do_transact_create_event(listener: &mut Listener) { + listener.evm_event(test_emit_evm_event( + TestEvmEvent::TransactCreate, + false, + None, + )); + } + + fn do_gasometer_event(listener: &mut Listener) { + listener.gasometer_event(test_emit_gasometer_event( + TestGasometerEvent::RecordTransaction, + )); + } + + fn do_exit_event(listener: &mut Listener) { + listener.evm_event(test_emit_evm_event( + TestEvmEvent::Exit, + false, + Some(ExitReason::Error(ExitError::OutOfGas)), + )); + } + + fn do_evm_call_event(listener: &mut Listener) { + listener.evm_event(test_emit_evm_event(TestEvmEvent::Call, false, None)); + } + + fn do_evm_create_event(listener: &mut Listener) { + listener.evm_event(test_emit_evm_event(TestEvmEvent::Create, false, None)); + } + + fn do_evm_suicide_event(listener: &mut Listener) { + listener.evm_event(test_emit_evm_event(TestEvmEvent::Suicide, false, None)); + } + + fn do_runtime_step_event(listener: &mut Listener) { + listener.runtime_event(test_emit_runtime_event(TestRuntimeEvent::Step)); + } + + fn do_runtime_step_result_event(listener: &mut Listener) { + listener.runtime_event(test_emit_runtime_event(TestRuntimeEvent::StepResult)); + } + + // Call context + + // Early exit on TransactionCost. + #[test] + fn call_early_exit_tx_cost() { + let mut listener = Listener::default(); + do_transact_call_event(&mut listener); + do_gasometer_event(&mut listener); + do_exit_event(&mut listener); + listener.finish_transaction(); + assert_eq!(listener.entries.len(), 1); + assert_eq!(listener.entries[0].len(), 1); + } + + // Early exit somewhere between the first callstack event and stepping the bytecode. + // I.e. precompile call. + #[test] + fn call_early_exit_before_runtime() { + let mut listener = Listener::default(); + do_transact_call_event(&mut listener); + do_gasometer_event(&mut listener); + do_evm_call_event(&mut listener); + do_exit_event(&mut listener); + listener.finish_transaction(); + assert_eq!(listener.entries.len(), 1); + assert_eq!(listener.entries[0].len(), 1); + } + + // Exit after Step without StepResult. + #[test] + fn call_step_without_step_result() { + let mut listener = Listener::default(); + do_transact_call_event(&mut listener); + do_gasometer_event(&mut listener); + do_evm_call_event(&mut listener); + do_runtime_step_event(&mut listener); + do_exit_event(&mut listener); + listener.finish_transaction(); + assert_eq!(listener.entries.len(), 1); + assert_eq!(listener.entries[0].len(), 1); + } + + // Exit after StepResult. + #[test] + fn call_step_result() { + let mut listener = Listener::default(); + do_transact_call_event(&mut listener); + do_gasometer_event(&mut listener); + do_evm_call_event(&mut listener); + do_runtime_step_event(&mut listener); + do_runtime_step_result_event(&mut listener); + do_exit_event(&mut listener); + listener.finish_transaction(); + assert_eq!(listener.entries.len(), 1); + assert_eq!(listener.entries[0].len(), 1); + } + + // Suicide. + #[test] + fn call_suicide() { + let mut listener = Listener::default(); + do_transact_call_event(&mut listener); + do_gasometer_event(&mut listener); + do_evm_call_event(&mut listener); + do_runtime_step_event(&mut listener); + do_evm_suicide_event(&mut listener); + do_exit_event(&mut listener); + listener.finish_transaction(); + assert_eq!(listener.entries.len(), 1); + assert_eq!(listener.entries[0].len(), 2); + } + + // Create context + + // Early exit on TransactionCost. + #[test] + fn create_early_exit_tx_cost() { + let mut listener = Listener::default(); + do_transact_create_event(&mut listener); + do_gasometer_event(&mut listener); + do_exit_event(&mut listener); + listener.finish_transaction(); + assert_eq!(listener.entries.len(), 1); + assert_eq!(listener.entries[0].len(), 1); + } + + // Early exit somewhere between the first callstack event and stepping the bytecode + // I.e. precompile call.. + #[test] + fn create_early_exit_before_runtime() { + let mut listener = Listener::default(); + do_transact_create_event(&mut listener); + do_gasometer_event(&mut listener); + do_evm_create_event(&mut listener); + do_exit_event(&mut listener); + listener.finish_transaction(); + assert_eq!(listener.entries.len(), 1); + assert_eq!(listener.entries[0].len(), 1); + } + + // Exit after Step without StepResult. + #[test] + fn create_step_without_step_result() { + let mut listener = Listener::default(); + do_transact_create_event(&mut listener); + do_gasometer_event(&mut listener); + do_evm_create_event(&mut listener); + do_runtime_step_event(&mut listener); + do_exit_event(&mut listener); + listener.finish_transaction(); + assert_eq!(listener.entries.len(), 1); + assert_eq!(listener.entries[0].len(), 1); + } + + // Exit after StepResult. + #[test] + fn create_step_result() { + let mut listener = Listener::default(); + do_transact_create_event(&mut listener); + do_gasometer_event(&mut listener); + do_evm_create_event(&mut listener); + do_runtime_step_event(&mut listener); + do_runtime_step_result_event(&mut listener); + do_exit_event(&mut listener); + listener.finish_transaction(); + assert_eq!(listener.entries.len(), 1); + assert_eq!(listener.entries[0].len(), 1); + } + + // Call Context Nested + + // Nested call early exit before stepping. + #[test] + fn nested_call_early_exit_before_runtime() { + let mut listener = Listener::default(); + // Main + do_transact_call_event(&mut listener); + do_gasometer_event(&mut listener); + do_evm_call_event(&mut listener); + do_runtime_step_event(&mut listener); + do_runtime_step_result_event(&mut listener); + // Nested + do_evm_call_event(&mut listener); + do_exit_event(&mut listener); + // Main exit + do_exit_event(&mut listener); + listener.finish_transaction(); + assert_eq!(listener.entries.len(), 1); + assert_eq!(listener.entries[0].len(), 2); + } + + // Nested exit before step result. + #[test] + fn nested_call_without_step_result() { + let mut listener = Listener::default(); + // Main + do_transact_call_event(&mut listener); + do_gasometer_event(&mut listener); + do_evm_call_event(&mut listener); + do_runtime_step_event(&mut listener); + do_runtime_step_result_event(&mut listener); + // Nested + do_evm_call_event(&mut listener); + do_runtime_step_event(&mut listener); + do_exit_event(&mut listener); + // Main exit + do_exit_event(&mut listener); + listener.finish_transaction(); + assert_eq!(listener.entries.len(), 1); + assert_eq!(listener.entries[0].len(), 2); + } + + // Nested exit. + #[test] + fn nested_call_step_result() { + let depth = 5; + let mut listener = Listener::default(); + // Main + do_transact_call_event(&mut listener); + do_gasometer_event(&mut listener); + do_evm_call_event(&mut listener); + do_runtime_step_event(&mut listener); + do_runtime_step_result_event(&mut listener); + // 5 nested calls + for d in 0..depth { + do_evm_call_event(&mut listener); + do_runtime_step_event(&mut listener); + do_runtime_step_result_event(&mut listener); + do_exit_event(&mut listener); + } + // Main exit + do_exit_event(&mut listener); + listener.finish_transaction(); + assert_eq!(listener.entries.len(), 1); + assert_eq!(listener.entries[0].len(), depth + 1); + } + + // Call + Create mixed subnesting. + + #[test] + fn subnested_call_and_create_mixbag() { + let depth = 5; + let subdepth = 10; + let mut listener = Listener::default(); + // Main + do_transact_call_event(&mut listener); + do_gasometer_event(&mut listener); + do_evm_call_event(&mut listener); + do_runtime_step_event(&mut listener); + do_runtime_step_result_event(&mut listener); + // 5 nested call/creates, each with 10 nested call/creates + for d in 0..depth { + if d % 2 == 0 { + do_evm_call_event(&mut listener); + } else { + do_evm_create_event(&mut listener); + } + do_runtime_step_event(&mut listener); + do_runtime_step_result_event(&mut listener); + for s in 0..subdepth { + // Some mixed call/create and early exits. + if s % 2 == 0 { + do_evm_call_event(&mut listener); + } else { + do_evm_create_event(&mut listener); + } + if s % 3 == 0 { + do_runtime_step_event(&mut listener); + do_runtime_step_result_event(&mut listener); + } + do_exit_event(&mut listener); + } + // Nested exit + do_exit_event(&mut listener); + } + // Main exit + do_exit_event(&mut listener); + listener.finish_transaction(); + assert_eq!(listener.entries.len(), 1); + // Each nested call contains 11 elements in the callstack (main + 10 subcalls). + // There are 5 main nested calls for a total of 56 elements in the callstack: 1 main + 55 nested. + assert_eq!(listener.entries[0].len(), (depth * (subdepth + 1)) + 1); + } +} diff --git a/vendor/client/evm-tracing/src/listeners/mod.rs b/vendor/client/evm-tracing/src/listeners/mod.rs new file mode 100644 index 00000000..5049d5f5 --- /dev/null +++ b/vendor/client/evm-tracing/src/listeners/mod.rs @@ -0,0 +1,21 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +pub mod call_list; +pub mod raw; + +pub use call_list::Listener as CallList; +pub use raw::Listener as Raw; diff --git a/vendor/client/evm-tracing/src/listeners/raw.rs b/vendor/client/evm-tracing/src/listeners/raw.rs new file mode 100644 index 00000000..c0d37c42 --- /dev/null +++ b/vendor/client/evm-tracing/src/listeners/raw.rs @@ -0,0 +1,339 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +use ethereum_types::{H160, H256}; +use std::{collections::btree_map::BTreeMap, vec, vec::Vec}; + +use crate::types::{convert_memory, single::RawStepLog, ContextType}; +use evm_tracing_events::{ + runtime::{Capture, ExitReason}, + Event, GasometerEvent, Listener as ListenerT, RuntimeEvent, StepEventFilter, +}; + +#[derive(Debug)] +pub struct Listener { + disable_storage: bool, + disable_memory: bool, + disable_stack: bool, + + new_context: bool, + context_stack: Vec, + + pub struct_logs: Vec, + pub return_value: Vec, + pub final_gas: u64, + pub remaining_memory_usage: Option, +} + +#[derive(Debug)] +struct Context { + storage_cache: BTreeMap, + address: H160, + current_step: Option, + global_storage_changes: BTreeMap>, +} + +#[derive(Debug)] +struct Step { + /// Current opcode. + opcode: Vec, + /// Depth of the context. + depth: usize, + /// Remaining gas. + gas: u64, + /// Gas cost of the following opcode. + gas_cost: u64, + /// Program counter position. + position: usize, + /// EVM memory copy (if not disabled). + memory: Option>, + /// EVM stack copy (if not disabled). + stack: Option>, +} + +impl Listener { + pub fn new( + disable_storage: bool, + disable_memory: bool, + disable_stack: bool, + raw_max_memory_usage: usize, + ) -> Self { + Self { + disable_storage, + disable_memory, + disable_stack, + remaining_memory_usage: Some(raw_max_memory_usage), + + struct_logs: vec![], + return_value: vec![], + final_gas: 0, + + new_context: false, + context_stack: vec![], + } + } + + pub fn using R>(&mut self, f: F) -> R { + evm_tracing_events::using(self, f) + } + + pub fn gasometer_event(&mut self, event: GasometerEvent) { + match event { + GasometerEvent::RecordTransaction { cost, .. } => { + // First event of a transaction. + // Next step will be the first context. + self.new_context = true; + self.final_gas = cost; + } + GasometerEvent::RecordCost { cost, snapshot } => { + if let Some(context) = self.context_stack.last_mut() { + // Register opcode cost. (ignore costs not between Step and StepResult) + if let Some(step) = &mut context.current_step { + step.gas = snapshot.gas(); + step.gas_cost = cost; + } + + self.final_gas = snapshot.used_gas; + } + } + GasometerEvent::RecordDynamicCost { + gas_cost, snapshot, .. + } => { + if let Some(context) = self.context_stack.last_mut() { + // Register opcode cost. (ignore costs not between Step and StepResult) + if let Some(step) = &mut context.current_step { + step.gas = snapshot.gas(); + step.gas_cost = gas_cost; + } + + self.final_gas = snapshot.used_gas; + } + } + // We ignore other kinds of message if any (new ones may be added in the future). + #[allow(unreachable_patterns)] + _ => (), + } + } + + pub fn runtime_event(&mut self, event: RuntimeEvent) { + match event { + RuntimeEvent::Step { + context, + opcode, + position, + stack, + memory, + } => { + // Create a context if needed. + if self.new_context { + self.new_context = false; + + self.context_stack.push(Context { + storage_cache: BTreeMap::new(), + address: context.address, + current_step: None, + global_storage_changes: BTreeMap::new(), + }); + } + + let depth = self.context_stack.len(); + + // Ignore steps outside of any context (shouldn't even be possible). + if let Some(context) = self.context_stack.last_mut() { + context.current_step = Some(Step { + opcode, + depth, + gas: 0, // 0 for now, will add with gas events + gas_cost: 0, // 0 for now, will add with gas events + position: *position.as_ref().unwrap_or(&0) as usize, + memory: if self.disable_memory { + None + } else { + let memory = memory.expect("memory data to not be filtered out"); + + self.remaining_memory_usage = self + .remaining_memory_usage + .and_then(|inner| inner.checked_sub(memory.data.len())); + + if self.remaining_memory_usage.is_none() { + return; + } + + Some(memory.data.clone()) + }, + stack: if self.disable_stack { + None + } else { + let stack = stack.expect("stack data to not be filtered out"); + + self.remaining_memory_usage = self + .remaining_memory_usage + .and_then(|inner| inner.checked_sub(stack.data.len())); + + if self.remaining_memory_usage.is_none() { + return; + } + + Some(stack.data.clone()) + }, + }); + } + } + RuntimeEvent::StepResult { + result, + return_value, + } => { + // StepResult is expected to be emited after a step (in a context). + // Only case StepResult will occur without a Step before is in a transfer + // transaction to a non-contract address. However it will not contain any + // steps and return an empty trace, so we can ignore this edge case. + if let Some(context) = self.context_stack.last_mut() { + if let Some(current_step) = context.current_step.take() { + let Step { + opcode, + depth, + gas, + gas_cost, + position, + memory, + stack, + } = current_step; + + let memory = memory.map(convert_memory); + + let storage = if self.disable_storage { + None + } else { + self.remaining_memory_usage = + self.remaining_memory_usage.and_then(|inner| { + inner.checked_sub(context.storage_cache.len() * 64) + }); + + if self.remaining_memory_usage.is_none() { + return; + } + + Some(context.storage_cache.clone()) + }; + + self.struct_logs.push(RawStepLog { + depth: depth.into(), + gas: gas.into(), + gas_cost: gas_cost.into(), + memory, + op: opcode, + pc: position.into(), + stack, + storage, + }); + } + } + + // We match on the capture to handle traps/exits. + match result { + Err(Capture::Exit(reason)) => { + // Exit = we exit the context (should always be some) + if let Some(mut context) = self.context_stack.pop() { + // If final context is exited, we store gas and return value. + if self.context_stack.is_empty() { + self.return_value = return_value.to_vec(); + } + + // If the context exited without revert we must keep track of the + // updated storage keys. + if !self.disable_storage && matches!(reason, ExitReason::Succeed(_)) { + if let Some(parent_context) = self.context_stack.last_mut() { + // Add cache to storage changes. + context + .global_storage_changes + .insert(context.address, context.storage_cache); + + // Apply storage changes to parent, either updating its cache or map of changes. + for (address, mut storage) in + context.global_storage_changes.into_iter() + { + // Same address => We update its cache (only tracked keys) + if parent_context.address == address { + for (cached_key, cached_value) in + parent_context.storage_cache.iter_mut() + { + if let Some(value) = storage.remove(cached_key) { + *cached_value = value; + } + } + } + // Otherwise, update the storage changes. + else { + parent_context + .global_storage_changes + .entry(address) + .or_insert_with(BTreeMap::new) + .append(&mut storage); + } + } + } + } + } + } + Err(Capture::Trap(opcode)) if ContextType::from(opcode.clone()).is_some() => { + self.new_context = true; + } + _ => (), + } + } + RuntimeEvent::SLoad { + address: _, + index, + value, + } + | RuntimeEvent::SStore { + address: _, + index, + value, + } => { + if let Some(context) = self.context_stack.last_mut() { + if !self.disable_storage { + context.storage_cache.insert(index, value); + } + } + } + // We ignore other kinds of message if any (new ones may be added in the future). + #[allow(unreachable_patterns)] + _ => (), + } + } +} + +impl ListenerT for Listener { + fn event(&mut self, event: Event) { + if self.remaining_memory_usage.is_none() { + return; + } + + match event { + Event::Gasometer(e) => self.gasometer_event(e), + Event::Runtime(e) => self.runtime_event(e), + _ => {} + }; + } + + fn step_event_filter(&self) -> StepEventFilter { + StepEventFilter { + enable_memory: !self.disable_memory, + enable_stack: !self.disable_stack, + } + } +} diff --git a/vendor/client/evm-tracing/src/types/block.rs b/vendor/client/evm-tracing/src/types/block.rs new file mode 100644 index 00000000..58052d02 --- /dev/null +++ b/vendor/client/evm-tracing/src/types/block.rs @@ -0,0 +1,97 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! Types for tracing all Ethereum transactions of a block. + +use super::serialization::*; +use serde::Serialize; + +use ethereum_types::{H160, H256, U256}; +use parity_scale_codec::{Decode, Encode}; +use sp_std::vec::Vec; + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct TransactionTrace { + #[serde(flatten)] + pub action: TransactionTraceAction, + #[serde(serialize_with = "h256_0x_serialize")] + pub block_hash: H256, + pub block_number: u32, + #[serde(flatten)] + pub output: TransactionTraceOutput, + pub subtraces: u32, + pub trace_address: Vec, + #[serde(serialize_with = "h256_0x_serialize")] + pub transaction_hash: H256, + pub transaction_position: u32, +} + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode, Serialize)] +#[serde(rename_all = "camelCase", tag = "type", content = "action")] +pub enum TransactionTraceAction { + #[serde(rename_all = "camelCase")] + Call { + call_type: super::CallType, + from: H160, + gas: U256, + #[serde(serialize_with = "bytes_0x_serialize")] + input: Vec, + to: H160, + value: U256, + }, + #[serde(rename_all = "camelCase")] + Create { + creation_method: super::CreateType, + from: H160, + gas: U256, + #[serde(serialize_with = "bytes_0x_serialize")] + init: Vec, + value: U256, + }, + #[serde(rename_all = "camelCase")] + Suicide { + address: H160, + balance: U256, + refund_address: H160, + }, +} + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode, Serialize)] +#[serde(rename_all = "camelCase")] +pub enum TransactionTraceOutput { + Result(TransactionTraceResult), + Error(#[serde(serialize_with = "string_serialize")] Vec), +} + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode, Serialize)] +#[serde(rename_all = "camelCase", untagged)] +pub enum TransactionTraceResult { + #[serde(rename_all = "camelCase")] + Call { + gas_used: U256, + #[serde(serialize_with = "bytes_0x_serialize")] + output: Vec, + }, + #[serde(rename_all = "camelCase")] + Create { + address: H160, + #[serde(serialize_with = "bytes_0x_serialize")] + code: Vec, + gas_used: U256, + }, + Suicide, +} diff --git a/vendor/client/evm-tracing/src/types/mod.rs b/vendor/client/evm-tracing/src/types/mod.rs new file mode 100644 index 00000000..477df07f --- /dev/null +++ b/vendor/client/evm-tracing/src/types/mod.rs @@ -0,0 +1,113 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! Runtime API allowing to debug/trace Ethereum + +extern crate alloc; + +use ethereum_types::{H160, H256}; +use parity_scale_codec::{Decode, Encode}; +use sp_std::vec::Vec; + +pub mod block; +pub mod serialization; +pub mod single; + +use serde::Serialize; +use serialization::*; + +pub const MANUAL_BLOCK_INITIALIZATION_RUNTIME_VERSION: u32 = 159; + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode, Serialize)] +#[serde(rename_all = "camelCase")] +pub enum CallResult { + Output(#[serde(serialize_with = "bytes_0x_serialize")] Vec), + // field "error" + Error(#[serde(serialize_with = "string_serialize")] Vec), +} + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode, Serialize)] +#[serde(rename_all = "camelCase", untagged)] +pub enum CreateResult { + Error { + #[serde(serialize_with = "string_serialize")] + error: Vec, + }, + Success { + #[serde(rename = "createdContractAddressHash")] + created_contract_address_hash: H160, + #[serde(serialize_with = "bytes_0x_serialize", rename = "createdContractCode")] + created_contract_code: Vec, + }, +} + +#[derive(Clone, Copy, Eq, PartialEq, Debug, Encode, Decode, Serialize)] +#[serde(rename_all = "lowercase")] +pub enum CallType { + Call, + CallCode, + DelegateCall, + StaticCall, +} + +#[derive(Clone, Copy, Eq, PartialEq, Debug, Encode, Decode, Serialize)] +#[serde(rename_all = "lowercase")] +pub enum CreateType { + Create, +} + +#[derive(Debug)] +pub enum ContextType { + Call(CallType), + Create, +} + +impl ContextType { + pub fn from(opcode: Vec) -> Option { + let opcode = match alloc::str::from_utf8(&opcode[..]) { + Ok(op) => op.to_uppercase(), + _ => return None, + }; + match &opcode[..] { + "CREATE" | "CREATE2" => Some(ContextType::Create), + "CALL" => Some(ContextType::Call(CallType::Call)), + "CALLCODE" => Some(ContextType::Call(CallType::CallCode)), + "DELEGATECALL" => Some(ContextType::Call(CallType::DelegateCall)), + "STATICCALL" => Some(ContextType::Call(CallType::StaticCall)), + _ => None, + } + } +} + +pub fn convert_memory(memory: Vec) -> Vec { + let size = 32; + memory + .chunks(size) + .map(|c| { + let mut msg = [0u8; 32]; + let chunk = c.len(); + if chunk < size { + let left = size - chunk; + let remainder = vec![0; left]; + msg[0..left].copy_from_slice(&remainder[..]); + msg[left..size].copy_from_slice(c); + } else { + msg[0..size].copy_from_slice(c) + } + H256::from_slice(&msg[..]) + }) + .collect() +} diff --git a/vendor/client/evm-tracing/src/types/serialization.rs b/vendor/client/evm-tracing/src/types/serialization.rs new file mode 100644 index 00000000..6848f910 --- /dev/null +++ b/vendor/client/evm-tracing/src/types/serialization.rs @@ -0,0 +1,113 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! Provide serialization functions for various types and formats. + +use ethereum_types::{H256, U256}; +use serde::{ + ser::{Error, SerializeSeq}, + Serializer, +}; + +pub fn seq_h256_serialize(data: &Option>, serializer: S) -> Result +where + S: Serializer, +{ + if let Some(vec) = data { + let mut seq = serializer.serialize_seq(Some(vec.len()))?; + for hash in vec { + seq.serialize_element(&format!("{:x}", hash))?; + } + seq.end() + } else { + let seq = serializer.serialize_seq(Some(0))?; + seq.end() + } +} + +pub fn bytes_0x_serialize(bytes: &[u8], serializer: S) -> Result +where + S: Serializer, +{ + serializer.serialize_str(&format!("0x{}", hex::encode(bytes))) +} + +pub fn option_bytes_0x_serialize( + bytes: &Option>, + serializer: S, +) -> Result +where + S: Serializer, +{ + if let Some(bytes) = bytes.as_ref() { + return serializer.serialize_str(&format!("0x{}", hex::encode(&bytes[..]))); + } + Err(S::Error::custom("String serialize error.")) +} + +pub fn opcode_serialize(opcode: &[u8], serializer: S) -> Result +where + S: Serializer, +{ + let d = std::str::from_utf8(opcode) + .map_err(|_| S::Error::custom("Opcode serialize error."))? + .to_uppercase(); + serializer.serialize_str(&d) +} + +pub fn string_serialize(value: &[u8], serializer: S) -> Result +where + S: Serializer, +{ + let d = std::str::from_utf8(value) + .map_err(|_| S::Error::custom("String serialize error."))? + .to_string(); + serializer.serialize_str(&d) +} + +pub fn option_string_serialize(value: &Option>, serializer: S) -> Result +where + S: Serializer, +{ + if let Some(value) = value.as_ref() { + let d = std::str::from_utf8(&value[..]) + .map_err(|_| S::Error::custom("String serialize error."))? + .to_string(); + return serializer.serialize_str(&d); + } + Err(S::Error::custom("String serialize error.")) +} + +pub fn u256_serialize(data: &U256, serializer: S) -> Result +where + S: Serializer, +{ + serializer.serialize_u64(data.low_u64()) +} + +pub fn h256_serialize(data: &H256, serializer: S) -> Result +where + S: Serializer, +{ + serializer.serialize_str(&format!("{:x}", data)) +} + +pub fn h256_0x_serialize(data: &H256, serializer: S) -> Result +where + S: Serializer, +{ + serializer.serialize_str(&format!("0x{:x}", data)) +} diff --git a/vendor/client/evm-tracing/src/types/single.rs b/vendor/client/evm-tracing/src/types/single.rs new file mode 100644 index 00000000..02e08650 --- /dev/null +++ b/vendor/client/evm-tracing/src/types/single.rs @@ -0,0 +1,102 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! Types for the tracing of a single Ethereum transaction. +//! Structure from "raw" debug_trace and a "call list" matching +//! Blockscout formatter. This "call list" is also used to build +//! the whole block tracing output. + +use super::serialization::*; +use serde::Serialize; + +use ethereum_types::{H256, U256}; +use parity_scale_codec::{Decode, Encode}; +use sp_std::{collections::btree_map::BTreeMap, vec::Vec}; + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode, Serialize)] +#[serde(rename_all = "camelCase", untagged)] +pub enum Call { + Blockscout(crate::formatters::blockscout::BlockscoutCall), + CallTracer(crate::formatters::call_tracer::CallTracerCall), +} + +#[derive(Clone, Copy, Eq, PartialEq, Debug, Encode, Decode)] +pub enum TraceType { + /// Classic geth with no javascript based tracing. + Raw { + disable_storage: bool, + disable_memory: bool, + disable_stack: bool, + }, + /// List of calls and subcalls formatted with an input tracer (i.e. callTracer or Blockscout). + CallList, + /// A single block trace. Use in `debug_traceTransactionByNumber` / `traceTransactionByHash`. + Block, +} + +/// Single transaction trace. +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode, Serialize)] +#[serde(rename_all = "camelCase", untagged)] +pub enum TransactionTrace { + /// Classical output of `debug_trace`. + #[serde(rename_all = "camelCase")] + Raw { + gas: U256, + #[serde(with = "hex")] + return_value: Vec, + struct_logs: Vec, + }, + /// Matches the formatter used by Blockscout. + /// Is also used to built output of OpenEthereum's `trace_filter`. + CallList(Vec), + /// Used by Geth's callTracer. + CallListNested(Call), +} + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct RawStepLog { + #[serde(serialize_with = "u256_serialize")] + pub depth: U256, + + //error: TODO + #[serde(serialize_with = "u256_serialize")] + pub gas: U256, + + #[serde(serialize_with = "u256_serialize")] + pub gas_cost: U256, + + #[serde( + serialize_with = "seq_h256_serialize", + skip_serializing_if = "Option::is_none" + )] + pub memory: Option>, + + #[serde(serialize_with = "opcode_serialize")] + pub op: Vec, + + #[serde(serialize_with = "u256_serialize")] + pub pc: U256, + + #[serde( + serialize_with = "seq_h256_serialize", + skip_serializing_if = "Option::is_none" + )] + pub stack: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + pub storage: Option>, +} diff --git a/vendor/client/rpc/debug/Cargo.toml b/vendor/client/rpc/debug/Cargo.toml new file mode 100644 index 00000000..19578062 --- /dev/null +++ b/vendor/client/rpc/debug/Cargo.toml @@ -0,0 +1,39 @@ +[package] +name = "moonbeam-rpc-debug" +authors = { workspace = true } +edition = "2021" +homepage = "https://moonbeam.network" +license = "GPL-3.0-only" +repository = { workspace = true } +version = "0.1.0" + +[dependencies] +futures = { workspace = true, features = [ "compat" ] } +hex-literal = { workspace = true } +jsonrpsee = { workspace = true, features = [ "macros", "server" ] } +tokio = { workspace = true, features = [ "sync", "time" ] } + +# Moonbeam +moonbeam-client-evm-tracing = { workspace = true } +moonbeam-rpc-core-debug = { workspace = true } +moonbeam-rpc-core-types = { workspace = true } +moonbeam-rpc-primitives-debug = { workspace = true, features = [ "std" ] } + +# Substrate +sc-client-api = { workspace = true } +sc-utils = { workspace = true } +sp-api = { workspace = true, features = [ "std" ] } +sp-block-builder = { workspace = true, features = [ "std" ] } +sp-blockchain = { workspace = true } +sp-core = { workspace = true, features = [ "std" ] } +sp-io = { workspace = true, features = [ "std" ] } +sp-runtime = { workspace = true, features = [ "std" ] } + +# Frontier +ethereum = { workspace = true, features = [ "std", "with-codec" ] } +ethereum-types = { workspace = true, features = [ "std" ] } +fc-consensus = { workspace = true } +fc-db = { workspace = true } +fc-rpc = { workspace = true, features = [ "rpc-binary-search-estimate" ] } +fc-storage = { workspace = true } +fp-rpc = { workspace = true, features = [ "std" ] } diff --git a/vendor/client/rpc/debug/README.md b/vendor/client/rpc/debug/README.md new file mode 100644 index 00000000..d46462f2 --- /dev/null +++ b/vendor/client/rpc/debug/README.md @@ -0,0 +1,94 @@ +A port crate of some of the tracing related rpc requests from the go-ethereum [debug namespace](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug). Includes `debug_traceTransaction`, `debug_traceBlockByNumber` and `debug_traceBlockByHash`. + +## How tracing works in Moonbeam + +Runtime wasms compiled with the `tracing` evm feature will emit events related to entering/exiting substates or opcode execution. This events are used by developers or indexer services to get a granular view on an evm transaction. + +Tracing wasms for each moonbeam/river/base runtime versions live at `moonbeam-runtime-overrides` repository in github. + +Tracing functionality in Moonbeam makes heavy use of [environmental](https://docs.rs/environmental/latest/environmental/): + +- The rpc request must create a runtime api instance to replay the transaction. The runtime api call is made `using` `environmental`. +- Once in the wasm, the target evm transaction is replayed by calling the evm also `using` `environmental`. +- This allows: + 1. Listen to new events from the evm in the moonbeam runtime wasm. + 2. Proxy those events to the client (through a host function), which is also listening for events from the runtime. +- This way we don't make use of (limited) wasm memory, and instead store the evm emitted events content in the client. + +Once the evm execution concludes, the runtime context exited and all events have been stored in the client memory, we support formatting the captured events in different ways that are convenient for the end-user, like raw format (opcode level tracing), callTracer (used as a default formatter by geth) or blockscout custom tracer. + +## On Runtime Api versioning + +This text aims to describe the process of adding new Runtime Api versions and supporting old ones. + +### How to create a Runtime Api version + +``` +sp_api::decl_runtime_apis! { + pub trait DebugRuntimeApi { + fn trace_transaction( + extrinsics: Vec, + transaction: &Transaction, + trace_type: single::TraceType, + ) -> Result; + } +} +``` + +For the `trace_transaction` method above, we need a new header argument, and the response will no longer be a single::TransactionTrace but an empty result () because we will handle the result client side using environmental. + +Becomes: + +``` +sp_api::decl_runtime_apis! { + #[api_version(2)] + pub trait DebugRuntimeApi { + + #[changed_in(2)] + fn trace_transaction( + extrinsics: Vec, + transaction: &Transaction, + trace_type: single::TraceType, + ) -> Result; + + fn trace_transaction( + header: &Block::Header, + extrinsics: Vec, + transaction: &Transaction, + trace_type: single::TraceType, + ) -> Result<(), sp_runtime::DispatchError>; + } +} +``` + +Substrate provides two macro attributes to do what we want: `api_version` and `changed_in`. + +- `api_version`: is the current version of the Api. In our case we updated it to `#[api_version(2)]`. +- changed_in: is meant to describe for `decl_runtime_apis` macro past implementations of methods. In this case, we anotate our previous implementation with `#[changed_in(2)]`, telling the `decl_runtime_apis` macro that this is the implementation to use before version 2. In fact, this attribute will rename the method name for the trait in the client side to `METHOD_before_version_VERSION`, so `trace_transaction_before_version_2` in our example. + +The un-anotated method is considered the default implemetation, and holds the current `trace_transaction` signature, with the new header argument and the empty result. + +### Using a versioned runtime api from the client + +To identify which version to use depending on the Api version of the height we want to access the runtime in, we will use the `api_version` method available on a runtime api instance: + +``` +let api_version = api + .api_version::>(&MY_BLOCK_ID) + .map_err(|e| internal_err(format!("Runtime api access error: {:?}", e)))? + .ok_or_else(|| { + internal_err(format!( + "Could not find `DebugRuntimeApi` at {:?}.", + MY_BLOCK_ID + )) + })?; + +// ... +if api_version >= 2 { + api.trace_transaction(&MY_BLOCK_ID, &MY_HEADER, ...) +} else { + api.trace_transaction_before_version_2(&MY_BLOCK_ID, ...) +} +``` + +In the example above we updated the result type, that means we will need different logics to handle the response for each version in the client. This support needs to cover all versions added historically for any Runtime Api from genesis, as well as all have access to all the primitives that exist or existed in the runtime api methods' signatures. diff --git a/vendor/client/rpc/debug/src/lib.rs b/vendor/client/rpc/debug/src/lib.rs new file mode 100644 index 00000000..e8da6bf5 --- /dev/null +++ b/vendor/client/rpc/debug/src/lib.rs @@ -0,0 +1,598 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . +use futures::StreamExt; +use jsonrpsee::core::{async_trait, RpcResult}; +pub use moonbeam_rpc_core_debug::{DebugServer, TraceParams}; + +use tokio::{ + self, + sync::{oneshot, Semaphore}, +}; + +use ethereum_types::H256; +use fc_rpc::{frontier_backend_client, internal_err, OverrideHandle}; +use fp_rpc::EthereumRuntimeRPCApi; +use moonbeam_client_evm_tracing::{formatters::ResponseFormatter, types::single}; +use moonbeam_rpc_core_types::{RequestBlockId, RequestBlockTag}; +use moonbeam_rpc_primitives_debug::{DebugRuntimeApi, TracerInput}; +use sc_client_api::backend::{Backend, StateBackend, StorageProvider}; +use sc_utils::mpsc::TracingUnboundedSender; +use sp_api::{ApiExt, BlockId, Core, HeaderT, ProvideRuntimeApi}; +use sp_block_builder::BlockBuilder; +use sp_blockchain::{ + Backend as BlockchainBackend, Error as BlockChainError, HeaderBackend, HeaderMetadata, +}; +use sp_runtime::traits::{BlakeTwo256, Block as BlockT, UniqueSaturatedInto}; +use std::{future::Future, marker::PhantomData, sync::Arc}; + +pub enum RequesterInput { + Transaction(H256), + Block(RequestBlockId), +} + +pub enum Response { + Single(single::TransactionTrace), + Block(Vec), +} + +pub type Responder = oneshot::Sender>; +pub type DebugRequester = + TracingUnboundedSender<((RequesterInput, Option), Responder)>; + +pub struct Debug { + pub requester: DebugRequester, +} + +impl Debug { + pub fn new(requester: DebugRequester) -> Self { + Self { requester } + } +} + +#[async_trait] +impl DebugServer for Debug { + /// Handler for `debug_traceTransaction` request. Communicates with the service-defined task + /// using channels. + async fn trace_transaction( + &self, + transaction_hash: H256, + params: Option, + ) -> RpcResult { + let requester = self.requester.clone(); + + let (tx, rx) = oneshot::channel(); + // Send a message from the rpc handler to the service level task. + requester + .unbounded_send(((RequesterInput::Transaction(transaction_hash), params), tx)) + .map_err(|err| { + internal_err(format!( + "failed to send request to debug service : {:?}", + err + )) + })?; + + // Receive a message from the service level task and send the rpc response. + rx.await + .map_err(|err| internal_err(format!("debug service dropped the channel : {:?}", err)))? + .map(|res| match res { + Response::Single(res) => res, + _ => unreachable!(), + }) + } + + async fn trace_block( + &self, + id: RequestBlockId, + params: Option, + ) -> RpcResult> { + let requester = self.requester.clone(); + + let (tx, rx) = oneshot::channel(); + // Send a message from the rpc handler to the service level task. + requester + .unbounded_send(((RequesterInput::Block(id), params), tx)) + .map_err(|err| { + internal_err(format!( + "failed to send request to debug service : {:?}", + err + )) + })?; + + // Receive a message from the service level task and send the rpc response. + rx.await + .map_err(|err| internal_err(format!("debug service dropped the channel : {:?}", err)))? + .map(|res| match res { + Response::Block(res) => res, + _ => unreachable!(), + }) + } +} + +pub struct DebugHandler(PhantomData<(B, C, BE)>); + +impl DebugHandler +where + BE: Backend + 'static, + BE::State: StateBackend, + C: ProvideRuntimeApi, + C: StorageProvider, + C: HeaderMetadata + HeaderBackend, + C: Send + Sync + 'static, + B: BlockT + Send + Sync + 'static, + C::Api: BlockBuilder, + C::Api: DebugRuntimeApi, + C::Api: EthereumRuntimeRPCApi, + C::Api: ApiExt, +{ + /// Task spawned at service level that listens for messages on the rpc channel and spawns + /// blocking tasks using a permit pool. + pub fn task( + client: Arc, + backend: Arc, + frontier_backend: Arc + Send + Sync>, + permit_pool: Arc, + overrides: Arc>, + raw_max_memory_usage: usize, + ) -> (impl Future, DebugRequester) { + let (tx, mut rx): (DebugRequester, _) = + sc_utils::mpsc::tracing_unbounded("debug-requester"); + + let fut = async move { + loop { + match rx.next().await { + Some(( + (RequesterInput::Transaction(transaction_hash), params), + response_tx, + )) => { + let client = client.clone(); + let backend = backend.clone(); + let frontier_backend = frontier_backend.clone(); + let permit_pool = permit_pool.clone(); + let overrides = overrides.clone(); + + tokio::task::spawn(async move { + let _ = response_tx.send( + async { + let _permit = permit_pool.acquire().await; + tokio::task::spawn_blocking(move || { + Self::handle_transaction_request( + client.clone(), + backend.clone(), + frontier_backend.clone(), + transaction_hash, + params, + overrides.clone(), + raw_max_memory_usage, + ) + }) + .await + .map_err(|e| { + internal_err(format!( + "Internal error on spawned task : {:?}", + e + )) + })? + } + .await, + ); + }); + } + Some(((RequesterInput::Block(request_block_id), params), response_tx)) => { + let client = client.clone(); + let backend = backend.clone(); + let frontier_backend = frontier_backend.clone(); + let permit_pool = permit_pool.clone(); + let overrides = overrides.clone(); + + tokio::task::spawn(async move { + let _ = response_tx.send( + async { + let _permit = permit_pool.acquire().await; + + tokio::task::spawn_blocking(move || { + Self::handle_block_request( + client.clone(), + backend.clone(), + frontier_backend.clone(), + request_block_id, + params, + overrides.clone(), + ) + }) + .await + .map_err(|e| { + internal_err(format!( + "Internal error on spawned task : {:?}", + e + )) + })? + } + .await, + ); + }); + } + _ => {} + } + } + }; + (fut, tx) + } + + fn handle_params(params: Option) -> RpcResult<(TracerInput, single::TraceType)> { + // Set trace input and type + match params { + Some(TraceParams { + tracer: Some(tracer), + .. + }) => { + const BLOCKSCOUT_JS_CODE_HASH: [u8; 16] = + hex_literal::hex!("94d9f08796f91eb13a2e82a6066882f7"); + const BLOCKSCOUT_JS_CODE_HASH_V2: [u8; 16] = + hex_literal::hex!("89db13694675692951673a1e6e18ff02"); + let hash = sp_io::hashing::twox_128(&tracer.as_bytes()); + let tracer = + if hash == BLOCKSCOUT_JS_CODE_HASH || hash == BLOCKSCOUT_JS_CODE_HASH_V2 { + Some(TracerInput::Blockscout) + } else if tracer == "callTracer" { + Some(TracerInput::CallTracer) + } else { + None + }; + if let Some(tracer) = tracer { + Ok((tracer, single::TraceType::CallList)) + } else { + return Err(internal_err(format!( + "javascript based tracing is not available (hash :{:?})", + hash + ))); + } + } + Some(params) => Ok(( + TracerInput::None, + single::TraceType::Raw { + disable_storage: params.disable_storage.unwrap_or(false), + disable_memory: params.disable_memory.unwrap_or(false), + disable_stack: params.disable_stack.unwrap_or(false), + }, + )), + _ => Ok(( + TracerInput::None, + single::TraceType::Raw { + disable_storage: false, + disable_memory: false, + disable_stack: false, + }, + )), + } + } + + fn handle_block_request( + client: Arc, + backend: Arc, + frontier_backend: Arc + Send + Sync>, + request_block_id: RequestBlockId, + params: Option, + overrides: Arc>, + ) -> RpcResult { + let (tracer_input, trace_type) = Self::handle_params(params)?; + + let reference_id: BlockId = match request_block_id { + RequestBlockId::Number(n) => Ok(BlockId::Number(n.unique_saturated_into())), + RequestBlockId::Tag(RequestBlockTag::Latest) => { + Ok(BlockId::Number(client.info().best_number)) + } + RequestBlockId::Tag(RequestBlockTag::Earliest) => { + Ok(BlockId::Number(0u32.unique_saturated_into())) + } + RequestBlockId::Tag(RequestBlockTag::Pending) => { + Err(internal_err("'pending' blocks are not supported")) + } + RequestBlockId::Hash(eth_hash) => { + match futures::executor::block_on(frontier_backend_client::load_hash::( + client.as_ref(), + frontier_backend.as_ref(), + eth_hash, + )) { + Ok(Some(hash)) => Ok(BlockId::Hash(hash)), + Ok(_) => Err(internal_err("Block hash not found".to_string())), + Err(e) => Err(e), + } + } + }?; + + // Get ApiRef. This handle allow to keep changes between txs in an internal buffer. + let api = client.runtime_api(); + // Get Blockchain backend + let blockchain = backend.blockchain(); + // Get the header I want to work with. + let Ok(hash) = client.expect_block_hash_from_id(&reference_id) else { + return Err(internal_err("Block header not found")) + }; + let header = match client.header(hash) { + Ok(Some(h)) => h, + _ => return Err(internal_err("Block header not found")), + }; + + // Get parent blockid. + let parent_block_hash = *header.parent_hash(); + + let schema = fc_storage::onchain_storage_schema::(client.as_ref(), hash); + + // Using storage overrides we align with `:ethereum_schema` which will result in proper + // SCALE decoding in case of migration. + let statuses = match overrides.schemas.get(&schema) { + Some(schema) => schema + .current_transaction_statuses(hash) + .unwrap_or_default(), + _ => { + return Err(internal_err(format!( + "No storage override at {:?}", + reference_id + ))) + } + }; + + // Known ethereum transaction hashes. + let eth_tx_hashes: Vec<_> = statuses.iter().map(|t| t.transaction_hash).collect(); + + // If there are no ethereum transactions in the block return empty trace right away. + if eth_tx_hashes.is_empty() { + return Ok(Response::Block(vec![])); + } + + // Get block extrinsics. + let exts = blockchain + .body(hash) + .map_err(|e| internal_err(format!("Fail to read blockchain db: {:?}", e)))? + .unwrap_or_default(); + + // Trace the block. + let f = || -> RpcResult<_> { + api.initialize_block(parent_block_hash, &header) + .map_err(|e| internal_err(format!("Runtime api access error: {:?}", e)))?; + + let _result = api + .trace_block(parent_block_hash, exts, eth_tx_hashes) + .map_err(|e| { + internal_err(format!( + "Blockchain error when replaying block {} : {:?}", + reference_id, e + )) + })? + .map_err(|e| { + internal_err(format!( + "Internal runtime error when replaying block {} : {:?}", + reference_id, e + )) + })?; + Ok(moonbeam_rpc_primitives_debug::Response::Block) + }; + + return match trace_type { + single::TraceType::CallList => { + let mut proxy = moonbeam_client_evm_tracing::listeners::CallList::default(); + proxy.using(f)?; + proxy.finish_transaction(); + let response = match tracer_input { + TracerInput::CallTracer => { + moonbeam_client_evm_tracing::formatters::CallTracer::format(proxy) + .ok_or("Trace result is empty.") + .map_err(|e| internal_err(format!("{:?}", e))) + } + _ => Err(internal_err( + "Bug: failed to resolve the tracer format.".to_string(), + )), + }?; + + Ok(Response::Block(response)) + } + _ => Err(internal_err( + "debug_traceBlock functions currently only support callList mode (enabled + by providing `{{'tracer': 'callTracer'}}` in the request)." + .to_string(), + )), + }; + } + + /// Replays a transaction in the Runtime at a given block height. + /// + /// In order to succesfully reproduce the result of the original transaction we need a correct + /// state to replay over. + /// + /// Substrate allows to apply extrinsics in the Runtime and thus creating an overlayed state. + /// This overlayed changes will live in-memory for the lifetime of the ApiRef. + fn handle_transaction_request( + client: Arc, + backend: Arc, + frontier_backend: Arc + Send + Sync>, + transaction_hash: H256, + params: Option, + overrides: Arc>, + raw_max_memory_usage: usize, + ) -> RpcResult { + let (tracer_input, trace_type) = Self::handle_params(params)?; + + let (hash, index) = + match futures::executor::block_on(frontier_backend_client::load_transactions::( + client.as_ref(), + frontier_backend.as_ref(), + transaction_hash, + false, + )) { + Ok(Some((hash, index))) => (hash, index as usize), + Ok(None) => return Err(internal_err("Transaction hash not found".to_string())), + Err(e) => return Err(e), + }; + + let reference_id = + match futures::executor::block_on(frontier_backend_client::load_hash::( + client.as_ref(), + frontier_backend.as_ref(), + hash, + )) { + Ok(Some(hash)) => BlockId::Hash(hash), + Ok(_) => return Err(internal_err("Block hash not found".to_string())), + Err(e) => return Err(e), + }; + // Get ApiRef. This handle allow to keep changes between txs in an internal buffer. + let api = client.runtime_api(); + // Get Blockchain backend + let blockchain = backend.blockchain(); + // Get the header I want to work with. + let Ok(reference_hash) = client.expect_block_hash_from_id(&reference_id) else { + return Err(internal_err("Block header not found")) + }; + let header = match client.header(reference_hash) { + Ok(Some(h)) => h, + _ => return Err(internal_err("Block header not found")), + }; + // Get parent blockid. + let parent_block_hash = *header.parent_hash(); + + // Get block extrinsics. + let exts = blockchain + .body(reference_hash) + .map_err(|e| internal_err(format!("Fail to read blockchain db: {:?}", e)))? + .unwrap_or_default(); + + // Get DebugRuntimeApi version + let trace_api_version = if let Ok(Some(api_version)) = + api.api_version::>(parent_block_hash) + { + api_version + } else { + return Err(internal_err( + "Runtime api version call failed (trace)".to_string(), + )); + }; + + let schema = + fc_storage::onchain_storage_schema::(client.as_ref(), reference_hash); + + // Get the block that contains the requested transaction. Using storage overrides we align + // with `:ethereum_schema` which will result in proper SCALE decoding in case of migration. + let reference_block = match overrides.schemas.get(&schema) { + Some(schema) => schema.current_block(reference_hash), + _ => { + return Err(internal_err(format!( + "No storage override at {:?}", + reference_hash + ))) + } + }; + + // Get the actual ethereum transaction. + if let Some(block) = reference_block { + let transactions = block.transactions; + if let Some(transaction) = transactions.get(index) { + let f = || -> RpcResult<_> { + api.initialize_block(parent_block_hash, &header) + .map_err(|e| internal_err(format!("Runtime api access error: {:?}", e)))?; + + if trace_api_version >= 4 { + let _result = api + .trace_transaction(parent_block_hash, exts, &transaction) + .map_err(|e| { + internal_err(format!( + "Runtime api access error (version {:?}): {:?}", + trace_api_version, e + )) + })? + .map_err(|e| internal_err(format!("DispatchError: {:?}", e)))?; + } else { + // Pre-london update, legacy transactions. + let _result = match transaction { + ethereum::TransactionV2::Legacy(tx) => + { + #[allow(deprecated)] + api.trace_transaction_before_version_4(parent_block_hash, exts, &tx) + .map_err(|e| { + internal_err(format!( + "Runtime api access error (legacy): {:?}", + e + )) + })? + .map_err(|e| internal_err(format!("DispatchError: {:?}", e)))? + } + _ => { + return Err(internal_err( + "Bug: pre-london runtime expects legacy transactions" + .to_string(), + )) + } + }; + } + + Ok(moonbeam_rpc_primitives_debug::Response::Single) + }; + + return match trace_type { + single::TraceType::Raw { + disable_storage, + disable_memory, + disable_stack, + } => { + let mut proxy = moonbeam_client_evm_tracing::listeners::Raw::new( + disable_storage, + disable_memory, + disable_stack, + raw_max_memory_usage, + ); + proxy.using(f)?; + Ok(Response::Single( + moonbeam_client_evm_tracing::formatters::Raw::format(proxy).ok_or( + internal_err( + "replayed transaction generated too much data. \ + try disabling memory or storage?", + ), + )?, + )) + } + single::TraceType::CallList => { + let mut proxy = moonbeam_client_evm_tracing::listeners::CallList::default(); + proxy.using(f)?; + proxy.finish_transaction(); + let response = match tracer_input { + TracerInput::Blockscout => { + moonbeam_client_evm_tracing::formatters::Blockscout::format(proxy) + .ok_or("Trace result is empty.") + .map_err(|e| internal_err(format!("{:?}", e))) + } + TracerInput::CallTracer => { + let mut res = + moonbeam_client_evm_tracing::formatters::CallTracer::format( + proxy, + ) + .ok_or("Trace result is empty.") + .map_err(|e| internal_err(format!("{:?}", e)))?; + Ok(res.pop().expect("Trace result is empty.")) + } + _ => Err(internal_err( + "Bug: failed to resolve the tracer format.".to_string(), + )), + }?; + Ok(Response::Single(response)) + } + not_supported => Err(internal_err(format!( + "Bug: `handle_transaction_request` does not support {:?}.", + not_supported + ))), + }; + } + } + Err(internal_err("Runtime block call failed".to_string())) + } +} diff --git a/vendor/client/rpc/trace/Cargo.toml b/vendor/client/rpc/trace/Cargo.toml new file mode 100644 index 00000000..3b6850ce --- /dev/null +++ b/vendor/client/rpc/trace/Cargo.toml @@ -0,0 +1,45 @@ +[package] +name = "moonbeam-rpc-trace" +authors = { workspace = true } +edition = "2021" +homepage = "https://moonbeam.network" +license = "GPL-3.0-only" +repository = { workspace = true } +version = "0.6.0" + +[dependencies] +ethereum = { workspace = true, features = [ "with-codec" ] } +ethereum-types = { workspace = true } +futures = { workspace = true } +jsonrpsee = { workspace = true, features = [ "macros", "server" ] } +log = { workspace = true } +serde = { workspace = true, features = [ "derive" ] } +sha3 = { workspace = true } +substrate-prometheus-endpoint = { workspace = true } +tokio = { workspace = true, features = [ "sync", "time" ] } +tracing = { workspace = true } + +# Moonbeam +moonbeam-client-evm-tracing = { workspace = true } +moonbeam-rpc-core-trace = { workspace = true } +moonbeam-rpc-core-types = { workspace = true } +moonbeam-rpc-primitives-debug = { workspace = true } + +# Substrate +sc-client-api = { workspace = true } +sc-network = { workspace = true } +sc-utils = { workspace = true } +sp-api = { workspace = true } +sp-block-builder = { workspace = true } +sp-blockchain = { workspace = true } +sp-io = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } +sp-transaction-pool = { workspace = true } + +# Frontier +fc-consensus = { workspace = true } +fc-rpc = { workspace = true, features = [ "rpc-binary-search-estimate" ] } +fc-rpc-core = { workspace = true } +fc-storage = { workspace = true } +fp-rpc = { workspace = true } diff --git a/vendor/client/rpc/trace/src/lib.rs b/vendor/client/rpc/trace/src/lib.rs new file mode 100644 index 00000000..6b60264d --- /dev/null +++ b/vendor/client/rpc/trace/src/lib.rs @@ -0,0 +1,926 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! `trace_filter` RPC handler and its associated service task. +//! The RPC handler rely on `CacheTask` which provides a future that must be run inside a tokio +//! executor. +//! +//! The implementation is composed of multiple tasks : +//! - Many calls the the RPC handler `Trace::filter`, communicating with the main task. +//! - A main `CacheTask` managing the cache and the communication between tasks. +//! - For each traced block an async task responsible to wait for a permit, spawn a blocking +//! task and waiting for the result, then send it to the main `CacheTask`. + +use futures::{select, stream::FuturesUnordered, FutureExt, StreamExt}; +use std::{collections::BTreeMap, future::Future, marker::PhantomData, sync::Arc, time::Duration}; +use tokio::{ + sync::{mpsc, oneshot, Semaphore}, + time::sleep, +}; +use tracing::{instrument, Instrument}; + +use sc_client_api::backend::{Backend, StateBackend, StorageProvider}; +use sc_utils::mpsc::TracingUnboundedSender; +use sp_api::{ApiExt, Core, HeaderT, ProvideRuntimeApi}; +use sp_block_builder::BlockBuilder; +use sp_blockchain::{ + Backend as BlockchainBackend, Error as BlockChainError, HeaderBackend, HeaderMetadata, +}; +use sp_runtime::traits::{BlakeTwo256, Block as BlockT}; +use substrate_prometheus_endpoint::{ + register, Counter, PrometheusError, Registry as PrometheusRegistry, U64, +}; + +use ethereum_types::H256; +use fc_rpc::OverrideHandle; +use fp_rpc::EthereumRuntimeRPCApi; + +use moonbeam_client_evm_tracing::{ + formatters::ResponseFormatter, + types::block::{self, TransactionTrace}, +}; +pub use moonbeam_rpc_core_trace::{FilterRequest, TraceServer}; +use moonbeam_rpc_core_types::{RequestBlockId, RequestBlockTag}; +use moonbeam_rpc_primitives_debug::DebugRuntimeApi; + +type TxsTraceRes = Result, String>; + +/// RPC handler. Will communicate with a `CacheTask` through a `CacheRequester`. +pub struct Trace { + _phantom: PhantomData, + client: Arc, + requester: CacheRequester, + max_count: u32, +} + +impl Clone for Trace { + fn clone(&self) -> Self { + Self { + _phantom: PhantomData, + client: Arc::clone(&self.client), + requester: self.requester.clone(), + max_count: self.max_count, + } + } +} + +impl Trace +where + B: BlockT + Send + Sync + 'static, + B::Header: HeaderT, + C: HeaderMetadata + HeaderBackend, + C: Send + Sync + 'static, +{ + /// Create a new RPC handler. + pub fn new(client: Arc, requester: CacheRequester, max_count: u32) -> Self { + Self { + client, + requester, + max_count, + _phantom: PhantomData, + } + } + + /// Convert an optional block ID (number or tag) to a block height. + fn block_id(&self, id: Option) -> Result { + match id { + Some(RequestBlockId::Number(n)) => Ok(n), + None | Some(RequestBlockId::Tag(RequestBlockTag::Latest)) => { + Ok(self.client.info().best_number) + } + Some(RequestBlockId::Tag(RequestBlockTag::Earliest)) => Ok(0), + Some(RequestBlockId::Tag(RequestBlockTag::Pending)) => { + Err("'pending' is not supported") + } + Some(RequestBlockId::Hash(_)) => Err("Block hash not supported"), + } + } + + /// `trace_filter` endpoint (wrapped in the trait implementation with futures compatibilty) + async fn filter(self, req: FilterRequest) -> TxsTraceRes { + let from_block = self.block_id(req.from_block)?; + let to_block = self.block_id(req.to_block)?; + let block_heights = from_block..=to_block; + + let count = req.count.unwrap_or(self.max_count); + if count > self.max_count { + return Err(format!( + "count ({}) can't be greater than maximum ({})", + count, self.max_count + )); + } + + // Build a list of all the Substrate block hashes that need to be traced. + let mut block_hashes = vec![]; + for block_height in block_heights { + if block_height == 0 { + continue; // no traces for genesis block. + } + + let block_hash = self + .client + .hash(block_height) + .map_err(|e| { + format!( + "Error when fetching block {} header : {:?}", + block_height, e + ) + })? + .ok_or_else(|| format!("Block with height {} don't exist", block_height))?; + + block_hashes.push(block_hash); + } + + // Start a batch with these blocks. + let batch_id = self.requester.start_batch(block_hashes.clone()).await?; + // Fetch all the traces. It is done in another function to simplify error handling and allow + // to call the following `stop_batch` regardless of the result. This is important for the + // cache cleanup to work properly. + let res = self.fetch_traces(req, &block_hashes, count as usize).await; + // Stop the batch, allowing the cache task to remove useless non-started block traces and + // start the expiration delay. + self.requester.stop_batch(batch_id).await; + + res + } + + async fn fetch_traces( + &self, + req: FilterRequest, + block_hashes: &[H256], + count: usize, + ) -> TxsTraceRes { + let from_address = req.from_address.unwrap_or_default(); + let to_address = req.to_address.unwrap_or_default(); + + let mut traces_amount: i64 = -(req.after.unwrap_or(0) as i64); + let mut traces = vec![]; + + for &block_hash in block_hashes { + // Request the traces of this block to the cache service. + // This will resolve quickly if the block is already cached, or wait until the block + // has finished tracing. + let block_traces = self.requester.get_traces(block_hash).await?; + + // Filter addresses. + let mut block_traces: Vec<_> = block_traces + .iter() + .filter(|trace| match trace.action { + block::TransactionTraceAction::Call { from, to, .. } => { + (from_address.is_empty() || from_address.contains(&from)) + && (to_address.is_empty() || to_address.contains(&to)) + } + block::TransactionTraceAction::Create { from, .. } => { + (from_address.is_empty() || from_address.contains(&from)) + && to_address.is_empty() + } + block::TransactionTraceAction::Suicide { address, .. } => { + (from_address.is_empty() || from_address.contains(&address)) + && to_address.is_empty() + } + }) + .cloned() + .collect(); + + // Don't insert anything if we're still before "after" + traces_amount += block_traces.len() as i64; + if traces_amount > 0 { + let traces_amount = traces_amount as usize; + // If the current Vec of traces is across the "after" marker, + // we skip some elements of it. + if traces_amount < block_traces.len() { + let skip = block_traces.len() - traces_amount; + block_traces = block_traces.into_iter().skip(skip).collect(); + } + + traces.append(&mut block_traces); + + // If we go over "count" (the limit), we trim and exit the loop, + // unless we used the default maximum, in which case we return an error. + if traces_amount >= count { + if req.count.is_none() { + return Err(format!( + "the amount of traces goes over the maximum ({}), please use 'after' \ + and 'count' in your request", + self.max_count + )); + } + + traces = traces.into_iter().take(count).collect(); + break; + } + } + } + + Ok(traces) + } +} + +#[jsonrpsee::core::async_trait] +impl TraceServer for Trace +where + B: BlockT + Send + Sync + 'static, + B::Header: HeaderT, + C: HeaderMetadata + HeaderBackend, + C: Send + Sync + 'static, +{ + async fn filter( + &self, + filter: FilterRequest, + ) -> jsonrpsee::core::RpcResult> { + self.clone() + .filter(filter) + .await + .map_err(|e| fc_rpc::internal_err(e)) + } +} + +/// An opaque batch ID. +#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] +pub struct CacheBatchId(u64); + +/// Requests the cache task can accept. +enum CacheRequest { + /// Request to start caching the provided range of blocks. + /// The task will add to blocks to its pool and immediately return a new batch ID. + StartBatch { + /// Returns the ID of the batch for cancellation. + sender: oneshot::Sender, + /// List of block hash to trace. + blocks: Vec, + }, + /// Fetch the traces for given block hash. + /// The task will answer only when it has processed this block. + GetTraces { + /// Returns the array of traces or an error. + sender: oneshot::Sender, + /// Hash of the block. + block: H256, + }, + /// Notify the cache that it can stop the batch with that ID. Any block contained only in + /// this batch and still not started will be discarded. + StopBatch { batch_id: CacheBatchId }, +} + +/// Allows to interact with the cache task. +#[derive(Clone)] +pub struct CacheRequester(TracingUnboundedSender); + +impl CacheRequester { + /// Request to start caching the provided range of blocks. + /// The task will add to blocks to its pool and immediately return the batch ID. + #[instrument(skip(self))] + pub async fn start_batch(&self, blocks: Vec) -> Result { + let (response_tx, response_rx) = oneshot::channel(); + let sender = self.0.clone(); + + sender + .unbounded_send(CacheRequest::StartBatch { + sender: response_tx, + blocks, + }) + .map_err(|e| { + format!( + "Failed to send request to the trace cache task. Error : {:?}", + e + ) + })?; + + response_rx.await.map_err(|e| { + format!( + "Trace cache task closed the response channel. Error : {:?}", + e + ) + }) + } + + /// Fetch the traces for given block hash. + /// The task will answer only when it has processed this block. + /// The block should be part of a batch first. If no batch has requested the block it will + /// return an error. + #[instrument(skip(self))] + pub async fn get_traces(&self, block: H256) -> TxsTraceRes { + let (response_tx, response_rx) = oneshot::channel(); + let sender = self.0.clone(); + + sender + .unbounded_send(CacheRequest::GetTraces { + sender: response_tx, + block, + }) + .map_err(|e| { + format!( + "Failed to send request to the trace cache task. Error : {:?}", + e + ) + })?; + + response_rx + .await + .map_err(|e| { + format!( + "Trace cache task closed the response channel. Error : {:?}", + e + ) + })? + .map_err(|e| format!("Failed to replay block. Error : {:?}", e)) + } + + /// Notify the cache that it can stop the batch with that ID. Any block contained only in + /// this batch and still in the waiting pool will be discarded. + #[instrument(skip(self))] + pub async fn stop_batch(&self, batch_id: CacheBatchId) { + let sender = self.0.clone(); + + // Here we don't care if the request has been accepted or refused, the caller can't + // do anything with it. + let _ = sender + .unbounded_send(CacheRequest::StopBatch { batch_id }) + .map_err(|e| { + format!( + "Failed to send request to the trace cache task. Error : {:?}", + e + ) + }); + } +} + +/// Data stored for each block in the cache. +/// `active_batch_count` represents the number of batches using this +/// block. It will increase immediatly when a batch is created, but will be +/// decrease only after the batch ends and its expiration delay passes. +/// It allows to keep the data in the cache for following requests that would use +/// this block, which is important to handle pagination efficiently. +struct CacheBlock { + active_batch_count: usize, + state: CacheBlockState, +} + +/// State of a cached block. It can either be polled to be traced or cached. +enum CacheBlockState { + /// Block has been added to the pool blocks to be replayed. + /// It may be currently waiting to be replayed or being replayed. + Pooled { + started: bool, + /// Multiple requests might query the same block while it is pooled to be + /// traced. They response channel is stored here, and the result will be + /// sent in all of them when the tracing is finished. + waiting_requests: Vec>, + /// Channel used to unqueue a tracing that has not yet started. + /// A tracing will be unqueued if it has not yet been started and the last batch + /// needing this block is ended (ignoring the expiration delay). + /// It is not used directly, but dropping will wake up the receiver. + #[allow(dead_code)] + unqueue_sender: oneshot::Sender<()>, + }, + /// Tracing has completed and the result is available. No Runtime API call + /// will be needed until this block cache is removed. + Cached { traces: TxsTraceRes }, +} + +/// Tracing a block is done in a separate tokio blocking task to avoid clogging the async threads. +/// For this reason a channel using this type is used by the blocking task to communicate with the +/// main cache task. +enum BlockingTaskMessage { + /// Notify the tracing for this block has started as the blocking task got a permit from + /// the semaphore. This is used to prevent the deletion of a cache entry for a block that has + /// started being traced. + Started { block_hash: H256 }, + /// The tracing is finished and the result is send to the main task. + Finished { + block_hash: H256, + result: TxsTraceRes, + }, +} + +/// Type wrapper for the cache task, generic over the Client, Block and Backend types. +pub struct CacheTask { + client: Arc, + backend: Arc, + blocking_permits: Arc, + cached_blocks: BTreeMap, + batches: BTreeMap>, + next_batch_id: u64, + metrics: Option, + _phantom: PhantomData, +} + +impl CacheTask +where + BE: Backend + 'static, + BE::State: StateBackend, + C: ProvideRuntimeApi, + C: StorageProvider, + C: HeaderMetadata + HeaderBackend, + C: Send + Sync + 'static, + B: BlockT + Send + Sync + 'static, + B::Header: HeaderT, + C::Api: BlockBuilder, + C::Api: DebugRuntimeApi, + C::Api: EthereumRuntimeRPCApi, + C::Api: ApiExt, +{ + /// Create a new cache task. + /// + /// Returns a Future that needs to be added to a tokio executor, and an handle allowing to + /// send requests to the task. + pub fn create( + client: Arc, + backend: Arc, + cache_duration: Duration, + blocking_permits: Arc, + overrides: Arc>, + prometheus: Option, + ) -> (impl Future, CacheRequester) { + // Communication with the outside world : + let (requester_tx, mut requester_rx) = + sc_utils::mpsc::tracing_unbounded("trace-filter-cache"); + + // Task running in the service. + let task = async move { + // The following variables are polled by the select! macro, and thus cannot be + // part of Self without introducing borrowing issues. + let mut batch_expirations = FuturesUnordered::new(); + let (blocking_tx, mut blocking_rx) = + mpsc::channel(blocking_permits.available_permits() * 2); + let metrics = if let Some(registry) = prometheus { + match Metrics::register(®istry) { + Ok(metrics) => Some(metrics), + Err(err) => { + log::error!(target: "tracing", "Failed to register metrics {err:?}"); + None + } + } + } else { + None + }; + // Contains the inner state of the cache task, excluding the pooled futures/channels. + // Having this object allow to refactor each event into its own function, simplifying + // the main loop. + let mut inner = Self { + client, + backend, + blocking_permits, + cached_blocks: BTreeMap::new(), + batches: BTreeMap::new(), + next_batch_id: 0, + metrics, + _phantom: Default::default(), + }; + + // Main event loop. This loop must not contain any direct .await, as we want to + // react to events as fast as possible. + loop { + select! { + request = requester_rx.next() => { + match request { + None => break, + Some(CacheRequest::StartBatch {sender, blocks}) + => inner.request_start_batch(&blocking_tx, sender, blocks, overrides.clone()), + Some(CacheRequest::GetTraces {sender, block}) + => inner.request_get_traces(sender, block), + Some(CacheRequest::StopBatch {batch_id}) => { + // Cannot be refactored inside `request_stop_batch` because + // it has an unnamable type :C + batch_expirations.push(async move { + sleep(cache_duration).await; + batch_id + }); + + inner.request_stop_batch(batch_id); + }, + } + }, + message = blocking_rx.recv().fuse() => { + match message { + None => (), + Some(BlockingTaskMessage::Started { block_hash }) + => inner.blocking_started(block_hash), + Some(BlockingTaskMessage::Finished { block_hash, result }) + => inner.blocking_finished(block_hash, result), + } + }, + batch_id = batch_expirations.next() => { + match batch_id { + None => (), + Some(batch_id) => inner.expired_batch(batch_id), + } + } + } + } + } + .instrument(tracing::debug_span!("trace_filter_cache")); + + (task, CacheRequester(requester_tx)) + } + + /// Handle the creation of a batch. + /// Will start the tracing process for blocks that are not already in the cache. + #[instrument(skip(self, blocking_tx, sender, blocks, overrides))] + fn request_start_batch( + &mut self, + blocking_tx: &mpsc::Sender, + sender: oneshot::Sender, + blocks: Vec, + overrides: Arc>, + ) { + tracing::trace!("Starting batch {}", self.next_batch_id); + self.batches.insert(self.next_batch_id, blocks.clone()); + + for block in blocks { + // The block is already in the cache, awesome ! + if let Some(block_cache) = self.cached_blocks.get_mut(&block) { + block_cache.active_batch_count += 1; + tracing::trace!( + "Cache hit for block {}, now used by {} batches.", + block, + block_cache.active_batch_count + ); + } + // Otherwise we need to queue this block for tracing. + else { + tracing::trace!("Cache miss for block {}, pooling it for tracing.", block); + + let blocking_permits = Arc::clone(&self.blocking_permits); + let (unqueue_sender, unqueue_receiver) = oneshot::channel(); + let client = Arc::clone(&self.client); + let backend = Arc::clone(&self.backend); + let blocking_tx = blocking_tx.clone(); + let overrides = overrides.clone(); + + // Spawn all block caching asynchronously. + // It will wait to obtain a permit, then spawn a blocking task. + // When the blocking task returns its result, it is send + // thought a channel to the main task loop. + tokio::spawn( + async move { + tracing::trace!("Waiting for blocking permit or task cancellation"); + let _permit = select!( + _ = unqueue_receiver.fuse() => { + tracing::trace!("Tracing of the block has been cancelled."); + return; + }, + permit = blocking_permits.acquire().fuse() => permit, + ); + + // Warn the main task that block tracing as started, and + // this block cache entry should not be removed. + let _ = blocking_tx + .send(BlockingTaskMessage::Started { block_hash: block }) + .await; + + tracing::trace!("Start block tracing in a blocking task."); + + // Perform block tracing in a tokio blocking task. + let result = async { + tokio::task::spawn_blocking(move || { + Self::cache_block(client, backend, block, overrides.clone()) + }) + .await + .map_err(|e| { + format!("Tracing Substrate block {} panicked : {:?}", block, e) + })? + } + .await + .map_err(|e| e.to_string()); + + tracing::trace!("Block tracing finished, sending result to main task."); + + // Send response to main task. + let _ = blocking_tx + .send(BlockingTaskMessage::Finished { + block_hash: block, + result, + }) + .await; + } + .instrument(tracing::trace_span!("Block tracing", block = %block)), + ); + + // Insert the block in the cache. + self.cached_blocks.insert( + block, + CacheBlock { + active_batch_count: 1, + state: CacheBlockState::Pooled { + started: false, + waiting_requests: vec![], + unqueue_sender, + }, + }, + ); + } + } + + // Respond with the batch ID. + let _ = sender.send(CacheBatchId(self.next_batch_id)); + + // Increase batch ID for next request. + self.next_batch_id = self.next_batch_id.overflowing_add(1).0; + } + + /// Handle a request to get the traces of the provided block. + /// - If the result is stored in the cache, it sends it immediatly. + /// - If the block is currently being pooled, it is added in this block cache waiting list, + /// and all requests concerning this block will be satisfied when the tracing for this block + /// is finished. + /// - If this block is missing from the cache, it means no batch asked for it. All requested + /// blocks should be contained in a batch beforehand, and thus an error is returned. + #[instrument(skip(self))] + fn request_get_traces(&mut self, sender: oneshot::Sender, block: H256) { + if let Some(block_cache) = self.cached_blocks.get_mut(&block) { + match &mut block_cache.state { + CacheBlockState::Pooled { + ref mut waiting_requests, + .. + } => { + tracing::warn!( + "A request asked a pooled block ({}), adding it to the list of \ + waiting requests.", + block + ); + waiting_requests.push(sender); + if let Some(metrics) = &self.metrics { + metrics.tracing_cache_misses.inc(); + } + } + CacheBlockState::Cached { traces, .. } => { + tracing::warn!( + "A request asked a cached block ({}), sending the traces directly.", + block + ); + let _ = sender.send(traces.clone()); + if let Some(metrics) = &self.metrics { + metrics.tracing_cache_hits.inc(); + } + } + } + } else { + tracing::warn!( + "An RPC request asked to get a block ({}) which was not batched.", + block + ); + let _ = sender.send(Err(format!( + "RPC request asked a block ({}) that was not batched", + block + ))); + } + } + + /// Handle a request to stop a batch. + /// For all blocks that needed to be traced, are only in this batch and not yet started, their + /// tracing is cancelled to save CPU-time and avoid attacks requesting large amount of blocks. + /// This batch data is not yet removed however. Instead a expiration delay timer is started + /// after which the data will indeed be cleared. (the code for that is in the main loop code + /// as it involved an unnamable type :C) + #[instrument(skip(self))] + fn request_stop_batch(&mut self, batch_id: CacheBatchId) { + tracing::trace!("Stopping batch {}", batch_id.0); + if let Some(blocks) = self.batches.get(&batch_id.0) { + for block in blocks { + let mut remove = false; + + // We remove early the block cache if this batch is the last + // pooling this block. + if let Some(block_cache) = self.cached_blocks.get_mut(block) { + if block_cache.active_batch_count == 1 + && matches!( + block_cache.state, + CacheBlockState::Pooled { started: false, .. } + ) { + remove = true; + } + } + + if remove { + tracing::trace!("Pooled block {} is no longer requested.", block); + // Remove block from the cache. Drops the value, + // closing all the channels contained in it. + let _ = self.cached_blocks.remove(&block); + } + } + } + } + + /// A tracing blocking task notifies it got a permit and is starting the tracing. + /// This started status is stored to avoid removing this block entry. + #[instrument(skip(self))] + fn blocking_started(&mut self, block_hash: H256) { + if let Some(block_cache) = self.cached_blocks.get_mut(&block_hash) { + if let CacheBlockState::Pooled { + ref mut started, .. + } = block_cache.state + { + *started = true; + } + } + } + + /// A tracing blocking task notifies it has finished the tracing and provide the result. + #[instrument(skip(self, result))] + fn blocking_finished(&mut self, block_hash: H256, result: TxsTraceRes) { + // In some cases it might be possible to receive traces of a block + // that has no entry in the cache because it was removed of the pool + // and received a permit concurrently. We just ignore it. + // + // TODO : Should we add it back ? Should it have an active_batch_count + // of 1 then ? + if let Some(block_cache) = self.cached_blocks.get_mut(&block_hash) { + if let CacheBlockState::Pooled { + ref mut waiting_requests, + .. + } = block_cache.state + { + tracing::trace!( + "A new block ({}) has been traced, adding it to the cache and responding to \ + {} waiting requests.", + block_hash, + waiting_requests.len() + ); + // Send result in waiting channels + while let Some(channel) = waiting_requests.pop() { + let _ = channel.send(result.clone()); + } + + // Update cache entry + block_cache.state = CacheBlockState::Cached { traces: result }; + } + } + } + + /// A batch expiration delay timer has completed. It performs the cache cleaning for blocks + /// not longer used by other batches. + #[instrument(skip(self))] + fn expired_batch(&mut self, batch_id: CacheBatchId) { + if let Some(batch) = self.batches.remove(&batch_id.0) { + for block in batch { + // For each block of the batch, we remove it if it was the + // last batch containing it. + let mut remove = false; + if let Some(block_cache) = self.cached_blocks.get_mut(&block) { + block_cache.active_batch_count -= 1; + + if block_cache.active_batch_count == 0 { + remove = true; + } + } + + if remove { + let _ = self.cached_blocks.remove(&block); + } + } + } + } + + /// (In blocking task) Use the Runtime API to trace the block. + #[instrument(skip(client, backend, overrides))] + fn cache_block( + client: Arc, + backend: Arc, + substrate_hash: H256, + overrides: Arc>, + ) -> TxsTraceRes { + // Get Subtrate block data. + let api = client.runtime_api(); + let block_header = client + .header(substrate_hash) + .map_err(|e| { + format!( + "Error when fetching substrate block {} header : {:?}", + substrate_hash, e + ) + })? + .ok_or_else(|| format!("Subtrate block {} don't exist", substrate_hash))?; + + let height = *block_header.number(); + let substrate_parent_hash = *block_header.parent_hash(); + + let schema = + fc_storage::onchain_storage_schema::(client.as_ref(), substrate_hash); + + // Get Ethereum block data. + let (eth_block, eth_transactions) = match overrides.schemas.get(&schema) { + Some(schema) => match ( + schema.current_block(substrate_hash), + schema.current_transaction_statuses(substrate_hash), + ) { + (Some(a), Some(b)) => (a, b), + _ => { + return Err(format!( + "Failed to get Ethereum block data for Substrate block {}", + substrate_hash + )) + } + }, + _ => return Err(format!("No storage override at {:?}", substrate_hash)), + }; + + let eth_block_hash = eth_block.header.hash(); + let eth_tx_hashes = eth_transactions + .iter() + .map(|t| t.transaction_hash) + .collect(); + + // Get extrinsics (containing Ethereum ones) + let extrinsics = backend + .blockchain() + .body(substrate_hash) + .map_err(|e| { + format!( + "Blockchain error when fetching extrinsics of block {} : {:?}", + height, e + ) + })? + .ok_or_else(|| format!("Could not find block {} when fetching extrinsics.", height))?; + + // Trace the block. + let f = || -> Result<_, String> { + api.initialize_block(substrate_parent_hash, &block_header) + .map_err(|e| format!("Runtime api access error: {:?}", e))?; + + let _result = api + .trace_block(substrate_parent_hash, extrinsics, eth_tx_hashes) + .map_err(|e| format!("Blockchain error when replaying block {} : {:?}", height, e))? + .map_err(|e| { + tracing::warn!( + "Internal runtime error when replaying block {} : {:?}", + height, + e + ); + format!( + "Internal runtime error when replaying block {} : {:?}", + height, e + ) + })?; + Ok(moonbeam_rpc_primitives_debug::Response::Block) + }; + + let mut proxy = moonbeam_client_evm_tracing::listeners::CallList::default(); + proxy.using(f)?; + let mut traces: Vec<_> = + moonbeam_client_evm_tracing::formatters::TraceFilter::format(proxy) + .ok_or("Fail to format proxy")?; + // Fill missing data. + for trace in traces.iter_mut() { + trace.block_hash = eth_block_hash; + trace.block_number = height; + trace.transaction_hash = eth_transactions + .get(trace.transaction_position as usize) + .ok_or_else(|| { + tracing::warn!( + "Bug: A transaction has been replayed while it shouldn't (in block {}).", + height + ); + + format!( + "Bug: A transaction has been replayed while it shouldn't (in block {}).", + height + ) + })? + .transaction_hash; + + // Reformat error messages. + if let block::TransactionTraceOutput::Error(ref mut error) = trace.output { + if error.as_slice() == b"execution reverted" { + *error = b"Reverted".to_vec(); + } + } + } + Ok(traces) + } +} + +/// Prometheus metrics for tracing. +#[derive(Clone)] +pub(crate) struct Metrics { + tracing_cache_hits: Counter, + tracing_cache_misses: Counter, +} + +impl Metrics { + pub(crate) fn register(registry: &PrometheusRegistry) -> Result { + Ok(Self { + tracing_cache_hits: register( + Counter::new("tracing_cache_hits", "Number of tracing cache hits.")?, + registry, + )?, + tracing_cache_misses: register( + Counter::new("tracing_cache_misses", "Number of tracing cache misses.")?, + registry, + )?, + }) + } +} diff --git a/vendor/client/rpc/txpool/Cargo.toml b/vendor/client/rpc/txpool/Cargo.toml new file mode 100644 index 00000000..da749940 --- /dev/null +++ b/vendor/client/rpc/txpool/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "moonbeam-rpc-txpool" +authors = { workspace = true } +edition = "2021" +homepage = "https://moonbeam.network" +license = "GPL-3.0-only" +repository = { workspace = true } +version = "0.6.0" + +[dependencies] +jsonrpsee = { workspace = true, features = [ "macros", "server" ] } +rlp = { workspace = true } +serde = { workspace = true, features = [ "derive" ] } +sha3 = { workspace = true } + +# Moonbeam +moonbeam-rpc-core-txpool = { workspace = true } +moonbeam-rpc-primitives-txpool = { workspace = true, features = [ "std" ] } + +# Substrate +frame-system = { workspace = true } +sc-transaction-pool = { workspace = true } +sc-transaction-pool-api = { workspace = true } +sp-api = { workspace = true } +sp-blockchain = { workspace = true } +sp-io = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } + +# Frontier +ethereum-types = { workspace = true, features = [ "std" ] } +fc-rpc = { workspace = true } diff --git a/vendor/client/rpc/txpool/src/lib.rs b/vendor/client/rpc/txpool/src/lib.rs new file mode 100644 index 00000000..16a66154 --- /dev/null +++ b/vendor/client/rpc/txpool/src/lib.rs @@ -0,0 +1,189 @@ +// Copyright 2019-2022 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +use ethereum_types::{H160, H256, U256}; +use fc_rpc::{internal_err, public_key}; +use jsonrpsee::core::RpcResult; +pub use moonbeam_rpc_core_txpool::{ + GetT, Summary, Transaction, TransactionMap, TxPoolResult, TxPoolServer, +}; +use sc_transaction_pool::{ChainApi, Pool}; +use sc_transaction_pool_api::InPoolTransaction; +use serde::Serialize; +use sha3::{Digest, Keccak256}; +use sp_api::{ApiExt, ProvideRuntimeApi}; +use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; +use sp_runtime::traits::Block as BlockT; +use std::collections::HashMap; +use std::{marker::PhantomData, sync::Arc}; + +use moonbeam_rpc_primitives_txpool::{ + Transaction as TransactionV2, TxPoolResponse, TxPoolRuntimeApi, +}; + +pub struct TxPool { + client: Arc, + graph: Arc>, + _marker: PhantomData, +} + +impl TxPool +where + C: ProvideRuntimeApi, + C: HeaderMetadata + HeaderBackend + 'static, + C: Send + Sync + 'static, + B: BlockT + Send + Sync + 'static, + A: ChainApi + 'static, + C::Api: TxPoolRuntimeApi, +{ + /// Use the transaction graph interface to get the extrinsics currently in the ready and future + /// queues. + fn map_build(&self) -> RpcResult>> + where + T: GetT + Serialize, + { + // Collect transactions in the ready validated pool. + let txs_ready = self + .graph + .validated_pool() + .ready() + .map(|in_pool_tx| in_pool_tx.data().clone()) + .collect(); + + // Collect transactions in the future validated pool. + let txs_future = self + .graph + .validated_pool() + .futures() + .iter() + .map(|(_hash, extrinsic)| extrinsic.clone()) + .collect(); + + // Use the runtime to match the (here) opaque extrinsics against ethereum transactions. + let best_block = self.client.info().best_hash; + let api = self.client.runtime_api(); + let api_version = + if let Ok(Some(api_version)) = api.api_version::>(best_block) { + api_version + } else { + return Err(internal_err( + "failed to retrieve Runtime Api version".to_string(), + )); + }; + let ethereum_txns: TxPoolResponse = if api_version == 1 { + #[allow(deprecated)] + let res = api.extrinsic_filter_before_version_2(best_block, txs_ready, txs_future) + .map_err(|err| { + internal_err(format!("fetch runtime extrinsic filter failed: {:?}", err)) + })?; + TxPoolResponse { + ready: res + .ready + .iter() + .map(|t| TransactionV2::Legacy(t.clone())) + .collect(), + future: res + .future + .iter() + .map(|t| TransactionV2::Legacy(t.clone())) + .collect(), + } + } else { + api.extrinsic_filter(best_block, txs_ready, txs_future) + .map_err(|err| { + internal_err(format!("fetch runtime extrinsic filter failed: {:?}", err)) + })? + }; + // Build the T response. + let mut pending = TransactionMap::::new(); + for txn in ethereum_txns.ready.iter() { + let hash = txn.hash(); + let nonce = match txn { + TransactionV2::Legacy(t) => t.nonce, + TransactionV2::EIP2930(t) => t.nonce, + TransactionV2::EIP1559(t) => t.nonce, + }; + let from_address = match public_key(txn) { + Ok(pk) => H160::from(H256::from_slice(Keccak256::digest(&pk).as_slice())), + Err(_e) => H160::default(), + }; + pending + .entry(from_address) + .or_insert_with(HashMap::new) + .insert(nonce, T::get(hash, from_address, txn)); + } + let mut queued = TransactionMap::::new(); + for txn in ethereum_txns.future.iter() { + let hash = txn.hash(); + let nonce = match txn { + TransactionV2::Legacy(t) => t.nonce, + TransactionV2::EIP2930(t) => t.nonce, + TransactionV2::EIP1559(t) => t.nonce, + }; + let from_address = match public_key(txn) { + Ok(pk) => H160::from(H256::from_slice(Keccak256::digest(&pk).as_slice())), + Err(_e) => H160::default(), + }; + queued + .entry(from_address) + .or_insert_with(HashMap::new) + .insert(nonce, T::get(hash, from_address, txn)); + } + Ok(TxPoolResult { pending, queued }) + } +} + +impl TxPool { + pub fn new(client: Arc, graph: Arc>) -> Self { + Self { + client, + graph, + _marker: PhantomData, + } + } +} + +impl TxPoolServer for TxPool +where + C: ProvideRuntimeApi, + C: HeaderMetadata + HeaderBackend, + C: Send + Sync + 'static, + B: BlockT + Send + Sync + 'static, + A: ChainApi + 'static, + C::Api: TxPoolRuntimeApi, +{ + fn content(&self) -> RpcResult>> { + self.map_build::() + } + + fn inspect(&self) -> RpcResult>> { + self.map_build::