diff --git a/Cargo.lock b/Cargo.lock index ec327480..86cbf005 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,22 +12,13 @@ dependencies = [ "regex", ] -[[package]] -name = "addr2line" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e61f2b7f93d2c7d2b08263acaa4a363b3e276806c68af6134c44f523bf1aacd" -dependencies = [ - "gimli 0.25.0", -] - [[package]] name = "addr2line" version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" dependencies = [ - "gimli 0.26.1", + "gimli", ] [[package]] @@ -42,7 +33,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" dependencies = [ - "generic-array 0.14.4", + "generic-array 0.14.5", ] [[package]] @@ -53,7 +44,7 @@ checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ "cfg-if 1.0.0", "cipher", - "cpufeatures 0.2.1", + "cpufeatures 0.2.2", "opaque-debug 0.3.0", ] @@ -68,7 +59,7 @@ dependencies = [ "cipher", "ctr", "ghash", - "subtle 2.4.1", + "subtle", ] [[package]] @@ -77,7 +68,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.3", + "getrandom 0.2.6", "once_cell", "version_check", ] @@ -102,15 +93,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.51" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b26702f315f53b6071259e15dd9d64528213b44d61de1ec926eca7715d62203" +checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc" [[package]] name = "approx" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "072df7202e63b127ab55acfe16ce97013d5b97bf160489336d3f1840fd78e99e" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" dependencies = [ "num-traits", ] @@ -175,9 +166,9 @@ dependencies = [ [[package]] name = "async-global-executor" -version = "2.0.2" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9586ec52317f36de58453159d48351bc244bc24ced3effc1fce22f3d48664af6" +checksum = "c290043c9a95b05d45e952fb6383c67bcb61471f60cfa21e890dba6654234f43" dependencies = [ "async-channel", "async-executor", @@ -203,16 +194,16 @@ dependencies = [ "parking", "polling", "slab", - "socket2 0.4.2", + "socket2 0.4.4", "waker-fn", "winapi 0.3.9", ] [[package]] name = "async-lock" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798b" +checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" dependencies = [ "event-listener", ] @@ -226,34 +217,16 @@ dependencies = [ "event-listener", ] -[[package]] -name = "async-process" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83137067e3a2a6a06d67168e49e68a0957d215410473a740cea95a2425c0b7c6" -dependencies = [ - "async-io", - "blocking", - "cfg-if 1.0.0", - "event-listener", - "futures-lite", - "libc", - "once_cell", - "signal-hook", - "winapi 0.3.9", -] - [[package]] name = "async-std" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8056f1455169ab86dd47b47391e4ab0cbd25410a70e9fe675544f49bafaf952" +checksum = "52580991739c5cdb36cde8b2a516371c0a3b70dda36d916cc08b82372916808c" dependencies = [ "async-channel", "async-global-executor", "async-io", "async-lock", - "async-process", "crossbeam-utils", "futures-channel", "futures-core", @@ -265,7 +238,7 @@ dependencies = [ "memchr", "num_cpus", "once_cell", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.9", "pin-utils", "slab", "wasm-bindgen-futures", @@ -273,9 +246,9 @@ dependencies = [ [[package]] name = "async-std-resolver" -version = "0.20.3" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed4e2c3da14d8ad45acb1e3191db7a918e9505b6f155b218e70a7c9a1a48c638" +checksum = "dbf3e776afdf3a2477ef4854b85ba0dff3bd85792f685fb3c68948b4d304e4f0" dependencies = [ "async-std", "async-trait", @@ -287,15 +260,15 @@ dependencies = [ [[package]] name = "async-task" -version = "4.0.3" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0" +checksum = "30696a84d817107fc028e049980e09d5e140e8da8f1caeb17e8e950658a3cea9" [[package]] name = "async-trait" -version = "0.1.51" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e" +checksum = "ed6aa3524a2dfcf9fe180c51eae2b58738348d819517ceadf95789c51fff7600" dependencies = [ "proc-macro2", "quote", @@ -312,7 +285,7 @@ dependencies = [ "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.9", ] [[package]] @@ -325,7 +298,7 @@ dependencies = [ "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.9", ] [[package]] @@ -354,44 +327,50 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "auto_impl" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7862e21c893d65a1650125d157eaeec691439379a1cee17ee49031b79236ada4" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.63" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "321629d8ba6513061f26707241fa9bc89524ff1cd7a915a97ef0c62c666ce1b6" +checksum = "11a17d453482a265fd5f8479f2a3f405566e6ca627837aaddb85af8b1ab8ef61" dependencies = [ - "addr2line 0.17.0", + "addr2line", "cc", "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.27.1", + "object 0.28.3", "rustc-demangle", ] [[package]] name = "base-x" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" +checksum = "dc19a4937b4fbd3fe3379793130e42060d10627a360f2127802b10b87e7baf74" [[package]] name = "base58" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83" - -[[package]] -name = "base64" -version = "0.12.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" +checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" [[package]] name = "base64" @@ -405,6 +384,21 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf9ff0bbfd639f15c74af777d81383cf53efb7c93613f6cab67c6c11e05bbf8b" +[[package]] +name = "beef" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bed554bd50246729a1ec158d08aa3235d1b69d94ad120ebe187e28894787e736" +dependencies = [ + "serde", +] + +[[package]] +name = "bimap" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc0455254eb5c6964c4545d8bac815e1a1be4f3afe0ae695ea539c12d728d44b" + [[package]] name = "bincode" version = "1.3.3" @@ -458,9 +452,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitvec" -version = "0.20.4" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" +checksum = "1489fcb93a5bb47da0462ca93ad252ad6af2145cce58d10d46a83931ba9f016b" dependencies = [ "funty", "radium", @@ -479,6 +473,15 @@ dependencies = [ "opaque-debug 0.3.0", ] +[[package]] +name = "blake2" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9cf849ee05b2ee5fba5e36f97ff8ec2533916700fc0758d40d92136a42f3388" +dependencies = [ + "digest 0.10.3", +] + [[package]] name = "blake2-rfc" version = "0.2.18" @@ -545,7 +548,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ "block-padding 0.2.1", - "generic-array 0.14.4", + "generic-array 0.14.5", +] + +[[package]] +name = "block-buffer" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +dependencies = [ + "generic-array 0.14.5", ] [[package]] @@ -565,9 +577,9 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "blocking" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046e47d4b2d391b1f6f8b407b1deb8dee56c1852ccd868becf2710f601b5f427" +checksum = "c6ccb65d468978a086b69884437ded69a90faab3bbe6e67f242173ea728acccc" dependencies = [ "async-channel", "async-task", @@ -609,15 +621,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.8.0" +version = "3.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" +checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" [[package]] name = "byte-slice-cast" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d30c751592b77c499e7bce34d99d67c2c11bdc0574e9a488ddade14150a4698" +checksum = "87c5fdd0166095e1d463fc6cc01aa8ce547ad77a4e84d42eb6762b084e28067e" [[package]] name = "byte-tools" @@ -643,27 +655,32 @@ dependencies = [ [[package]] name = "bytes" -version = "0.5.6" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] -name = "bytes" -version = "1.1.0" +name = "bzip2-sys" +version = "0.1.11+1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] [[package]] name = "cache-padded" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" +checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" [[package]] name = "camino" -version = "1.0.5" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52d74260d9bf6944e2208aa46841b4b8f0d7ffc0849a06837b2f510337f86b2b" +checksum = "6f3132262930b0522068049f5870a856ab8affc80c70d08b6ecb785771a6fc23" dependencies = [ "serde", ] @@ -679,23 +696,22 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.13.1" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "081e3f0755c1f380c2d010481b6fa2e02973586d5f2b24eebb7a2a1d98b143d8" +checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ "camino", "cargo-platform", - "semver 0.11.0", - "semver-parser 0.10.2", + "semver 1.0.7", "serde", "serde_json", ] [[package]] name = "cc" -version = "1.0.72" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" dependencies = [ "jobserver", ] @@ -776,42 +792,57 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" dependencies = [ - "generic-array 0.14.4", + "generic-array 0.14.5", ] [[package]] name = "clang-sys" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa66045b9cb23c2e9c1520732030608b02ee07e5cfaa5a521ec15ded7fa24c90" +checksum = "4cc00842eed744b858222c4c9faf7243aafc6d33f92f96935263ef4d8a41ce21" dependencies = [ "glob", "libc", - "libloading 0.7.2", + "libloading 0.7.3", ] [[package]] name = "clap" -version = "2.34.0" +version = "3.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +checksum = "7c167e37342afc5f33fd87bbc870cedd020d2a6dffa05d45ccd9241fbdd146db" dependencies = [ - "ansi_term", "atty", "bitflags", + "clap_derive", + "clap_lex", + "indexmap", + "lazy_static", "strsim", + "termcolor", "textwrap", - "unicode-width", - "vec_map", ] [[package]] -name = "cloudabi" -version = "0.0.3" +name = "clap_derive" +version = "3.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +checksum = "a3aab4734e083b809aaf5794e14e756d1c798d2c69c7f7de7a09a2f5214993c1" dependencies = [ - "bitflags", + "heck 0.4.0", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "189ddd3b5d32a70b35e7686054371742a937b0d99128e76dde6340210e966669" +dependencies = [ + "os_str_bytes", ] [[package]] @@ -837,9 +868,9 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "core-foundation" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" dependencies = [ "core-foundation-sys", "libc", @@ -853,9 +884,9 @@ checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "core2" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cf12d2dad3ed124aa116f59561428478993d69ab81ae4d30e5349c9c5b5a5f6" +checksum = "239fa3ae9b63c2dc74bd3fa852d4792b8b305ae64eeede946265b6af62f1fff3" dependencies = [ "memchr", ] @@ -880,73 +911,68 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" +checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" dependencies = [ "libc", ] [[package]] name = "cranelift-bforest" -version = "0.76.0" +version = "0.80.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e6bea67967505247f54fa2c85cf4f6e0e31c4e5692c9b70e4ae58e339067333" +checksum = "62fc68cdb867b7d27b5f33cd65eb11376dfb41a2d09568a1a2c2bc1dc204f4ef" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.76.0" +version = "0.80.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48194035d2752bdd5bdae429e3ab88676e95f52a2b1355a5d4e809f9e39b1d74" +checksum = "31253a44ab62588f8235a996cc9b0636d98a299190069ced9628b8547329b47a" dependencies = [ "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", - "gimli 0.25.0", + "gimli", "log", "regalloc", - "serde", "smallvec", "target-lexicon", ] [[package]] name = "cranelift-codegen-meta" -version = "0.76.0" +version = "0.80.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976efb22fcab4f2cd6bd4e9913764616a54d895c1a23530128d04e03633c555f" +checksum = "7a20ab4627d30b702fb1b8a399882726d216b8164d3b3fa6189e3bf901506afe" dependencies = [ "cranelift-codegen-shared", - "cranelift-entity", ] [[package]] name = "cranelift-codegen-shared" -version = "0.76.0" +version = "0.80.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dabb5fe66e04d4652e434195b45ae65b5c8172d520247b8f66d8df42b2b45dc" -dependencies = [ - "serde", -] +checksum = "6687d9668dacfed4468361f7578d86bded8ca4db978f734d9b631494bebbb5b8" [[package]] name = "cranelift-entity" -version = "0.76.0" +version = "0.80.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3329733e4d4b8e91c809efcaa4faee80bf66f20164e3dd16d707346bd3494799" +checksum = "c77c5d72db97ba2cb36f69037a709edbae0d29cb25503775891e7151c5c874bf" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.76.0" +version = "0.80.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279afcc0d3e651b773f94837c3d581177b348c8d69e928104b2e9fccb226f921" +checksum = "426dca83f63c7c64ea459eb569aadc5e0c66536c0042ed5d693f91830e8750d0" dependencies = [ "cranelift-codegen", "log", @@ -956,9 +982,9 @@ dependencies = [ [[package]] name = "cranelift-native" -version = "0.76.0" +version = "0.80.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c04d1fe6a5abb5bb0edc78baa8ef238370fb8e389cc88b6d153f7c3e9680425" +checksum = "8007864b5d0c49b026c861a15761785a2871124e401630c03ef1426e6d0d559e" dependencies = [ "cranelift-codegen", "libc", @@ -967,35 +993,34 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.76.0" +version = "0.80.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0d260ad44f6fd2c91f7f5097191a2a9e3edcbb36df1fb787b600dad5ea148ec" +checksum = "94cf12c071415ba261d897387ae5350c4d83c238376c8c5a96514ecfa2ea66a3" dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", "itertools", "log", - "serde", "smallvec", - "thiserror", "wasmparser", + "wasmtime-types", ] [[package]] name = "crc32fast" -version = "1.3.0" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "738c290dfaea84fc1ca15ad9c168d083b05a714e1efddd8edaab678dc28d2836" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if 1.0.0", ] [[package]] name = "crossbeam-channel" -version = "0.5.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -1014,10 +1039,11 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.5" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" +checksum = "1145cf131a2c6ba0615079ab6a638f7e1973ac9c2634fcbeaaad6114246efe8c" dependencies = [ + "autocfg", "cfg-if 1.0.0", "crossbeam-utils", "lazy_static", @@ -1027,9 +1053,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.5" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" +checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" dependencies = [ "cfg-if 1.0.0", "lazy_static", @@ -1042,13 +1068,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "crypto-mac" -version = "0.7.0" +name = "crypto-common" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" +checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" dependencies = [ - "generic-array 0.12.4", - "subtle 1.0.0", + "generic-array 0.14.5", + "typenum", ] [[package]] @@ -1057,8 +1083,8 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array 0.14.4", - "subtle 2.4.1", + "generic-array 0.14.5", + "subtle", ] [[package]] @@ -1067,8 +1093,8 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" dependencies = [ - "generic-array 0.14.4", - "subtle 2.4.1", + "generic-array 0.14.5", + "subtle", ] [[package]] @@ -1077,14 +1103,14 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1a816186fa68d9e426e3cb4ae4dff1fcd8e4a2c34b781bf7a822574a0d0aac8" dependencies = [ - "sct", + "sct 0.6.1", ] [[package]] name = "ctor" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccc0a48a9b826acdf4028595adc9db92caea352f7af011a3034acd172a52a0aa" +checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" dependencies = [ "quote", "syn", @@ -1119,7 +1145,7 @@ dependencies = [ "byteorder", "digest 0.8.1", "rand_core 0.5.1", - "subtle 2.4.1", + "subtle", "zeroize", ] @@ -1132,7 +1158,7 @@ dependencies = [ "byteorder", "digest 0.9.0", "rand_core 0.5.1", - "subtle 2.4.1", + "subtle", "zeroize", ] @@ -1162,17 +1188,6 @@ dependencies = [ "syn", ] -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "derive_more" version = "0.99.17" @@ -1201,14 +1216,25 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.4", + "generic-array 0.14.5", +] + +[[package]] +name = "digest" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +dependencies = [ + "block-buffer 0.10.2", + "crypto-common", + "subtle", ] [[package]] name = "directories" -version = "3.0.2" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e69600ff1703123957937708eb27f7a564e48885c537782722ed0ba3189ce1d7" +checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" dependencies = [ "dirs-sys", ] @@ -1225,9 +1251,9 @@ dependencies = [ [[package]] name = "dirs-sys" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" dependencies = [ "libc", "redox_users", @@ -1261,6 +1287,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +[[package]] +name = "dtoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" + [[package]] name = "dyn-clonable" version = "0.9.0" @@ -1284,15 +1316,15 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" +checksum = "21e50f3adc76d6a43f5ed73b698a87d0760ca74617f60f7c3b879003536fdd28" [[package]] name = "ed25519" -version = "1.3.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74e1069e39f1454367eb2de793ed062fac4c35c2934b76a81d90dd9abcd28816" +checksum = "3d5c4b5e5959dc2c2b89918d8e2cc40fcdd623cef026ed09d2f0ee05199dc8e4" dependencies = [ "signature", ] @@ -1307,7 +1339,7 @@ dependencies = [ "ed25519", "rand 0.7.3", "serde", - "sha2 0.9.8", + "sha2 0.9.9", "zeroize", ] @@ -1319,11 +1351,11 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "enum-as-inner" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c5f0096a91d210159eceb2ff5e1c4da18388a170e1e3ce948aac9c8fdbbf595" +checksum = "570d109b813e904becc80d8d5da38376818a143348413f7149f1340fe04754d4" dependencies = [ - "heck", + "heck 0.4.0", "proc-macro2", "quote", "syn", @@ -1351,9 +1383,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" dependencies = [ "atty", "humantime", @@ -1368,15 +1400,6 @@ version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68b91989ae21441195d7d9b9993a2f9295c7e1a8c96255d8b729accddc124797" -[[package]] -name = "erased-serde" -version = "0.3.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3de9ad4541d99dc22b59134e7ff8dc3d6c988c89ecd7324bf10a8362b07a2afa" -dependencies = [ - "serde", -] - [[package]] name = "errno" version = "0.2.8" @@ -1400,25 +1423,26 @@ dependencies = [ [[package]] name = "ethabi" -version = "15.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f76ef192b63e8a44b3d08832acebbb984c3fba154b5c26f70037c860202a0d4b" +checksum = "b69517146dfab88e9238c00c724fd8e277951c3cc6f22b016d72f422a832213e" dependencies = [ - "anyhow", "ethereum-types", "hex", + "once_cell", + "regex", "serde", "serde_json", - "sha3 0.9.1", + "sha3 0.10.1", "thiserror", "uint", ] [[package]] name = "ethbloom" -version = "0.11.1" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfb684ac8fa8f6c5759f788862bb22ec6fe3cb392f6bfd08e3c64b603661e3f8" +checksum = "11da94e443c60508eb62cf256243a64da87304c2802ac2528847f79d750007ef" dependencies = [ "crunchy", "fixed-hash", @@ -1431,9 +1455,9 @@ dependencies = [ [[package]] name = "ethereum" -version = "0.10.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fb916554a4dba293ea69c69ad5653e21d770a9d0c2496b5fa0a1f5a3946d87" +checksum = "23750149fe8834c0e24bb9adcbacbe06c45b9861f15df53e09f26cb7c4ab91ef" dependencies = [ "bytes 1.1.0", "ethereum-types", @@ -1444,15 +1468,15 @@ dependencies = [ "rlp-derive", "scale-info", "serde", - "sha3 0.9.1", + "sha3 0.10.1", "triehash", ] [[package]] name = "ethereum-types" -version = "0.12.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05136f7057fe789f06e6d41d07b34e6f70d8c86e5693b60f97aaa6553553bdaf" +checksum = "b2827b94c556145446fcce834ca86b7abf0c39a805883fe20e72c5bfdb5a0dc6" dependencies = [ "ethbloom", "fixed-hash", @@ -1466,16 +1490,17 @@ dependencies = [ [[package]] name = "event-listener" -version = "2.5.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59" +checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" [[package]] name = "evm" -version = "0.33.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2068bbfe82315b76637b601c73810ec7e92d542bad02f0155182915e832c6357" +checksum = "be8ff320c1e25e7f6d676858f16ffd9b0493d2cc67c3d900c6f2ed027b747f43" dependencies = [ + "auto_impl", "environmental", "ethereum", "evm-core", @@ -1487,16 +1512,15 @@ dependencies = [ "rlp", "scale-info", "serde", - "sha3 0.8.2", + "sha3 0.10.1", ] [[package]] name = "evm-core" -version = "0.33.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dfe4f2a56c4c05a8107b8596380e2332fc2019ffcf56b8f2d01971393a30c4d" +checksum = "9d4537041d3a3438d59b2d01bd950ce89fb1ccb3cf21d9331193c10be12e849f" dependencies = [ - "funty", "parity-scale-codec", "primitive-types", "scale-info", @@ -1505,9 +1529,9 @@ dependencies = [ [[package]] name = "evm-gasometer" -version = "0.33.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c446679607eacac4e8c8738e20c97ea9b3c86eddd8b43666744b05f416037bd9" +checksum = "6181da8734c86873ac9b3f9886d4e00105361039dcfb9f621be9a0ddb8f43961" dependencies = [ "environmental", "evm-core", @@ -1517,14 +1541,15 @@ dependencies = [ [[package]] name = "evm-runtime" -version = "0.33.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "419e8434ac6e850a8a4bc09a19406264582d1940913b2920be2af948f4ffc49b" +checksum = "f6157af91ca70fcf3581afaea1fa25974a71b9ef63d454c08dfba93ab0c7715d" dependencies = [ + "auto_impl", "environmental", "evm-core", "primitive-types", - "sha3 0.8.2", + "sha3 0.10.1", ] [[package]] @@ -1533,7 +1558,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures 0.3.18", + "futures 0.3.21", ] [[package]] @@ -1550,9 +1575,9 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fastrand" -version = "1.5.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b394ed3d285a429378d3b384b9eb1285267e7df4b166df24b7a6939a04dc392e" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" dependencies = [ "instant", ] @@ -1560,37 +1585,29 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/chainx-org/frontier?branch=new-polkadot-v0.9.11#9561763b3e254574766023f67aac555c8ceae814" +source = "git+https://github.com/chainx-org/frontier?branch=polkadot-v0.9.18#4e91f788ba02a0add42f09cae21bf96e3d346330" dependencies = [ "async-trait", - "derive_more", "fc-db", "fp-consensus", "fp-rpc", - "futures 0.3.18", - "log", - "parity-scale-codec", "sc-client-api", "sc-consensus", "sp-api", "sp-block-builder", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-inherents", "sp-runtime", - "sp-timestamp", + "thiserror", ] [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/chainx-org/frontier?branch=new-polkadot-v0.9.11#9561763b3e254574766023f67aac555c8ceae814" +source = "git+https://github.com/chainx-org/frontier?branch=polkadot-v0.9.18#4e91f788ba02a0add42f09cae21bf96e3d346330" dependencies = [ "fp-storage", - "kvdb", "kvdb-rocksdb", - "pallet-ethereum", "parity-scale-codec", "parking_lot 0.11.2", "sp-core", @@ -1601,14 +1618,13 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/chainx-org/frontier?branch=new-polkadot-v0.9.11#9561763b3e254574766023f67aac555c8ceae814" +source = "git+https://github.com/chainx-org/frontier?branch=polkadot-v0.9.18#4e91f788ba02a0add42f09cae21bf96e3d346330" dependencies = [ - "fc-consensus", "fc-db", "fp-consensus", "fp-rpc", - "futures 0.3.18", - "futures-timer 3.0.2", + "futures 0.3.21", + "futures-timer", "log", "sc-client-api", "sp-api", @@ -1619,53 +1635,49 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/chainx-org/frontier?branch=new-polkadot-v0.9.11#9561763b3e254574766023f67aac555c8ceae814" +source = "git+https://github.com/chainx-org/frontier?branch=polkadot-v0.9.18#4e91f788ba02a0add42f09cae21bf96e3d346330" dependencies = [ "ethereum", "ethereum-types", "evm", - "fc-consensus", "fc-db", "fc-rpc-core", - "fp-consensus", - "fp-evm", "fp-rpc", "fp-storage", - "futures 0.3.18", + "futures 0.3.21", + "hex", "jsonrpc-core", "jsonrpc-core-client", - "jsonrpc-derive", "jsonrpc-pubsub", - "libsecp256k1 0.3.5", + "libsecp256k1 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "log", - "lru", + "lru 0.7.5", "pallet-ethereum", - "pallet-evm", "parity-scale-codec", - "parking_lot 0.11.2", - "rand 0.7.3", + "prometheus", + "rand 0.8.5", "rlp", - "rustc-hex", "sc-client-api", "sc-network", "sc-rpc", "sc-service", "sc-transaction-pool", "sc-transaction-pool-api", - "sha3 0.8.2", "sp-api", "sp-block-builder", "sp-blockchain", + "sp-core", "sp-io", "sp-runtime", "sp-storage", - "sp-transaction-pool", + "substrate-prometheus-endpoint", + "tokio", ] [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/chainx-org/frontier?branch=new-polkadot-v0.9.11#9561763b3e254574766023f67aac555c8ceae814" +source = "git+https://github.com/chainx-org/frontier?branch=polkadot-v0.9.18#4e91f788ba02a0add42f09cae21bf96e3d346330" dependencies = [ "ethereum", "ethereum-types", @@ -1677,7 +1689,6 @@ dependencies = [ "rustc-hex", "serde", "serde_json", - "sha3 0.8.2", ] [[package]] @@ -1691,9 +1702,9 @@ dependencies = [ [[package]] name = "file-per-thread-logger" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fdbe0d94371f9ce939b555dd342d0686cc4c0cadbcd4b61d70af5ff97eb4126" +checksum = "21e16290574b39ee41c71aeb90ae960c504ebaf1e2a1c87bd52aa56ed6e1a02f" dependencies = [ "env_logger", "log", @@ -1701,13 +1712,13 @@ dependencies = [ [[package]] name = "finality-grandpa" -version = "0.14.4" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8ac3ff5224ef91f3c97e03eb1de2db82743427e91aaa5ac635f454f0b164f5a" +checksum = "d9def033d8505edf199f6a5d07aa7e6d2d6185b164293b77f0efd108f4f3e11d" dependencies = [ "either", - "futures 0.3.18", - "futures-timer 3.0.2", + "futures 0.3.21", + "futures-timer", "log", "num-traits", "parity-scale-codec", @@ -1722,22 +1733,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" dependencies = [ "byteorder", - "rand 0.8.4", + "rand 0.8.5", "rustc-hex", "static_assertions", ] [[package]] name = "fixedbitset" -version = "0.2.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" +checksum = "279fb028e20b3c4c320317955b77c5e0c9701f05a1d309905d6fc702cdc5053e" [[package]] name = "flate2" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f" +checksum = "b39522e96686d38f4bc984b9198e3a0613264abaebaff2c5c918bfa6b6da09af" dependencies = [ "cfg-if 1.0.0", "crc32fast", @@ -1755,7 +1766,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "parity-scale-codec", ] @@ -1773,12 +1784,10 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/chainx-org/frontier?branch=new-polkadot-v0.9.11#9561763b3e254574766023f67aac555c8ceae814" +source = "git+https://github.com/chainx-org/frontier?branch=polkadot-v0.9.18#4e91f788ba02a0add42f09cae21bf96e3d346330" dependencies = [ "ethereum", "parity-scale-codec", - "rlp", - "sha3 0.8.2", "sp-core", "sp-runtime", "sp-std", @@ -1787,7 +1796,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/chainx-org/frontier?branch=new-polkadot-v0.9.11#9561763b3e254574766023f67aac555c8ceae814" +source = "git+https://github.com/chainx-org/frontier?branch=polkadot-v0.9.18#4e91f788ba02a0add42f09cae21bf96e3d346330" dependencies = [ "evm", "parity-scale-codec", @@ -1799,7 +1808,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/chainx-org/frontier?branch=new-polkadot-v0.9.11#9561763b3e254574766023f67aac555c8ceae814" +source = "git+https://github.com/chainx-org/frontier?branch=polkadot-v0.9.18#4e91f788ba02a0add42f09cae21bf96e3d346330" dependencies = [ "ethereum", "ethereum-types", @@ -1816,7 +1825,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/chainx-org/frontier?branch=new-polkadot-v0.9.11#9561763b3e254574766023f67aac555c8ceae814" +source = "git+https://github.com/chainx-org/frontier?branch=polkadot-v0.9.18#4e91f788ba02a0add42f09cae21bf96e3d346330" dependencies = [ "ethereum", "frame-support", @@ -1824,8 +1833,7 @@ dependencies = [ "parity-util-mem", "scale-info", "serde", - "sha3 0.8.2", - "sp-core", + "sp-debug-derive", "sp-io", "sp-runtime", ] @@ -1833,12 +1841,15 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/chainx-org/frontier?branch=new-polkadot-v0.9.11#9561763b3e254574766023f67aac555c8ceae814" +source = "git+https://github.com/chainx-org/frontier?branch=polkadot-v0.9.18#4e91f788ba02a0add42f09cae21bf96e3d346330" +dependencies = [ + "parity-scale-codec", +] [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-support", "frame-system", @@ -1847,7 +1858,9 @@ dependencies = [ "parity-scale-codec", "paste", "scale-info", + "serde", "sp-api", + "sp-application-crypto", "sp-io", "sp-runtime", "sp-runtime-interface", @@ -1858,33 +1871,48 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "Inflector", "chrono", + "clap", "frame-benchmarking", "frame-support", "handlebars", + "hash-db", + "hex", + "itertools", + "kvdb", "linked-hash-map", "log", + "memory-db", "parity-scale-codec", + "rand 0.8.5", "sc-cli", + "sc-client-api", "sc-client-db", "sc-executor", "sc-service", "serde", + "serde_json", + "serde_nanos", + "sp-api", + "sp-blockchain", "sp-core", + "sp-database", "sp-externalities", "sp-keystore", "sp-runtime", "sp-state-machine", - "structopt", + "sp-std", + "sp-storage", + "sp-trie", ] [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-support", "frame-system", @@ -1899,9 +1927,9 @@ dependencies = [ [[package]] name = "frame-metadata" -version = "14.2.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ed5e5c346de62ca5c184b4325a6600d1eaca210666e4606fe4e449574978d0" +checksum = "df6bb8542ef006ef0de09a5c4420787d79823c0ed7924225822362fd2bf2ff2d" dependencies = [ "cfg-if 1.0.0", "parity-scale-codec", @@ -1912,7 +1940,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "bitflags", "frame-metadata", @@ -1927,6 +1955,7 @@ dependencies = [ "smallvec", "sp-arithmetic", "sp-core", + "sp-core-hashing-proc-macro", "sp-inherents", "sp-io", "sp-runtime", @@ -1934,12 +1963,13 @@ dependencies = [ "sp-state-machine", "sp-std", "sp-tracing", + "tt-call", ] [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -1951,10 +1981,10 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn", @@ -1963,7 +1993,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "proc-macro2", "quote", @@ -1973,7 +2003,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-support", "log", @@ -1990,7 +2020,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-benchmarking", "frame-support", @@ -2005,19 +2035,30 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "parity-scale-codec", "sp-api", ] [[package]] -name = "fs-swap" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d47dad3685eceed8488986cad3d5027165ea5edb164331770e2059555f10a5" +name = "frame-try-runtime" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ - "lazy_static", + "frame-support", + "sp-api", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "fs-swap" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03d47dad3685eceed8488986cad3d5027165ea5edb164331770e2059555f10a5" +dependencies = [ + "lazy_static", "libc", "libloading 0.5.2", "winapi 0.3.9", @@ -2033,6 +2074,12 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "fs_extra" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" + [[package]] name = "fuchsia-zircon" version = "0.3.3" @@ -2051,9 +2098,9 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "funty" -version = "1.1.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" @@ -2063,9 +2110,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.18" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd0210d8c325c245ff06fd95a3b13689a1a276ac8cfa8e8720cb840bfb84b9e" +checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" dependencies = [ "futures-channel", "futures-core", @@ -2078,9 +2125,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.18" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc8cd39e3dbf865f7340dce6a2d401d24fd37c6fe6c4f0ee0de8bfca2252d27" +checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" dependencies = [ "futures-core", "futures-sink", @@ -2088,15 +2135,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.18" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629316e42fe7c2a0b9a65b47d159ceaa5453ab14e8f0a3c5eedbb8cd55b4a445" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" [[package]] name = "futures-executor" -version = "0.3.18" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b808bf53348a36cab739d7e04755909b9fcaaa69b7d7e588b37b6ec62704c97" +checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" dependencies = [ "futures-core", "futures-task", @@ -2106,9 +2153,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.18" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e481354db6b5c353246ccf6a728b0c5511d752c08da7260546fc0933869daa11" +checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" [[package]] name = "futures-lite" @@ -2121,15 +2168,15 @@ dependencies = [ "futures-io", "memchr", "parking", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.9", "waker-fn", ] [[package]] name = "futures-macro" -version = "0.3.18" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89f17b21645bc4ed773c69af9c9a0effd4a3f1a3876eadd453469f8854e7fdd" +checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ "proc-macro2", "quote", @@ -2143,27 +2190,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a1387e07917c711fb4ee4f48ea0adb04a3c9739e53ef85bf43ae1edc2937a8b" dependencies = [ "futures-io", - "rustls", - "webpki", + "rustls 0.19.1", + "webpki 0.21.4", ] [[package]] name = "futures-sink" -version = "0.3.18" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "996c6442437b62d21a32cd9906f9c41e7dc1e19a9579843fad948696769305af" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" [[package]] name = "futures-task" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dabf1872aaab32c886832f2276d2f5399887e2bd613698a02359e4ea83f8de12" - -[[package]] -name = "futures-timer" -version = "2.0.2" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1de7508b218029b0f01662ed8f61b1c964b3ae99d6f25462d0f55a595109df6" +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" [[package]] name = "futures-timer" @@ -2173,9 +2214,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.18" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d22213122356472061ac0f1ab2cee28d2bac8491410fd68c2af53d1cedb83e" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" dependencies = [ "futures 0.1.31", "futures-channel", @@ -2185,7 +2226,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.9", "pin-utils", "slab", ] @@ -2201,9 +2242,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.4" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" dependencies = [ "typenum", "version_check", @@ -2224,9 +2265,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.3" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" dependencies = [ "cfg-if 1.0.0", "libc", @@ -2245,21 +2286,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.25.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7" +checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" dependencies = [ "fallible-iterator", "indexmap", "stable_deref_trait", ] -[[package]] -name = "gimli" -version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" - [[package]] name = "glob" version = "0.3.0" @@ -2281,22 +2316,40 @@ dependencies = [ [[package]] name = "gloo-timers" -version = "0.2.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f16c88aa13d2656ef20d1c042086b8767bbe2bdb62526894275a1b062161b2e" +checksum = "5fb7d06c1c8cc2a29bee7ec961009a0b2caa0793ee4900c2ffb348734ba1c8f9" dependencies = [ "futures-channel", "futures-core", "js-sys", "wasm-bindgen", - "web-sys", +] + +[[package]] +name = "h2" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" +dependencies = [ + "bytes 1.1.0", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util 0.7.1", + "tracing", ] [[package]] name = "handlebars" -version = "3.5.5" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4498fc115fa7d34de968184e473529abb40eeb6be8bc5f7faba3d08c316cb3e3" +checksum = "99d6a30320f094710245150395bc763ad23128d6a1ebbad7594dc4164b62c56b" dependencies = [ "log", "pest", @@ -2330,6 +2383,15 @@ dependencies = [ "ahash", ] +[[package]] +name = "hashbrown" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c21d40587b92fa6a6c6e3c1bdbf87d75511db5672f9c93175574b3a00df1758" +dependencies = [ + "ahash", +] + [[package]] name = "heck" version = "0.3.3" @@ -2339,6 +2401,12 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -2366,16 +2434,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" -[[package]] -name = "hmac" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695" -dependencies = [ - "crypto-mac 0.7.0", - "digest 0.8.1", -] - [[package]] name = "hmac" version = "0.8.1" @@ -2396,17 +2454,6 @@ dependencies = [ "digest 0.9.0", ] -[[package]] -name = "hmac-drbg" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6e570451493f10f6581b48cdd530413b63ea9e780f544bfd3bdcaa0d89d1a7b" -dependencies = [ - "digest 0.8.1", - "generic-array 0.12.4", - "hmac 0.7.1", -] - [[package]] name = "hmac-drbg" version = "0.3.0" @@ -2414,7 +2461,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ "digest 0.9.0", - "generic-array 0.14.4", + "generic-array 0.14.5", "hmac 0.8.1", ] @@ -2431,13 +2478,13 @@ dependencies = [ [[package]] name = "http" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1323096b05d41827dadeaee54c9981958c0f94e670bc94ed80037d1a7b8b186b" +checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" dependencies = [ "bytes 1.1.0", "fnv", - "itoa", + "itoa 1.0.1", ] [[package]] @@ -2448,14 +2495,14 @@ checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" dependencies = [ "bytes 1.1.0", "http", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.9", ] [[package]] name = "httparse" -version = "1.5.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503" +checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" [[package]] name = "httpdate" @@ -2465,30 +2512,28 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "humantime" -version = "1.3.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -dependencies = [ - "quick-error 1.2.3", -] +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.15" +version = "0.14.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436ec0091e4f20e655156a30a0df3770fe2900aa301e548e08446ec794b6953c" +checksum = "b26ae0a80afebe130861d90abf98e3814a4f28a4c6ffeb5ab8ebb2be311e0ef2" dependencies = [ "bytes 1.1.0", "futures-channel", "futures-core", "futures-util", + "h2", "http", "http-body", "httparse", "httpdate", - "itoa", - "pin-project-lite 0.2.7", - "socket2 0.4.2", + "itoa 1.0.1", + "pin-project-lite 0.2.9", + "socket2 0.4.4", "tokio", "tower-service", "tracing", @@ -2505,11 +2550,11 @@ dependencies = [ "futures-util", "hyper", "log", - "rustls", - "rustls-native-certs", + "rustls 0.19.1", + "rustls-native-certs 0.5.0", "tokio", - "tokio-rustls", - "webpki", + "tokio-rustls 0.22.0", + "webpki 0.21.4", ] [[package]] @@ -2562,7 +2607,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae8ab7f67bad3240049cb24fb9cb0b4c2c6af4c245840917fbbdededeee91179" dependencies = [ "async-io", - "futures 0.3.18", + "futures 0.3.21", "futures-lite", "if-addrs", "ipnet", @@ -2573,9 +2618,9 @@ dependencies = [ [[package]] name = "impl-codec" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "161ebdfec3c8e3b52bf61c4f3550a1eea4f9579d10dc1b936f3171ebdcd6c443" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" dependencies = [ "parity-scale-codec", ] @@ -2600,9 +2645,9 @@ dependencies = [ [[package]] name = "impl-trait-for-tuples" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5dacb10c5b3bb92d46ba347505a9041e676bb20ad220101326bffb0c93031ee" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ "proc-macro2", "quote", @@ -2611,12 +2656,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.11.2", "serde", ] @@ -2639,13 +2684,12 @@ dependencies = [ ] [[package]] -name = "intervalier" -version = "0.4.0" +name = "io-lifetimes" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64fa110ec7b8f493f416eed552740d10e7030ad5f63b2308f82c9608ec2df275" +checksum = "f6ef6787e7f0faedc040f95716bdd0e62bcfcf4ba93da053b62dea2691c13864" dependencies = [ - "futures 0.3.18", - "futures-timer 2.0.2", + "winapi 0.3.9", ] [[package]] @@ -2677,9 +2721,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.3.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9" +checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" [[package]] name = "itertools" @@ -2696,6 +2740,12 @@ version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" +[[package]] +name = "itoa" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" + [[package]] name = "jobserver" version = "0.1.24" @@ -2707,9 +2757,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.55" +version = "0.3.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" +checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" dependencies = [ "wasm-bindgen", ] @@ -2721,7 +2771,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2b99d4207e2a04fb4581746903c2bb7eb376f88de9c699d0f3e10feeac0cd3a" dependencies = [ "derive_more", - "futures 0.3.18", + "futures 0.3.21", "jsonrpc-core", "jsonrpc-pubsub", "log", @@ -2736,7 +2786,7 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb" dependencies = [ - "futures 0.3.18", + "futures 0.3.21", "futures-executor", "futures-util", "log", @@ -2751,7 +2801,7 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b51da17abecbdab3e3d4f26b01c5ec075e88d3abe3ab3b05dc9aa69392764ec0" dependencies = [ - "futures 0.3.18", + "futures 0.3.21", "jsonrpc-client-transports", ] @@ -2773,7 +2823,7 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1dea6e07251d9ce6a552abfb5d7ad6bc290a4596c8dcc3d795fae2bbdc1f3ff" dependencies = [ - "futures 0.3.18", + "futures 0.3.21", "hyper", "jsonrpc-core", "jsonrpc-server-utils", @@ -2789,7 +2839,7 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "382bb0206323ca7cda3dcd7e245cea86d37d02457a02a975e3378fb149a48845" dependencies = [ - "futures 0.3.18", + "futures 0.3.21", "jsonrpc-core", "jsonrpc-server-utils", "log", @@ -2804,7 +2854,7 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240f87695e6c6f62fb37f05c02c04953cf68d6408b8c1c89de85c7a0125b1011" dependencies = [ - "futures 0.3.18", + "futures 0.3.21", "jsonrpc-core", "lazy_static", "log", @@ -2820,14 +2870,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa4fdea130485b572c39a460d50888beb00afb3e35de23ccd7fad8ff19f0e0d4" dependencies = [ "bytes 1.1.0", - "futures 0.3.18", + "futures 0.3.21", "globset", "jsonrpc-core", "lazy_static", "log", "tokio", "tokio-stream", - "tokio-util", + "tokio-util 0.6.9", "unicase", ] @@ -2837,7 +2887,7 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f892c7d766369475ab7b0669f417906302d7c0fb521285c0a0c92e52e7c8e946" dependencies = [ - "futures 0.3.18", + "futures 0.3.21", "jsonrpc-core", "jsonrpc-server-utils", "log", @@ -2846,6 +2896,164 @@ dependencies = [ "slab", ] +[[package]] +name = "jsonrpsee" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6373a33d987866ccfe1af4bc11b089dce941764313f9fd8b7cf13fcb51b72dc5" +dependencies = [ + "jsonrpsee-types 0.4.1", + "jsonrpsee-utils", + "jsonrpsee-ws-client 0.4.1", +] + +[[package]] +name = "jsonrpsee" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05fd8cd6c6b1bbd06881d2cf88f1fc83cc36c98f2219090f839115fb4a956cb9" +dependencies = [ + "jsonrpsee-core", + "jsonrpsee-proc-macros", + "jsonrpsee-types 0.8.0", + "jsonrpsee-ws-client 0.8.0", +] + +[[package]] +name = "jsonrpsee-client-transport" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3303cdf246e6ab76e2866fb3d9acb6c76a068b1b28bd923a1b7a8122257ad7b5" +dependencies = [ + "futures 0.3.21", + "http", + "jsonrpsee-core", + "jsonrpsee-types 0.8.0", + "pin-project 1.0.10", + "rustls-native-certs 0.6.2", + "soketto", + "thiserror", + "tokio", + "tokio-rustls 0.23.3", + "tokio-util 0.6.9", + "tracing", + "webpki-roots 0.22.3", +] + +[[package]] +name = "jsonrpsee-core" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f220b5a238dc7992b90f1144fbf6eaa585872c9376afe6fe6863ffead6191bf3" +dependencies = [ + "anyhow", + "arrayvec 0.7.2", + "async-trait", + "beef", + "futures-channel", + "futures-util", + "hyper", + "jsonrpsee-types 0.8.0", + "rustc-hash", + "serde", + "serde_json", + "soketto", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "jsonrpsee-proc-macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4299ebf790ea9de1cb72e73ff2ae44c723ef264299e5e2d5ef46a371eb3ac3d8" +dependencies = [ + "proc-macro-crate 1.1.3", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62f778cf245158fbd8f5d50823a2e9e4c708a40be164766bd35e9fb1d86715b2" +dependencies = [ + "anyhow", + "async-trait", + "beef", + "futures-channel", + "futures-util", + "hyper", + "log", + "serde", + "serde_json", + "soketto", + "thiserror", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b3f601bbbe45cd63f5407b6f7d7950e08a7d4f82aa699ff41a4a5e9e54df58" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "jsonrpsee-utils" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0109c4f972058f3b1925b73a17210aff7b63b65967264d0045d15ee88fe84f0c" +dependencies = [ + "arrayvec 0.7.2", + "beef", + "jsonrpsee-types 0.4.1", +] + +[[package]] +name = "jsonrpsee-ws-client" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "559aa56fc402af206c00fc913dc2be1d9d788dcde045d14df141a535245d35ef" +dependencies = [ + "arrayvec 0.7.2", + "async-trait", + "fnv", + "futures 0.3.21", + "http", + "jsonrpsee-types 0.4.1", + "log", + "pin-project 1.0.10", + "rustls-native-certs 0.5.0", + "serde", + "serde_json", + "soketto", + "thiserror", + "tokio", + "tokio-rustls 0.22.0", + "tokio-util 0.6.9", +] + +[[package]] +name = "jsonrpsee-ws-client" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aff425cee7c779e33920913bc695447416078ee6d119f443f3060feffa4e86b5" +dependencies = [ + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types 0.8.0", +] + [[package]] name = "keccak" version = "0.1.0" @@ -2873,9 +3081,9 @@ dependencies = [ [[package]] name = "kvdb" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a3f58dc069ec0e205a27f5b45920722a46faed802a0541538241af6228f512" +checksum = "a301d8ecb7989d4a6e2c57a49baca77d353bdbf879909debe3f375fe25d61f86" dependencies = [ "parity-util-mem", "smallvec", @@ -2883,20 +3091,20 @@ dependencies = [ [[package]] name = "kvdb-memorydb" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3b6b85fc643f5acd0bffb2cc8a6d150209379267af0d41db72170021841f9f5" +checksum = "ece7e668abd21387aeb6628130a6f4c802787f014fa46bc83221448322250357" dependencies = [ "kvdb", "parity-util-mem", - "parking_lot 0.11.2", + "parking_lot 0.12.0", ] [[package]] name = "kvdb-rocksdb" -version = "0.14.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b1b6ea8f2536f504b645ad78419c8246550e19d2c3419a167080ce08edee35a" +checksum = "ca7fbdfd71cd663dceb0faf3367a99f8cf724514933e9867cec4995b6027cbc1" dependencies = [ "fs-swap", "kvdb", @@ -2904,7 +3112,7 @@ dependencies = [ "num_cpus", "owning_ref", "parity-util-mem", - "parking_lot 0.11.2", + "parking_lot 0.12.0", "regex", "rocksdb", "smallvec", @@ -2927,9 +3135,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.109" +version = "0.2.124" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98a04dce437184842841303488f70d0188c5f51437d2a834dc097eafa909a01" +checksum = "21a41fed9d98f27ab1c6d161da622a4fa35e8a54a8adc24bbf3ddd0ef70b0e50" [[package]] name = "libloading" @@ -2943,9 +3151,9 @@ dependencies = [ [[package]] name = "libloading" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afe203d669ec979b7128619bae5a63b7b42e9203c1b29146079ee05e2f604b52" +checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" dependencies = [ "cfg-if 1.0.0", "winapi 0.3.9", @@ -2953,19 +3161,19 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" +checksum = "33a33a362ce288760ec6a508b94caaec573ae7d3bbbd91b87aa0bad4456839db" [[package]] name = "libp2p" -version = "0.39.1" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9004c06878ef8f3b4b4067e69a140d87ed20bf777287f82223e49713b36ee433" +checksum = "3bec54343492ba5940a6c555e512c6721139835d28c59bc22febece72dfd0d9d" dependencies = [ "atomic", "bytes 1.1.0", - "futures 0.3.18", + "futures 0.3.21", "lazy_static", "libp2p-core", "libp2p-deflate", @@ -2975,12 +3183,14 @@ dependencies = [ "libp2p-identify", "libp2p-kad", "libp2p-mdns", + "libp2p-metrics", "libp2p-mplex", "libp2p-noise", "libp2p-ping", "libp2p-plaintext", "libp2p-pnet", "libp2p-relay", + "libp2p-rendezvous", "libp2p-request-response", "libp2p-swarm", "libp2p-swarm-derive", @@ -2991,38 +3201,39 @@ dependencies = [ "libp2p-yamux", "multiaddr", "parking_lot 0.11.2", - "pin-project 1.0.8", + "pin-project 1.0.10", "smallvec", "wasm-timer", ] [[package]] name = "libp2p-core" -version = "0.29.0" +version = "0.30.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af9b4abdeaa420593a297c8592f63fad4234f4b88dc9343b8fd8e736c35faa59" +checksum = "86aad7d54df283db817becded03e611137698a6509d4237a96881976a162340c" dependencies = [ "asn1_der", "bs58 0.4.0", "ed25519-dalek", "either", "fnv", - "futures 0.3.18", - "futures-timer 3.0.2", + "futures 0.3.21", + "futures-timer", + "instant", "lazy_static", - "libsecp256k1 0.5.0", + "libsecp256k1 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "log", "multiaddr", "multihash 0.14.0", "multistream-select", "parking_lot 0.11.2", - "pin-project 1.0.8", + "pin-project 1.0.10", "prost", "prost-build", - "rand 0.7.3", + "rand 0.8.5", "ring", "rw-stream-sink", - "sha2 0.9.8", + "sha2 0.9.9", "smallvec", "thiserror", "unsigned-varint 0.7.1", @@ -3032,23 +3243,23 @@ dependencies = [ [[package]] name = "libp2p-deflate" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66097fccc0b7f8579f90a03ea76ba6196332ea049fd07fd969490a06819dcdc8" +checksum = "51a800adb195f33de63f4b17b63fe64cfc23bf2c6a0d3d0d5321328664e65197" dependencies = [ "flate2", - "futures 0.3.18", + "futures 0.3.21", "libp2p-core", ] [[package]] name = "libp2p-dns" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58ff08b3196b85a17f202d80589e93b1660a574af67275706657fdc762e42c32" +checksum = "bb8f89d15cb6e3c5bc22afff7513b11bab7856f2872d3cfba86f7f63a06bc498" dependencies = [ "async-std-resolver", - "futures 0.3.18", + "futures 0.3.21", "libp2p-core", "log", "smallvec", @@ -3057,13 +3268,13 @@ dependencies = [ [[package]] name = "libp2p-floodsub" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "404eca8720967179dac7a5b4275eb91f904a53859c69ca8d018560ad6beb214f" +checksum = "aab3d7210901ea51b7bae2b581aa34521797af8c4ec738c980bda4a06434067f" dependencies = [ "cuckoofilter", "fnv", - "futures 0.3.18", + "futures 0.3.21", "libp2p-core", "libp2p-swarm", "log", @@ -3075,16 +3286,16 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1cc48709bcbc3a3321f08a73560b4bbb4166a7d56f6fdb615bc775f4f91058e" +checksum = "dfeead619eb5dac46e65acc78c535a60aaec803d1428cca6407c3a4fc74d698d" dependencies = [ "asynchronous-codec 0.6.0", - "base64 0.13.0", + "base64", "byteorder", "bytes 1.1.0", "fnv", - "futures 0.3.18", + "futures 0.3.21", "hex_fmt", "libp2p-core", "libp2p-swarm", @@ -3093,7 +3304,7 @@ dependencies = [ "prost-build", "rand 0.7.3", "regex", - "sha2 0.9.8", + "sha2 0.9.9", "smallvec", "unsigned-varint 0.7.1", "wasm-timer", @@ -3101,14 +3312,15 @@ dependencies = [ [[package]] name = "libp2p-identify" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7b61f6cf07664fb97016c318c4d4512b3dd4cc07238607f3f0163245f99008e" +checksum = "cca1275574183f288ff8b72d535d5ffa5ea9292ef7829af8b47dcb197c7b0dcd" dependencies = [ - "futures 0.3.18", + "futures 0.3.21", "libp2p-core", "libp2p-swarm", "log", + "lru 0.6.6", "prost", "prost-build", "smallvec", @@ -3117,23 +3329,23 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50ed78489c87924235665a0ab345b298ee34dff0f7ad62c0ba6608b2144fb75e" +checksum = "a2297dc0ca285f3a09d1368bde02449e539b46f94d32d53233f53f6625bcd3ba" dependencies = [ "arrayvec 0.5.2", "asynchronous-codec 0.6.0", "bytes 1.1.0", "either", "fnv", - "futures 0.3.18", + "futures 0.3.21", "libp2p-core", "libp2p-swarm", "log", "prost", "prost-build", "rand 0.7.3", - "sha2 0.9.8", + "sha2 0.9.9", "smallvec", "uint", "unsigned-varint 0.7.1", @@ -3143,34 +3355,48 @@ dependencies = [ [[package]] name = "libp2p-mdns" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a29e6cbc2a24b8471b6567e580a0e8e7b70a6d0f0ea2be0844d1e842d7d4fa33" +checksum = "14c864b64bdc8a84ff3910a0df88e6535f256191a450870f1e7e10cbf8e64d45" dependencies = [ "async-io", "data-encoding", "dns-parser", - "futures 0.3.18", + "futures 0.3.21", "if-watch", "lazy_static", "libp2p-core", "libp2p-swarm", "log", - "rand 0.8.4", + "rand 0.8.5", "smallvec", - "socket2 0.4.2", + "socket2 0.4.4", "void", ] +[[package]] +name = "libp2p-metrics" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4af432fcdd2f8ba4579b846489f8f0812cfd738ced2c0af39df9b1c48bbb6ab2" +dependencies = [ + "libp2p-core", + "libp2p-identify", + "libp2p-kad", + "libp2p-ping", + "libp2p-swarm", + "open-metrics-client", +] + [[package]] name = "libp2p-mplex" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "313d9ea526c68df4425f580024e67a9d3ffd49f2c33de5154b1f5019816f7a99" +checksum = "7f2cd64ef597f40e14bfce0497f50ecb63dd6d201c61796daeb4227078834fbf" dependencies = [ "asynchronous-codec 0.6.0", "bytes 1.1.0", - "futures 0.3.18", + "futures 0.3.21", "libp2p-core", "log", "nohash-hasher", @@ -3182,20 +3408,20 @@ dependencies = [ [[package]] name = "libp2p-noise" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f1db7212f342b6ba7c981cc40e31f76e9e56cb48e65fa4c142ecaca5839523e" +checksum = "a8772c7a99088221bb7ca9c5c0574bf55046a7ab4c319f3619b275f28c8fb87a" dependencies = [ "bytes 1.1.0", "curve25519-dalek 3.2.0", - "futures 0.3.18", + "futures 0.3.21", "lazy_static", "libp2p-core", "log", "prost", "prost-build", - "rand 0.8.4", - "sha2 0.9.8", + "rand 0.8.5", + "sha2 0.9.9", "snow", "static_assertions", "x25519-dalek", @@ -3204,11 +3430,11 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2482cfd9eb0b7a0baaf3e7b329dc4f2785181a161b1a47b7192f8d758f54a439" +checksum = "80ef7b0ec5cf06530d9eb6cf59ae49d46a2c45663bde31c25a12f682664adbcf" dependencies = [ - "futures 0.3.18", + "futures 0.3.21", "libp2p-core", "libp2p-swarm", "log", @@ -3219,13 +3445,13 @@ dependencies = [ [[package]] name = "libp2p-plaintext" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13b4783e5423870b9a5c199f65a7a3bc66d86ab56b2b9beebf3c338d889cf8e4" +checksum = "5fba1a6ff33e4a274c89a3b1d78b9f34f32af13265cc5c46c16938262d4e945a" dependencies = [ "asynchronous-codec 0.6.0", "bytes 1.1.0", - "futures 0.3.18", + "futures 0.3.21", "libp2p-core", "log", "prost", @@ -3236,13 +3462,13 @@ dependencies = [ [[package]] name = "libp2p-pnet" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07cb4dd4b917e5b40ddefe49b96b07adcd8d342e0317011d175b7b2bb1dcc974" +checksum = "0f1a458bbda880107b5b36fcb9b5a1ef0c329685da0e203ed692a8ebe64cc92c" dependencies = [ - "futures 0.3.18", + "futures 0.3.21", "log", - "pin-project 1.0.8", + "pin-project 1.0.10", "rand 0.7.3", "salsa20", "sha3 0.9.1", @@ -3250,18 +3476,18 @@ dependencies = [ [[package]] name = "libp2p-relay" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0133f6cfd81cdc16e716de2982e012c62e6b9d4f12e41967b3ee361051c622aa" +checksum = "2852b61c90fa8ce3c8fcc2aba76e6cefc20d648f9df29157d6b3a916278ef3e3" dependencies = [ "asynchronous-codec 0.6.0", "bytes 1.1.0", - "futures 0.3.18", - "futures-timer 3.0.2", + "futures 0.3.21", + "futures-timer", "libp2p-core", "libp2p-swarm", "log", - "pin-project 1.0.8", + "pin-project 1.0.10", "prost", "prost-build", "rand 0.7.3", @@ -3271,20 +3497,41 @@ dependencies = [ "wasm-timer", ] +[[package]] +name = "libp2p-rendezvous" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14a6d2b9e7677eff61dc3d2854876aaf3976d84a01ef6664b610c77a0c9407c5" +dependencies = [ + "asynchronous-codec 0.6.0", + "bimap", + "futures 0.3.21", + "libp2p-core", + "libp2p-swarm", + "log", + "prost", + "prost-build", + "rand 0.8.5", + "sha2 0.9.9", + "thiserror", + "unsigned-varint 0.7.1", + "void", + "wasm-timer", +] + [[package]] name = "libp2p-request-response" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06cdae44b6821466123af93cbcdec7c9e6ba9534a8af9cdc296446d39416d241" +checksum = "a877a4ced6d46bf84677e1974e8cf61fb434af73b2e96fb48d6cb6223a4634d8" dependencies = [ "async-trait", "bytes 1.1.0", - "futures 0.3.18", + "futures 0.3.21", "libp2p-core", "libp2p-swarm", "log", - "lru", - "minicbor", + "lru 0.7.5", "rand 0.7.3", "smallvec", "unsigned-varint 0.7.1", @@ -3293,12 +3540,12 @@ dependencies = [ [[package]] name = "libp2p-swarm" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7083861341e1555467863b4cd802bea1e8c4787c0f7b5110097d0f1f3248f9a9" +checksum = "3f5184a508f223bc100a12665517773fb8730e9f36fc09eefb670bf01b107ae9" dependencies = [ "either", - "futures 0.3.18", + "futures 0.3.21", "libp2p-core", "log", "rand 0.7.3", @@ -3309,9 +3556,9 @@ dependencies = [ [[package]] name = "libp2p-swarm-derive" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8cb308d4fc854869f5abb54fdab0833d2cf670d407c745849dc47e6e08d79c" +checksum = "072c290f727d39bdc4e9d6d1c847978693d25a673bd757813681e33e5f6c00c2" dependencies = [ "quote", "syn", @@ -3319,40 +3566,40 @@ dependencies = [ [[package]] name = "libp2p-tcp" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79edd26b6b4bb5feee210dcda562dca186940dfecb0024b979c3f50824b3bf28" +checksum = "7399c5b6361ef525d41c11fcf51635724f832baf5819b30d3d873eabb4fbae4b" dependencies = [ "async-io", - "futures 0.3.18", - "futures-timer 3.0.2", + "futures 0.3.21", + "futures-timer", "if-watch", "ipnet", "libc", "libp2p-core", "log", - "socket2 0.4.2", + "socket2 0.4.4", ] [[package]] name = "libp2p-uds" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280e793440dd4e9f273d714f4497325c72cddb0fe85a49f9a03c88f41dd20182" +checksum = "b8b7563e46218165dfd60f64b96f7ce84590d75f53ecbdc74a7dd01450dc5973" dependencies = [ "async-std", - "futures 0.3.18", + "futures 0.3.21", "libp2p-core", "log", ] [[package]] name = "libp2p-wasm-ext" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f553b7140fad3d7a76f50497b0ea591e26737d9607428a75509fc191e4d1b1f6" +checksum = "1008a302b73c5020251f9708c653f5ed08368e530e247cc9cd2f109ff30042cf" dependencies = [ - "futures 0.3.18", + "futures 0.3.21", "js-sys", "libp2p-core", "parity-send-wrapper", @@ -3362,12 +3609,12 @@ dependencies = [ [[package]] name = "libp2p-websocket" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf99dcbf5063e9d59087f61b1e85c686ceab2f5abedb472d32288065c0e5e27" +checksum = "22e12df82d1ed64969371a9e65ea92b91064658604cc2576c2757f18ead9a1cf" dependencies = [ "either", - "futures 0.3.18", + "futures 0.3.21", "futures-rustls", "libp2p-core", "log", @@ -3375,16 +3622,16 @@ dependencies = [ "rw-stream-sink", "soketto", "url 2.2.2", - "webpki-roots", + "webpki-roots 0.21.1", ] [[package]] name = "libp2p-yamux" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "214cc0dd9c37cbed27f0bb1eba0c41bbafdb93a8be5e9d6ae1e6b4b42cd044bf" +checksum = "4e7362abb8867d7187e7e93df17f460d554c997fc5c8ac57dc1259057f6889af" dependencies = [ - "futures 0.3.18", + "futures 0.3.21", "libp2p-core", "parking_lot 0.11.2", "thiserror", @@ -3393,196 +3640,118 @@ dependencies = [ [[package]] name = "librocksdb-sys" -version = "6.20.3" +version = "0.6.1+6.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c309a9d2470844aceb9a4a098cf5286154d20596868b75a6b36357d2bb9ca25d" +checksum = "81bc587013734dadb7cf23468e531aa120788b87243648be42e2d3a072186291" dependencies = [ "bindgen", + "bzip2-sys", "cc", "glob", "libc", -] - -[[package]] -name = "libsecp256k1" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc1e2c808481a63dc6da2074752fdd4336a3c8fcc68b83db6f1fd5224ae7962" -dependencies = [ - "arrayref", - "crunchy", - "digest 0.8.1", - "hmac-drbg 0.2.0", - "rand 0.7.3", - "sha2 0.8.2", - "subtle 2.4.1", - "typenum", -] - -[[package]] -name = "libsecp256k1" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd1137239ab33b41aa9637a88a28249e5e70c40a42ccc92db7f12cc356c1fcd7" -dependencies = [ - "arrayref", - "base64 0.12.3", - "digest 0.9.0", - "hmac-drbg 0.3.0", - "libsecp256k1-core 0.2.2", - "libsecp256k1-gen-ecmult 0.2.1", - "libsecp256k1-gen-genmult 0.2.1", - "rand 0.7.3", - "serde", - "sha2 0.9.8", - "typenum", -] - -[[package]] -name = "libsecp256k1" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" -dependencies = [ - "arrayref", - "base64 0.12.3", - "digest 0.9.0", - "hmac-drbg 0.3.0", - "libsecp256k1-core 0.2.2", - "libsecp256k1-gen-ecmult 0.2.1", - "libsecp256k1-gen-genmult 0.2.1", - "rand 0.7.3", - "serde", - "sha2 0.9.8", - "typenum", + "libz-sys", + "tikv-jemalloc-sys", ] [[package]] name = "libsecp256k1" version = "0.7.0" -source = "git+https://github.com/chainx-org/libsecp256k1?branch=master#b208f8a32831de8c48d15ed9e90ed807f3fe2275" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0452aac8bab02242429380e9b2f94ea20cea2b37e2c1777a1358799bbe97f37" dependencies = [ "arrayref", - "base64 0.13.0", + "base64", "digest 0.9.0", - "hmac-drbg 0.3.0", - "libsecp256k1-core 0.3.0 (git+https://github.com/chainx-org/libsecp256k1?branch=master)", - "libsecp256k1-gen-ecmult 0.3.0 (git+https://github.com/chainx-org/libsecp256k1?branch=master)", - "libsecp256k1-gen-genmult 0.3.0 (git+https://github.com/chainx-org/libsecp256k1?branch=master)", - "rand 0.8.4", + "hmac-drbg", + "libsecp256k1-core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libsecp256k1-gen-ecmult 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libsecp256k1-gen-genmult 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.8.5", "serde", - "sha2 0.9.8", + "sha2 0.9.9", "typenum", ] [[package]] name = "libsecp256k1" version = "0.7.0" -source = "git+https://github.com/chainx-org/libsecp256k1.git#b208f8a32831de8c48d15ed9e90ed807f3fe2275" +source = "git+https://github.com/chainx-org/libsecp256k1?branch=upgrade-2021#7dc70232c6d8e1d3a746c1eaeb701410b61609c2" dependencies = [ "arrayref", - "base64 0.13.0", + "base64", "digest 0.9.0", - "hmac-drbg 0.3.0", - "libsecp256k1-core 0.3.0 (git+https://github.com/chainx-org/libsecp256k1.git)", - "libsecp256k1-gen-ecmult 0.3.0 (git+https://github.com/chainx-org/libsecp256k1.git)", - "libsecp256k1-gen-genmult 0.3.0 (git+https://github.com/chainx-org/libsecp256k1.git)", - "rand 0.8.4", + "hmac-drbg", + "libsecp256k1-core 0.3.0 (git+https://github.com/chainx-org/libsecp256k1?branch=upgrade-2021)", + "libsecp256k1-gen-ecmult 0.3.0 (git+https://github.com/chainx-org/libsecp256k1?branch=upgrade-2021)", + "libsecp256k1-gen-genmult 0.3.0 (git+https://github.com/chainx-org/libsecp256k1?branch=upgrade-2021)", + "rand 0.8.5", "serde", - "sha2 0.9.8", + "sha2 0.9.9", "typenum", ] -[[package]] -name = "libsecp256k1-core" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" -dependencies = [ - "crunchy", - "digest 0.9.0", - "subtle 2.4.1", -] - [[package]] name = "libsecp256k1-core" version = "0.3.0" -source = "git+https://github.com/chainx-org/libsecp256k1?branch=master#b208f8a32831de8c48d15ed9e90ed807f3fe2275" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" dependencies = [ "crunchy", "digest 0.9.0", - "parity-scale-codec", - "scale-info", - "subtle 2.4.1", + "subtle", ] [[package]] name = "libsecp256k1-core" version = "0.3.0" -source = "git+https://github.com/chainx-org/libsecp256k1.git#b208f8a32831de8c48d15ed9e90ed807f3fe2275" +source = "git+https://github.com/chainx-org/libsecp256k1?branch=upgrade-2021#7dc70232c6d8e1d3a746c1eaeb701410b61609c2" dependencies = [ "crunchy", "digest 0.9.0", "parity-scale-codec", "scale-info", - "subtle 2.4.1", -] - -[[package]] -name = "libsecp256k1-gen-ecmult" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" -dependencies = [ - "libsecp256k1-core 0.2.2", + "subtle", ] [[package]] name = "libsecp256k1-gen-ecmult" version = "0.3.0" -source = "git+https://github.com/chainx-org/libsecp256k1?branch=master#b208f8a32831de8c48d15ed9e90ed807f3fe2275" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" dependencies = [ - "libsecp256k1-core 0.3.0 (git+https://github.com/chainx-org/libsecp256k1?branch=master)", + "libsecp256k1-core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libsecp256k1-gen-ecmult" version = "0.3.0" -source = "git+https://github.com/chainx-org/libsecp256k1.git#b208f8a32831de8c48d15ed9e90ed807f3fe2275" +source = "git+https://github.com/chainx-org/libsecp256k1?branch=upgrade-2021#7dc70232c6d8e1d3a746c1eaeb701410b61609c2" dependencies = [ - "libsecp256k1-core 0.3.0 (git+https://github.com/chainx-org/libsecp256k1.git)", -] - -[[package]] -name = "libsecp256k1-gen-genmult" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" -dependencies = [ - "libsecp256k1-core 0.2.2", + "libsecp256k1-core 0.3.0 (git+https://github.com/chainx-org/libsecp256k1?branch=upgrade-2021)", ] [[package]] name = "libsecp256k1-gen-genmult" version = "0.3.0" -source = "git+https://github.com/chainx-org/libsecp256k1?branch=master#b208f8a32831de8c48d15ed9e90ed807f3fe2275" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" dependencies = [ - "libsecp256k1-core 0.3.0 (git+https://github.com/chainx-org/libsecp256k1?branch=master)", + "libsecp256k1-core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libsecp256k1-gen-genmult" version = "0.3.0" -source = "git+https://github.com/chainx-org/libsecp256k1.git#b208f8a32831de8c48d15ed9e90ed807f3fe2275" +source = "git+https://github.com/chainx-org/libsecp256k1?branch=upgrade-2021#7dc70232c6d8e1d3a746c1eaeb701410b61609c2" dependencies = [ - "libsecp256k1-core 0.3.0 (git+https://github.com/chainx-org/libsecp256k1.git)", + "libsecp256k1-core 0.3.0 (git+https://github.com/chainx-org/libsecp256k1?branch=upgrade-2021)", ] [[package]] name = "libz-sys" -version = "1.1.3" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de5435b8549c16d423ed0c03dbaafe57cf6c3344744f1242520d59c9d8ecec66" +checksum = "92e7e15d7610cce1d9752e137625f14e61a28cd45929b6e12e47b50fe154ee2e" dependencies = [ "cc", "pkg-config", @@ -3592,7 +3761,7 @@ dependencies = [ [[package]] name = "light-bitcoin" version = "0.2.0" -source = "git+https://github.com/chainx-org/light-bitcoin?branch=taproot#b6587ef7feca71e6b6a6861c44d85983780b428f" +source = "git+https://github.com/chainx-org/light-bitcoin?branch=upgrade-2021#21fdfaea1ce4788ac96ea620c2026f9ae78b7cdd" dependencies = [ "light-bitcoin-chain", "light-bitcoin-crypto", @@ -3607,7 +3776,7 @@ dependencies = [ [[package]] name = "light-bitcoin-chain" version = "0.2.0" -source = "git+https://github.com/chainx-org/light-bitcoin?branch=taproot#b6587ef7feca71e6b6a6861c44d85983780b428f" +source = "git+https://github.com/chainx-org/light-bitcoin?branch=upgrade-2021#21fdfaea1ce4788ac96ea620c2026f9ae78b7cdd" dependencies = [ "hex", "light-bitcoin-crypto", @@ -3621,27 +3790,27 @@ dependencies = [ [[package]] name = "light-bitcoin-crypto" version = "0.2.0" -source = "git+https://github.com/chainx-org/light-bitcoin?branch=taproot#b6587ef7feca71e6b6a6861c44d85983780b428f" +source = "git+https://github.com/chainx-org/light-bitcoin?branch=upgrade-2021#21fdfaea1ce4788ac96ea620c2026f9ae78b7cdd" dependencies = [ "digest 0.9.0", "light-bitcoin-primitives", "ripemd160", "sha-1 0.9.8", - "sha2 0.9.8", + "sha2 0.9.9", "siphasher", ] [[package]] name = "light-bitcoin-keys" version = "0.2.0" -source = "git+https://github.com/chainx-org/light-bitcoin?branch=taproot#b6587ef7feca71e6b6a6861c44d85983780b428f" +source = "git+https://github.com/chainx-org/light-bitcoin?branch=upgrade-2021#21fdfaea1ce4788ac96ea620c2026f9ae78b7cdd" dependencies = [ "arrayref", "bitcoin-bech32", "bs58 0.4.0", "digest 0.9.0", "hex", - "libsecp256k1 0.7.0 (git+https://github.com/chainx-org/libsecp256k1.git)", + "libsecp256k1 0.7.0 (git+https://github.com/chainx-org/libsecp256k1?branch=upgrade-2021)", "light-bitcoin-crypto", "light-bitcoin-primitives", "light-bitcoin-serialization", @@ -3649,13 +3818,13 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sha2 0.9.8", + "sha2 0.9.9", ] [[package]] name = "light-bitcoin-mast" version = "0.2.0" -source = "git+https://github.com/chainx-org/light-bitcoin?branch=taproot#b6587ef7feca71e6b6a6861c44d85983780b428f" +source = "git+https://github.com/chainx-org/light-bitcoin?branch=upgrade-2021#21fdfaea1ce4788ac96ea620c2026f9ae78b7cdd" dependencies = [ "arrayref", "bitcoin-bech32", @@ -3670,13 +3839,13 @@ dependencies = [ "parity-scale-codec", "rayon", "scale-info", - "sha2 0.9.8", + "sha2 0.9.9", ] [[package]] name = "light-bitcoin-merkle" version = "0.2.0" -source = "git+https://github.com/chainx-org/light-bitcoin?branch=taproot#b6587ef7feca71e6b6a6861c44d85983780b428f" +source = "git+https://github.com/chainx-org/light-bitcoin?branch=upgrade-2021#21fdfaea1ce4788ac96ea620c2026f9ae78b7cdd" dependencies = [ "light-bitcoin-chain", "light-bitcoin-primitives", @@ -3688,7 +3857,7 @@ dependencies = [ [[package]] name = "light-bitcoin-primitives" version = "0.2.0" -source = "git+https://github.com/chainx-org/light-bitcoin?branch=taproot#b6587ef7feca71e6b6a6861c44d85983780b428f" +source = "git+https://github.com/chainx-org/light-bitcoin?branch=upgrade-2021#21fdfaea1ce4788ac96ea620c2026f9ae78b7cdd" dependencies = [ "byteorder", "fixed-hash", @@ -3704,10 +3873,10 @@ dependencies = [ [[package]] name = "light-bitcoin-script" version = "0.2.0" -source = "git+https://github.com/chainx-org/light-bitcoin?branch=taproot#b6587ef7feca71e6b6a6861c44d85983780b428f" +source = "git+https://github.com/chainx-org/light-bitcoin?branch=upgrade-2021#21fdfaea1ce4788ac96ea620c2026f9ae78b7cdd" dependencies = [ "hex", - "libsecp256k1 0.7.0 (git+https://github.com/chainx-org/libsecp256k1.git)", + "libsecp256k1 0.7.0 (git+https://github.com/chainx-org/libsecp256k1?branch=upgrade-2021)", "light-bitcoin-chain", "light-bitcoin-crypto", "light-bitcoin-keys", @@ -3715,13 +3884,13 @@ dependencies = [ "light-bitcoin-serialization", "parity-scale-codec", "scale-info", - "sha2 0.9.8", + "sha2 0.9.9", ] [[package]] name = "light-bitcoin-serialization" version = "0.2.0" -source = "git+https://github.com/chainx-org/light-bitcoin?branch=taproot#b6587ef7feca71e6b6a6861c44d85983780b428f" +source = "git+https://github.com/chainx-org/light-bitcoin?branch=upgrade-2021#21fdfaea1ce4788ac96ea620c2026f9ae78b7cdd" dependencies = [ "light-bitcoin-primitives", "light-bitcoin-serialization-derive", @@ -3732,7 +3901,7 @@ dependencies = [ [[package]] name = "light-bitcoin-serialization-derive" version = "0.2.0" -source = "git+https://github.com/chainx-org/light-bitcoin?branch=taproot#b6587ef7feca71e6b6a6861c44d85983780b428f" +source = "git+https://github.com/chainx-org/light-bitcoin?branch=upgrade-2021#21fdfaea1ce4788ac96ea620c2026f9ae78b7cdd" dependencies = [ "proc-macro2", "quote", @@ -3765,28 +3934,26 @@ dependencies = [ ] [[package]] -name = "lock_api" -version = "0.3.4" +name = "linux-raw-sys" +version = "0.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" -dependencies = [ - "scopeguard", -] +checksum = "a261afc61b7a5e323933b402ca6a1765183687c614789b1e4db7762ed4230bca" [[package]] name = "lock_api" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" +checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" dependencies = [ + "autocfg", "scopeguard", ] [[package]] name = "log" -version = "0.4.14" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" dependencies = [ "cfg-if 1.0.0", "value-bag", @@ -3794,11 +3961,20 @@ dependencies = [ [[package]] name = "lru" -version = "0.6.6" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ea2d928b485416e8908cff2d97d621db22b27f7b3b6729e438bcf42c671ba91" +dependencies = [ + "hashbrown 0.11.2", +] + +[[package]] +name = "lru" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ea2d928b485416e8908cff2d97d621db22b27f7b3b6729e438bcf42c671ba91" +checksum = "32613e41de4c47ab04970c348ca7ae7382cf116625755af070b008a15516a889" dependencies = [ - "hashbrown", + "hashbrown 0.11.2", ] [[package]] @@ -3812,9 +3988,9 @@ dependencies = [ [[package]] name = "lz4" -version = "1.23.2" +version = "1.23.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aac20ed6991e01bf6a2e68cc73df2b389707403662a8ba89f68511fb340f724c" +checksum = "4edcb94251b1c375c459e5abe9fb0168c1c826c3370172684844f8f3f8d1a885" dependencies = [ "libc", "lz4-sys", @@ -3822,9 +3998,9 @@ dependencies = [ [[package]] name = "lz4-sys" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dca79aa95d8b3226213ad454d328369853be3a1382d89532a854f4d69640acae" +checksum = "d7be8908e2ed6f31c02db8a9fa962f03e36c53fbfde437363eae3306b85d7e17" dependencies = [ "cc", "libc", @@ -3890,6 +4066,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memmap2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057a3db23999c867821a7a59feb06a578fcb03685e983dff90daf9e7d24ac08f" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.6.5" @@ -3901,12 +4086,12 @@ dependencies = [ [[package]] name = "memory-db" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de006e09d04fc301a5f7e817b75aa49801c4479a8af753764416b085337ddcc5" +checksum = "6566c70c1016f525ced45d7b7f97730a2bafb037c788211d0c186ef5b2189f0a" dependencies = [ "hash-db", - "hashbrown", + "hashbrown 0.12.0", "parity-util-mem", ] @@ -3928,26 +4113,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "minicbor" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51aa5bb0ca22415daca596a227b507f880ad1b2318a87fa9325312a5d285ca0d" -dependencies = [ - "minicbor-derive", -] - -[[package]] -name = "minicbor-derive" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54999f917cd092b13904737e26631aa2b2b88d625db68e4bab461dcd8006c788" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "minimal-lexical" version = "0.2.1" @@ -3956,12 +4121,11 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.4.4" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082" dependencies = [ "adler", - "autocfg", ] [[package]] @@ -3985,14 +4149,15 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.14" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" +checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" dependencies = [ "libc", "log", "miow 0.3.7", "ntapi", + "wasi 0.11.0+wasi-snapshot-preview1", "winapi 0.3.9", ] @@ -4074,9 +4239,9 @@ dependencies = [ "blake2s_simd", "blake3", "digest 0.9.0", - "generic-array 0.14.4", + "generic-array 0.14.5", "multihash-derive", - "sha2 0.9.8", + "sha2 0.9.9", "sha3 0.9.1", "unsigned-varint 0.5.1", ] @@ -4088,9 +4253,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "752a61cd890ff691b4411423d23816d5866dd5621e4d1c5687a53b94b5a979d8" dependencies = [ "digest 0.9.0", - "generic-array 0.14.4", + "generic-array 0.14.5", "multihash-derive", - "sha2 0.9.8", + "sha2 0.9.9", "unsigned-varint 0.7.1", ] @@ -4100,7 +4265,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "424f6e86263cd5294cbd7f1e95746b95aca0e0d66bff31e5a40d6baa87b4aa99" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.3", "proc-macro-error", "proc-macro2", "quote", @@ -4121,9 +4286,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56a336acba8bc87c8876f6425407dbbe6c417bf478b22015f8fb0994ef3bc0ab" dependencies = [ "bytes 1.1.0", - "futures 0.3.18", + "futures 0.3.21", "log", - "pin-project 1.0.8", + "pin-project 1.0.10", "smallvec", "unsigned-varint 0.7.1", ] @@ -4131,20 +4296,20 @@ dependencies = [ [[package]] name = "musig2" version = "0.1.0" -source = "git+https://github.com/chainx-org/Musig2?branch=lib#1b665dfb33e3fe28fc9dd4b9f3a9969825992300" +source = "git+https://github.com/chainx-org/Musig2?branch=upgrade-2021#27f06152c31da210f0c27f06c43dc5bc655e4d93" dependencies = [ "arrayref", "digest 0.9.0", "hex", "lazy_static", - "libsecp256k1 0.7.0 (git+https://github.com/chainx-org/libsecp256k1?branch=master)", + "libsecp256k1 0.7.0 (git+https://github.com/chainx-org/libsecp256k1?branch=upgrade-2021)", "log", "parity-scale-codec", - "rand 0.8.4", + "rand 0.8.5", "rand_core 0.6.3", "scale-info", "serde", - "sha2 0.9.8", + "sha2 0.9.9", ] [[package]] @@ -4159,7 +4324,7 @@ dependencies = [ "num-complex", "num-rational 0.4.0", "num-traits", - "rand 0.8.4", + "rand 0.8.5", "rand_distr", "simba", "typenum", @@ -4182,7 +4347,7 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a8690bf09abf659851e58cd666c3d37ac6af07c2bd7a9e332cfba471715775" dependencies = [ - "rand 0.8.4", + "rand 0.8.5", ] [[package]] @@ -4210,20 +4375,19 @@ checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" [[package]] name = "nom" -version = "7.1.0" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d11e1ef389c76fe5b81bcaf2ea32cf88b62bc494e19f493d0b30e7a930109" +checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" dependencies = [ "memchr", "minimal-lexical", - "version_check", ] [[package]] name = "ntapi" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" +checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" dependencies = [ "winapi 0.3.9", ] @@ -4273,6 +4437,16 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-format" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bafe4179722c2894288ee77a9f044f02811c86af699344c498b0840c698a2465" +dependencies = [ + "arrayvec 0.4.12", + "itoa 0.4.8", +] + [[package]] name = "num-integer" version = "0.1.44" @@ -4285,9 +4459,9 @@ dependencies = [ [[package]] name = "num-iter" -version = "0.1.42" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" dependencies = [ "autocfg", "num-integer", @@ -4330,9 +4504,9 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ "hermit-abi", "libc", @@ -4340,20 +4514,20 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.5.4" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9bd055fb730c4f8f4f57d45d35cd6b3f0980535b056dc7ff119cee6a66ed6f" +checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" dependencies = [ - "derivative", "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.5.4" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486ea01961c4a818096de679a8b740b26d9033146ac5291b1c98557658f8cdd9" +checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" dependencies = [ + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn", @@ -4361,9 +4535,9 @@ dependencies = [ [[package]] name = "object" -version = "0.26.2" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39f37e50073ccad23b6d09bcb5b263f4e76d3bb6038e4a3c08e52162ffa8abc2" +checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" dependencies = [ "crc32fast", "indexmap", @@ -4372,18 +4546,18 @@ dependencies = [ [[package]] name = "object" -version = "0.27.1" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" +checksum = "40bec70ba014595f99f7aa110b84331ffe1ee9aece7fe6f387cc7e3ecda4d456" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" [[package]] name = "opaque-debug" @@ -4398,25 +4572,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] -name = "openssl-probe" -version = "0.1.4" +name = "open-metrics-client" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" +checksum = "7337d80c23c2d8b1349563981bc4fb531220733743ba8115454a67b181173f0d" +dependencies = [ + "dtoa", + "itoa 0.4.8", + "open-metrics-client-derive-text-encode", + "owning_ref", +] [[package]] -name = "orml-utilities" -version = "0.4.1-dev" -source = "git+https://github.com/chainx-org/ormls?branch=main#1696ab37189b249082d7d84c8c6c59df74d7c053" +name = "open-metrics-client-derive-text-encode" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a15c83b586f00268c619c1cb3340ec1a6f59dd9ba1d9833a273a68e6d5cd8ffc" dependencies = [ - "frame-support", - "parity-scale-codec", - "scale-info", - "serde", - "sp-io", - "sp-runtime", - "sp-std", + "proc-macro2", + "quote", + "syn", ] +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "os_str_bytes" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" + [[package]] name = "owning_ref" version = "0.4.1" @@ -4444,13 +4633,12 @@ dependencies = [ [[package]] name = "pallet-assets-bridge" -version = "1.1.0" +version = "1.3.0" dependencies = [ "ethabi", "frame-support", "frame-system", "hex-literal", - "libsecp256k1 0.6.0", "pallet-assets", "pallet-balances", "pallet-evm", @@ -4467,7 +4655,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-support", "frame-system", @@ -4483,7 +4671,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-support", "frame-system", @@ -4498,7 +4686,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-benchmarking", "frame-support", @@ -4510,10 +4698,25 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-base-fee" +version = "1.0.0" +source = "git+https://github.com/chainx-org/frontier?branch=polkadot-v0.9.18#4e91f788ba02a0add42f09cae21bf96e3d346330" +dependencies = [ + "frame-support", + "frame-system", + "pallet-evm", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-runtime", +] + [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-support", "frame-system", @@ -4530,7 +4733,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-benchmarking", "frame-support", @@ -4547,7 +4750,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-benchmarking", "frame-support", @@ -4563,7 +4766,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-support", "frame-system", @@ -4580,7 +4783,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/chainx-org/frontier?branch=new-polkadot-v0.9.11#9561763b3e254574766023f67aac555c8ceae814" +source = "git+https://github.com/chainx-org/frontier?branch=polkadot-v0.9.18#4e91f788ba02a0add42f09cae21bf96e3d346330" dependencies = [ "ethereum", "ethereum-types", @@ -4598,10 +4801,9 @@ dependencies = [ "pallet-timestamp", "parity-scale-codec", "rlp", - "rustc-hex", "scale-info", "serde", - "sha3 0.8.2", + "sha3 0.10.1", "sp-io", "sp-runtime", "sp-std", @@ -4609,7 +4811,7 @@ dependencies = [ [[package]] name = "pallet-ethereum-chain-id" -version = "1.1.0" +version = "1.3.0" dependencies = [ "frame-support", "frame-system", @@ -4621,11 +4823,9 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/chainx-org/frontier?branch=new-polkadot-v0.9.11#9561763b3e254574766023f67aac555c8ceae814" +source = "git+https://github.com/chainx-org/frontier?branch=polkadot-v0.9.18#4e91f788ba02a0add42f09cae21bf96e3d346330" dependencies = [ "evm", - "evm-gasometer", - "evm-runtime", "fp-evm", "frame-benchmarking", "frame-support", @@ -4649,74 +4849,63 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-blake2" version = "2.0.0-dev" -source = "git+https://github.com/chainx-org/frontier?branch=new-polkadot-v0.9.11#9561763b3e254574766023f67aac555c8ceae814" +source = "git+https://github.com/chainx-org/frontier?branch=polkadot-v0.9.18#4e91f788ba02a0add42f09cae21bf96e3d346330" dependencies = [ "fp-evm", - "sp-core", - "sp-io", ] [[package]] name = "pallet-evm-precompile-bn128" version = "2.0.0-dev" -source = "git+https://github.com/chainx-org/frontier?branch=new-polkadot-v0.9.11#9561763b3e254574766023f67aac555c8ceae814" +source = "git+https://github.com/chainx-org/frontier?branch=polkadot-v0.9.18#4e91f788ba02a0add42f09cae21bf96e3d346330" dependencies = [ "fp-evm", "sp-core", - "sp-io", "substrate-bn", ] [[package]] name = "pallet-evm-precompile-dispatch" version = "2.0.0-dev" -source = "git+https://github.com/chainx-org/frontier?branch=new-polkadot-v0.9.11#9561763b3e254574766023f67aac555c8ceae814" +source = "git+https://github.com/chainx-org/frontier?branch=polkadot-v0.9.18#4e91f788ba02a0add42f09cae21bf96e3d346330" dependencies = [ "fp-evm", "frame-support", "pallet-evm", - "parity-scale-codec", - "sp-core", - "sp-io", ] [[package]] name = "pallet-evm-precompile-modexp" version = "2.0.0-dev" -source = "git+https://github.com/chainx-org/frontier?branch=new-polkadot-v0.9.11#9561763b3e254574766023f67aac555c8ceae814" +source = "git+https://github.com/chainx-org/frontier?branch=polkadot-v0.9.18#4e91f788ba02a0add42f09cae21bf96e3d346330" dependencies = [ "fp-evm", "num", - "sp-core", - "sp-io", ] [[package]] name = "pallet-evm-precompile-sha3fips" version = "2.0.0-dev" -source = "git+https://github.com/chainx-org/frontier?branch=new-polkadot-v0.9.11#9561763b3e254574766023f67aac555c8ceae814" +source = "git+https://github.com/chainx-org/frontier?branch=polkadot-v0.9.18#4e91f788ba02a0add42f09cae21bf96e3d346330" dependencies = [ "fp-evm", - "sp-core", - "sp-io", "tiny-keccak", ] [[package]] name = "pallet-evm-precompile-simple" version = "2.0.0-dev" -source = "git+https://github.com/chainx-org/frontier?branch=new-polkadot-v0.9.11#9561763b3e254574766023f67aac555c8ceae814" +source = "git+https://github.com/chainx-org/frontier?branch=polkadot-v0.9.18#4e91f788ba02a0add42f09cae21bf96e3d346330" dependencies = [ "fp-evm", - "ripemd160", - "sp-core", + "ripemd", "sp-io", ] [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-benchmarking", "frame-support", @@ -4739,7 +4928,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "enumflags2", "frame-benchmarking", @@ -4755,7 +4944,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-benchmarking", "frame-support", @@ -4772,7 +4961,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-support", "frame-system", @@ -4786,7 +4975,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-benchmarking", "frame-support", @@ -4802,7 +4991,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-support", "frame-system", @@ -4823,7 +5012,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-support", "frame-system", @@ -4837,7 +5026,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-benchmarking", "frame-support", @@ -4855,7 +5044,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-support", "frame-system", @@ -4873,7 +5062,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-support", "frame-system", @@ -4890,7 +5079,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -4907,7 +5096,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.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -4918,7 +5107,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-support", "frame-system", @@ -4934,7 +5123,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-support", "frame-system", @@ -4949,7 +5138,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-support", "frame-system", @@ -4962,9 +5151,9 @@ dependencies = [ [[package]] name = "parity-db" -version = "0.3.2" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91b679c6acc14fac74382942e2b73bea441686a33430b951ea03b5aeb6a7f254" +checksum = "b3e7f385d61562f5834282b90aa50b41f38a35cf64d5209b8b05487b50553dbe" dependencies = [ "blake2-rfc", "crc32fast", @@ -4973,17 +5162,17 @@ dependencies = [ "libc", "log", "lz4", - "memmap2", + "memmap2 0.2.3", "parking_lot 0.11.2", - "rand 0.8.4", + "rand 0.8.5", "snap", ] [[package]] name = "parity-scale-codec" -version = "2.3.1" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" +checksum = "e8b44461635bbb1a0300f100a841e571e7d919c81c73075ef5d152ffdb521066" dependencies = [ "arrayvec 0.7.2", "bitvec", @@ -4995,11 +5184,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "2.3.1" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" +checksum = "c45ed1f39709f5a89338fab50e59816b2e8815f5bb58276e7ddf9afd495f73f8" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn", @@ -5017,7 +5206,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9981e32fb75e004cc148f5fb70342f393830e0a4aa62e3cc93b50976218d42b6" dependencies = [ - "futures 0.3.18", + "futures 0.3.21", "libc", "log", "rand 0.7.3", @@ -5027,17 +5216,17 @@ dependencies = [ [[package]] name = "parity-util-mem" -version = "0.10.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f4cb4e169446179cbc6b8b6320cc9fca49bd2e94e8db25f25f200a8ea774770" +checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" dependencies = [ "cfg-if 1.0.0", "ethereum-types", - "hashbrown", + "hashbrown 0.12.0", "impl-trait-for-tuples", - "lru", + "lru 0.7.5", "parity-util-mem-derive", - "parking_lot 0.11.2", + "parking_lot 0.12.0", "primitive-types", "smallvec", "winapi 0.3.9", @@ -5095,58 +5284,57 @@ checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" [[package]] name = "parking_lot" -version = "0.10.2" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ - "lock_api 0.3.4", - "parking_lot_core 0.7.2", + "instant", + "lock_api", + "parking_lot_core 0.8.5", ] [[package]] name = "parking_lot" -version = "0.11.2" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" dependencies = [ - "instant", - "lock_api 0.4.5", - "parking_lot_core 0.8.5", + "lock_api", + "parking_lot_core 0.9.2", ] [[package]] name = "parking_lot_core" -version = "0.7.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" dependencies = [ - "cfg-if 0.1.10", - "cloudabi", + "cfg-if 1.0.0", + "instant", "libc", - "redox_syscall 0.1.57", + "redox_syscall", "smallvec", "winapi 0.3.9", ] [[package]] name = "parking_lot_core" -version = "0.8.5" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +checksum = "995f667a6c822200b0433ac218e05582f0e2efa1b922a3fd2fbaadc5f87bab37" dependencies = [ "cfg-if 1.0.0", - "instant", "libc", - "redox_syscall 0.2.10", + "redox_syscall", "smallvec", - "winapi 0.3.9", + "windows-sys", ] [[package]] name = "paste" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0744126afe1a6dd7f394cb50a716dbe086cb06e255e53d8d0185d82828358fb5" +checksum = "0c520e05135d6e763148b6426a837e239041653ba7becd2e538c076c738025fc" [[package]] name = "pbkdf2" @@ -5229,9 +5417,9 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" +checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" dependencies = [ "fixedbitset", "indexmap", @@ -5239,27 +5427,27 @@ dependencies = [ [[package]] name = "pin-project" -version = "0.4.28" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "918192b5c59119d51e0cd221f4d49dde9112824ba717369e903c97d076083d0f" +checksum = "9615c18d31137579e9ff063499264ddc1278e7b1982757ebc111028c4d1dc909" dependencies = [ - "pin-project-internal 0.4.28", + "pin-project-internal 0.4.29", ] [[package]] name = "pin-project" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576bc800220cc65dac09e99e97b08b358cfab6e17078de8dc5fee223bd2d0c08" +checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" dependencies = [ - "pin-project-internal 1.0.8", + "pin-project-internal 1.0.10", ] [[package]] name = "pin-project-internal" -version = "0.4.28" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be26700300be6d9d23264c73211d8190e755b6b5ca7a1b28230025511b52a5e" +checksum = "044964427019eed9d49d9d5bbce6047ef18f37100ea400912a9fa4a3523ab12a" dependencies = [ "proc-macro2", "quote", @@ -5268,9 +5456,9 @@ dependencies = [ [[package]] name = "pin-project-internal" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389" +checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" dependencies = [ "proc-macro2", "quote", @@ -5285,9 +5473,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.7" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" [[package]] name = "pin-utils" @@ -5297,15 +5485,15 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.23" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1a3ea4f0dd7f1f3e512cf97bf100819aa547f36a6eccac8dbaae839eb92363e" +checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" [[package]] name = "platforms" -version = "1.1.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989d43012e2ca1c4a02507c67282691a0a3207f9dc67cec596b43fe925b3d325" +checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" [[package]] name = "polling" @@ -5326,7 +5514,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" dependencies = [ - "cpufeatures 0.2.1", + "cpufeatures 0.2.2", "opaque-debug 0.3.0", "universal-hash", ] @@ -5338,22 +5526,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" dependencies = [ "cfg-if 1.0.0", - "cpufeatures 0.2.1", + "cpufeatures 0.2.2", "opaque-debug 0.3.0", "universal-hash", ] [[package]] name = "ppv-lite86" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "primitive-types" -version = "0.10.1" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e4722c697a58a99d5d06a08c30821d7c082a4632198de1eaa5a6c22ef42373" +checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" dependencies = [ "fixed-hash", "impl-codec", @@ -5374,9 +5562,9 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.1.0" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" +checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" dependencies = [ "thiserror", "toml", @@ -5408,32 +5596,32 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.33" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb37d2df5df740e582f28f8560cf425f52bb267d872fe58358eadb554909f07a" +checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1" dependencies = [ "unicode-xid", ] [[package]] name = "prometheus" -version = "0.11.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8425533e7122f0c3cc7a37e6244b16ad3a2cc32ae7ac6276e2a75da0d9c200d" +checksum = "b7f64969ffd5dd8f39bd57a68ac53c163a095ed9d0fb707146da1b27025a3504" dependencies = [ "cfg-if 1.0.0", "fnv", "lazy_static", + "memchr", "parking_lot 0.11.2", - "regex", "thiserror", ] [[package]] name = "prost" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de5e2533f59d08fcf364fd374ebda0692a70bd6d7e66ef97f306f45c6c5d8020" +checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" dependencies = [ "bytes 1.1.0", "prost-derive", @@ -5441,27 +5629,29 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355f634b43cdd80724ee7848f95770e7e70eefa6dcf14fea676216573b8fd603" +checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" dependencies = [ "bytes 1.1.0", - "heck", + "heck 0.3.3", "itertools", + "lazy_static", "log", "multimap", "petgraph", "prost", "prost-types", + "regex", "tempfile", "which", ] [[package]] name = "prost-derive" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "600d2f334aa05acb02a755e217ef1ab6dea4d51b58b7846588b747edec04efba" +checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" dependencies = [ "anyhow", "itertools", @@ -5472,9 +5662,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "603bbd6394701d13f3f25aada59c7de9d35a6a5887cfc156181234a44002771b" +checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" dependencies = [ "bytes 1.1.0", "prost", @@ -5482,24 +5672,13 @@ dependencies = [ [[package]] name = "psm" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd136ff4382c4753fc061cb9e4712ab2af263376b95bbd5bd8cd50c020b78e69" +checksum = "871372391786ccec00d3c5d3d6608905b3d4db263639cfe075d3b60a736d115a" dependencies = [ "cc", ] -[[package]] -name = "pwasm-utils" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "880b3384fb00b8f6ecccd5d358b93bd2201900ae3daad213791d1864f6441f5c" -dependencies = [ - "byteorder", - "log", - "parity-wasm 0.42.2", -] - [[package]] name = "quick-error" version = "1.2.3" @@ -5525,18 +5704,18 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.10" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" +checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" dependencies = [ "proc-macro2", ] [[package]] name = "radium" -version = "0.6.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" [[package]] name = "rand" @@ -5548,20 +5727,19 @@ dependencies = [ "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", - "rand_hc 0.2.0", + "rand_hc", "rand_pcg", ] [[package]] name = "rand" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha 0.3.1", "rand_core 0.6.3", - "rand_hc 0.3.1", ] [[package]] @@ -5599,17 +5777,17 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom 0.2.3", + "getrandom 0.2.6", ] [[package]] name = "rand_distr" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "964d548f8e7d12e102ef183a0de7e98180c9f8729f555897a857b96e48122d2f" +checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" dependencies = [ "num-traits", - "rand 0.8.4", + "rand 0.8.5", ] [[package]] @@ -5621,15 +5799,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rand_hc" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" -dependencies = [ - "rand_core 0.6.3", -] - [[package]] name = "rand_pcg" version = "0.2.1" @@ -5647,9 +5816,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "fd249e82c21598a9a426a4e00dd7adc1d640b22445ec8545feef801d1a74c221" dependencies = [ "autocfg", "crossbeam-deque", @@ -5659,56 +5828,50 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.9.1" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "9f51245e1e62e1f1629cbfec37b5793bbabcaeb90f30e94d2ba03564687353e4" dependencies = [ "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "lazy_static", "num_cpus", ] [[package]] name = "redox_syscall" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" - -[[package]] -name = "redox_syscall" -version = "0.2.10" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" dependencies = [ "bitflags", ] [[package]] name = "redox_users" -version = "0.4.0" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.3", - "redox_syscall 0.2.10", + "getrandom 0.2.6", + "redox_syscall", + "thiserror", ] [[package]] name = "ref-cast" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300f2a835d808734ee295d45007adacb9ebb29dd3ae2424acfa17930cae541da" +checksum = "685d58625b6c2b83e4cc88a27c4bf65adb7b6b16dbdc413e515c9405b47432ab" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c38e3aecd2b21cb3959637b883bb3714bc7e43f0268b9a29d3743ee3e55cdd2" +checksum = "a043824e29c94169374ac5183ac0ed43f5724dc4556b19568007486bd840fa1f" dependencies = [ "proc-macro2", "quote", @@ -5717,21 +5880,20 @@ dependencies = [ [[package]] name = "regalloc" -version = "0.0.31" +version = "0.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "571f7f397d61c4755285cd37853fe8e03271c243424a907415909379659381c5" +checksum = "7d808cff91dfca7b239d40b972ba628add94892b1d9e19a842aedc5cfae8ab1a" dependencies = [ "log", "rustc-hash", - "serde", "smallvec", ] [[package]] name = "regex" -version = "1.5.4" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" dependencies = [ "aho-corasick", "memchr", @@ -5765,6 +5927,23 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "remote-externalities" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" +dependencies = [ + "env_logger", + "jsonrpsee 0.8.0", + "log", + "parity-scale-codec", + "serde", + "serde_json", + "sp-core", + "sp-io", + "sp-runtime", + "sp-version", +] + [[package]] name = "remove_dir_all" version = "0.5.3" @@ -5786,9 +5965,9 @@ dependencies = [ [[package]] name = "retain_mut" -version = "0.1.5" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11000e6ba5020e53e7cc26f73b91ae7d5496b4977851479edb66b694c0675c21" +checksum = "8c31b5c4033f8fdde8700e4657be2c497e7288f01515be52168c631e2e4d4086" [[package]] name = "ring" @@ -5805,6 +5984,15 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "ripemd" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1facec54cb5e0dc08553501fa740091086d0259ad0067e0d4103448e4cb22ed3" +dependencies = [ + "digest 0.10.3", +] + [[package]] name = "ripemd160" version = "0.9.1" @@ -5839,9 +6027,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a62eca5cacf2c8261128631bed9f045598d40bfbe4b29f5163f0f802f8f44a7" +checksum = "620f4129485ff1a7128d184bc687470c21c7951b64779ebc9cfdad3dcd920290" dependencies = [ "libc", "librocksdb-sys", @@ -5890,7 +6078,21 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.4", + "semver 1.0.7", +] + +[[package]] +name = "rustix" +version = "0.31.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2dcfc2778a90e38f56a708bfc90572422e11d6c7ee233d053d1f782cf9df6d2" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "winapi 0.3.9", ] [[package]] @@ -5899,47 +6101,86 @@ version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" dependencies = [ - "base64 0.13.0", + "base64", + "log", + "ring", + "sct 0.6.1", + "webpki 0.21.4", +] + +[[package]] +name = "rustls" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fbfeb8d0ddb84706bc597a5574ab8912817c52a397f819e5b614e2265206921" +dependencies = [ "log", "ring", - "sct", - "webpki", + "sct 0.7.0", + "webpki 0.22.0", ] [[package]] name = "rustls-native-certs" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092" +checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092" +dependencies = [ + "openssl-probe", + "rustls 0.19.1", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" dependencies = [ "openssl-probe", - "rustls", + "rustls-pemfile", "schannel", "security-framework", ] +[[package]] +name = "rustls-pemfile" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7522c9de787ff061458fe9a829dc790a3f5b22dc571694fc5883f448b94d9a9" +dependencies = [ + "base64", +] + +[[package]] +name = "rustversion" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" + [[package]] name = "rw-stream-sink" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" dependencies = [ - "futures 0.3.18", - "pin-project 0.4.28", + "futures 0.3.21", + "pin-project 0.4.29", "static_assertions", ] [[package]] name = "ryu" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c9613b5a66ab9ba26415184cfc41156594925a9cf3a2057e57f31ff145f6568" +checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" [[package]] name = "salsa20" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecbd2eb639fd7cab5804a0837fe373cc2172d15437e804c054a9fb885cb923b0" +checksum = "0c0fbb5f676da676c260ba276a8f43a8dc67cf02d1438423aeb1c677a7212686" dependencies = [ "cipher", ] @@ -5955,8 +6196,8 @@ dependencies = [ [[package]] name = "sc-allocator" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "4.1.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "log", "sp-core", @@ -5967,10 +6208,10 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ - "futures 0.3.18", - "futures-timer 3.0.2", + "futures 0.3.21", + "futures-timer", "log", "parity-scale-codec", "sc-block-builder", @@ -5990,7 +6231,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -6006,9 +6247,10 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "impl-trait-for-tuples", + "memmap2 0.5.3", "parity-scale-codec", "sc-chain-spec-derive", "sc-network", @@ -6022,9 +6264,9 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn", @@ -6033,11 +6275,12 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "chrono", + "clap", "fdlimit", - "futures 0.3.18", + "futures 0.3.21", "hex", "libp2p", "log", @@ -6062,7 +6305,6 @@ dependencies = [ "sp-panic-handler", "sp-runtime", "sp-version", - "structopt", "thiserror", "tiny-bip39", "tokio", @@ -6071,14 +6313,14 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "fnv", - "futures 0.3.18", + "futures 0.3.21", "hash-db", "log", "parity-scale-codec", - "parking_lot 0.11.2", + "parking_lot 0.12.0", "sc-executor", "sc-transaction-pool-api", "sc-utils", @@ -6099,7 +6341,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "hash-db", "kvdb", @@ -6109,7 +6351,7 @@ dependencies = [ "log", "parity-db", "parity-scale-codec", - "parking_lot 0.11.2", + "parking_lot 0.12.0", "sc-client-api", "sc-state-db", "sp-arithmetic", @@ -6124,14 +6366,14 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "async-trait", - "futures 0.3.18", - "futures-timer 3.0.2", + "futures 0.3.21", + "futures-timer", "libp2p", "log", - "parking_lot 0.11.2", + "parking_lot 0.12.0", "sc-client-api", "sc-utils", "serde", @@ -6148,11 +6390,10 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "async-trait", - "derive_more", - "futures 0.3.18", + "futures 0.3.21", "log", "parity-scale-codec", "sc-block-builder", @@ -6172,24 +6413,24 @@ dependencies = [ "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", + "thiserror", ] [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "async-trait", - "derive_more", "fork-tree", - "futures 0.3.18", + "futures 0.3.21", "log", "merlin", "num-bigint 0.2.6", "num-rational 0.2.4", "num-traits", "parity-scale-codec", - "parking_lot 0.11.2", + "parking_lot 0.12.0", "rand 0.7.3", "retain_mut", "sc-client-api", @@ -6215,12 +6456,13 @@ dependencies = [ "sp-runtime", "sp-version", "substrate-prometheus-endpoint", + "thiserror", ] [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "fork-tree", "parity-scale-codec", @@ -6233,17 +6475,16 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "async-trait", - "futures 0.3.18", - "futures-timer 3.0.2", + "futures 0.3.21", + "futures-timer", "log", "parity-scale-codec", "sc-client-api", "sc-consensus", "sc-telemetry", - "sp-api", "sp-arithmetic", "sp-blockchain", "sp-consensus", @@ -6259,18 +6500,18 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "lazy_static", - "libsecp256k1 0.6.0", - "log", + "lru 0.6.6", "parity-scale-codec", - "parking_lot 0.11.2", + "parking_lot 0.12.0", "sc-executor-common", "sc-executor-wasmi", "sc-executor-wasmtime", "sp-api", "sp-core", + "sp-core-hashing-proc-macro", "sp-externalities", "sp-io", "sp-panic-handler", @@ -6279,31 +6520,31 @@ dependencies = [ "sp-trie", "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.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ - "derive_more", "environmental", "parity-scale-codec", - "pwasm-utils", "sc-allocator", "sp-core", "sp-maybe-compressed-blob", "sp-serializer", "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.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "log", "parity-scale-codec", @@ -6319,7 +6560,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "cfg-if 1.0.0", "libc", @@ -6337,20 +6578,22 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ + "ahash", "async-trait", - "derive_more", "dyn-clone", "finality-grandpa", "fork-tree", - "futures 0.3.18", - "futures-timer 3.0.2", + "futures 0.3.21", + "futures-timer", + "hex", "log", "parity-scale-codec", - "parking_lot 0.11.2", - "rand 0.8.4", + "parking_lot 0.12.0", + "rand 0.8.5", "sc-block-builder", + "sc-chain-spec", "sc-client-api", "sc-consensus", "sc-keystore", @@ -6369,16 +6612,17 @@ dependencies = [ "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.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "ansi_term", - "futures 0.3.18", - "futures-timer 3.0.2", + "futures 0.3.21", + "futures-timer", "log", "parity-util-mem", "sc-client-api", @@ -6391,63 +6635,43 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "async-trait", - "derive_more", "hex", - "parking_lot 0.11.2", + "parking_lot 0.12.0", "serde_json", "sp-application-crypto", "sp-core", "sp-keystore", -] - -[[package]] -name = "sc-light" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" -dependencies = [ - "hash-db", - "parity-scale-codec", - "parking_lot 0.11.2", - "sc-client-api", - "sc-executor", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-externalities", - "sp-runtime", - "sp-state-machine", + "thiserror", ] [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ - "async-std", "async-trait", "asynchronous-codec 0.5.0", "bitflags", "bytes 1.1.0", "cid", - "derive_more", "either", "fnv", "fork-tree", - "futures 0.3.18", - "futures-timer 3.0.2", + "futures 0.3.21", + "futures-timer", "hex", "ip_network", "libp2p", "linked-hash-map", "linked_hash_set", "log", - "lru", + "lru 0.7.5", "parity-scale-codec", - "parking_lot 0.11.2", - "pin-project 1.0.8", + "parking_lot 0.12.0", + "pin-project 1.0.10", "prost", "prost-build", "rand 0.7.3", @@ -6475,13 +6699,14 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ - "futures 0.3.18", - "futures-timer 3.0.2", + "ahash", + "futures 0.3.21", + "futures-timer", "libp2p", "log", - "lru", + "lru 0.7.5", "sc-network", "sp-runtime", "substrate-prometheus-endpoint", @@ -6491,19 +6716,19 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "bytes 1.1.0", "fnv", - "futures 0.3.18", - "futures-timer 3.0.2", + "futures 0.3.21", + "futures-timer", "hex", "hyper", "hyper-rustls", - "log", "num_cpus", + "once_cell", "parity-scale-codec", - "parking_lot 0.11.2", + "parking_lot 0.12.0", "rand 0.7.3", "sc-client-api", "sc-network", @@ -6513,14 +6738,15 @@ dependencies = [ "sp-offchain", "sp-runtime", "threadpool", + "tracing", ] [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ - "futures 0.3.18", + "futures 0.3.21", "libp2p", "log", "sc-utils", @@ -6530,8 +6756,8 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -6540,15 +6766,15 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ - "futures 0.3.18", + "futures 0.3.21", "hash-db", "jsonrpc-core", "jsonrpc-pubsub", "log", "parity-scale-codec", - "parking_lot 0.11.2", + "parking_lot 0.12.0", "sc-block-builder", "sc-chain-spec", "sc-client-api", @@ -6571,16 +6797,16 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ - "futures 0.3.18", + "futures 0.3.21", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", "jsonrpc-pubsub", "log", "parity-scale-codec", - "parking_lot 0.11.2", + "parking_lot 0.12.0", "sc-chain-spec", "sc-transaction-pool-api", "serde", @@ -6596,9 +6822,9 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ - "futures 0.3.18", + "futures 0.3.21", "jsonrpc-core", "jsonrpc-http-server", "jsonrpc-ipc-server", @@ -6613,21 +6839,21 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "async-trait", "directories", "exit-future", - "futures 0.3.18", - "futures-timer 3.0.2", + "futures 0.3.21", + "futures-timer", "hash-db", "jsonrpc-core", "jsonrpc-pubsub", "log", "parity-scale-codec", "parity-util-mem", - "parking_lot 0.11.2", - "pin-project 1.0.8", + "parking_lot 0.12.0", + "pin-project 1.0.10", "rand 0.7.3", "sc-block-builder", "sc-chain-spec", @@ -6637,7 +6863,6 @@ dependencies = [ "sc-executor", "sc-informant", "sc-keystore", - "sc-light", "sc-network", "sc-offchain", "sc-rpc", @@ -6678,13 +6903,13 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "log", "parity-scale-codec", "parity-util-mem", "parity-util-mem-derive", - "parking_lot 0.11.2", + "parking_lot 0.12.0", "sc-client-api", "sp-core", ] @@ -6692,7 +6917,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -6703,7 +6928,6 @@ dependencies = [ "sc-consensus-babe", "sc-consensus-epochs", "sc-finality-grandpa", - "sc-rpc-api", "serde", "serde_json", "sp-blockchain", @@ -6714,14 +6938,14 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "chrono", - "futures 0.3.18", + "futures 0.3.21", "libp2p", "log", - "parking_lot 0.11.2", - "pin-project 1.0.8", + "parking_lot 0.12.0", + "pin-project 1.0.10", "rand 0.7.3", "serde", "serde_json", @@ -6732,14 +6956,16 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "ansi_term", "atty", + "chrono", "lazy_static", + "libc", "log", "once_cell", - "parking_lot 0.11.2", + "parking_lot 0.12.0", "regex", "rustc-hash", "sc-client-api", @@ -6761,9 +6987,9 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn", @@ -6772,15 +6998,15 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ - "futures 0.3.18", - "intervalier", + "futures 0.3.21", + "futures-timer", "linked-hash-map", "log", "parity-scale-codec", "parity-util-mem", - "parking_lot 0.11.2", + "parking_lot 0.12.0", "retain_mut", "sc-client-api", "sc-transaction-pool-api", @@ -6799,10 +7025,9 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ - "derive_more", - "futures 0.3.18", + "futures 0.3.21", "log", "serde", "sp-blockchain", @@ -6813,19 +7038,21 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ - "futures 0.3.18", - "futures-timer 3.0.2", + "futures 0.3.21", + "futures-timer", "lazy_static", + "log", + "parking_lot 0.12.0", "prometheus", ] [[package]] name = "scale-info" -version = "1.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c55b744399c25532d63a0d2789b109df8d46fc93752d46b0782991a931a782f" +checksum = "8980cafbe98a7ee7a9cc16b32ebce542c77883f512d83fbf2ddc8f6a85ea74c9" dependencies = [ "bitvec", "cfg-if 1.0.0", @@ -6837,11 +7064,11 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "1.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baeb2780690380592f86205aa4ee49815feb2acad8c2f59e6dd207148c3f1fcd" +checksum = "4260c630e8a8a33429d1688eff2f163f24c65a4e1b1578ef6b565061336e4b6f" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn", @@ -6871,7 +7098,7 @@ dependencies = [ "rand 0.7.3", "rand_core 0.5.1", "sha2 0.8.2", - "subtle 2.4.1", + "subtle", "zeroize", ] @@ -6888,49 +7115,57 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] -name = "scroll" -version = "0.10.2" +name = "sct" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda28d4b4830b807a8b43f7b0e6b5df875311b3e7621d84577188c175b6ec1ec" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" dependencies = [ - "scroll_derive", + "ring", + "untrusted", ] [[package]] -name = "scroll_derive" -version = "0.10.5" +name = "sct" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaaae8f38bb311444cfb7f1979af0bc9240d95795f75f9ceddf6a59b79ceffa0" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "proc-macro2", - "quote", - "syn", + "ring", + "untrusted", ] [[package]] -name = "sct" -version = "0.6.1" +name = "secp256k1" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +checksum = "9c42e6f1735c5f00f51e43e28d6634141f2bcad10931b2609ddd74a86d751260" dependencies = [ - "ring", - "untrusted", + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957da2573cde917463ece3570eab4a0b3f19de6f1646cde62e6fd3868f566036" +dependencies = [ + "cc", ] [[package]] name = "secrecy" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0673d6a6449f5e7d12a1caf424fd9363e2af3a4953023ed455e3c4beef4597c0" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" dependencies = [ "zeroize", ] [[package]] name = "security-framework" -version = "2.4.2" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525bc1abfda2e1998d152c45cf13e696f76d0a4972310b22fac1658b05df7c87" +checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" dependencies = [ "bitflags", "core-foundation", @@ -6941,9 +7176,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.4.2" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9dd14d83160b528b7bfd66439110573efcfbe281b17fc2ca9f39f550d619c7e" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" dependencies = [ "core-foundation-sys", "libc", @@ -6965,14 +7200,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" dependencies = [ "semver-parser 0.10.2", - "serde", ] [[package]] name = "semver" -version = "1.0.4" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" +checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4" +dependencies = [ + "serde", +] [[package]] name = "semver-parser" @@ -6991,18 +7228,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.131" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ad69dfbd3e45369132cc64e6748c2d65cdfb001a2b1c232d128b4ad60561c1" +checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.131" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b710a83c4e0dff6a3d511946b95274ad9ca9e5d3ae497b63fda866ac955358d2" +checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2", "quote", @@ -7011,15 +7248,24 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.72" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ffa0837f2dfa6fb90868c2b5468cad482e175f7dad97e7421951e663f2b527" +checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" dependencies = [ - "itoa", + "itoa 1.0.1", "ryu", "serde", ] +[[package]] +name = "serde_nanos" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e44969a61f5d316be20a42ff97816efb3b407a924d06824c3d8a49fa8450de0e" +dependencies = [ + "serde", +] + [[package]] name = "sha-1" version = "0.8.2" @@ -7040,7 +7286,7 @@ checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ "block-buffer 0.9.0", "cfg-if 1.0.0", - "cpufeatures 0.2.1", + "cpufeatures 0.2.2", "digest 0.9.0", "opaque-debug 0.3.0", ] @@ -7059,17 +7305,28 @@ dependencies = [ [[package]] name = "sha2" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b69f9a4c9740d74c5baa3fd2e547f9525fa8088a8a958e0ca2409a514e33f5fa" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", "cfg-if 1.0.0", - "cpufeatures 0.2.1", + "cpufeatures 0.2.2", "digest 0.9.0", "opaque-debug 0.3.0", ] +[[package]] +name = "sha2" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures 0.2.2", + "digest 0.10.3", +] + [[package]] name = "sha3" version = "0.8.2" @@ -7095,6 +7352,16 @@ dependencies = [ "opaque-debug 0.3.0", ] +[[package]] +name = "sha3" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "881bf8156c87b6301fc5ca6b27f11eeb2761224c7081e69b409d5a1951a70c86" +dependencies = [ + "digest 0.10.3", + "keccak", +] + [[package]] name = "sharded-slab" version = "0.1.4" @@ -7106,8 +7373,9 @@ dependencies = [ [[package]] name = "sherpax" -version = "1.2.0" +version = "1.3.0" dependencies = [ + "clap", "fc-consensus", "fc-db", "fc-mapping-sync", @@ -7115,14 +7383,15 @@ dependencies = [ "fc-rpc-core", "fp-consensus", "fp-rpc", + "fp-storage", "frame-benchmarking", "frame-benchmarking-cli", - "futures 0.3.18", + "futures 0.3.21", "hex", "hex-literal", "jsonrpc-core", "jsonrpc-pubsub", - "pallet-ethereum", + "maplit", "pallet-transaction-payment-rpc", "sc-basic-authorship", "sc-chain-spec", @@ -7155,9 +7424,10 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-timestamp", - "structopt", "substrate-build-script-utils", "substrate-frame-rpc-system", + "substrate-prometheus-endpoint", + "try-runtime-cli", "xpallet-gateway-bitcoin-rpc", "xpallet-gateway-bitcoin-rpc-runtime-api", "xpallet-gateway-common-rpc", @@ -7182,7 +7452,7 @@ dependencies = [ [[package]] name = "sherpax-runtime" -version = "1.2.0" +version = "1.3.0" dependencies = [ "fp-evm", "fp-rpc", @@ -7193,12 +7463,14 @@ dependencies = [ "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", + "frame-try-runtime", "hex-literal", "pallet-assets", "pallet-assets-bridge", "pallet-aura", "pallet-authorship", "pallet-balances", + "pallet-base-fee", "pallet-bounties", "pallet-collective", "pallet-democracy", @@ -7262,16 +7534,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" -[[package]] -name = "signal-hook" -version = "0.3.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c35dfd12afb7828318348b8c408383cf5071a086c1d4ab1c0f9840ec92dbb922" -dependencies = [ - "libc", - "signal-hook-registry", -] - [[package]] name = "signal-hook-registry" version = "1.4.0" @@ -7283,9 +7545,9 @@ dependencies = [ [[package]] name = "signature" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" +checksum = "f054c6c1a6e95179d6f23ed974060dcefb2d9388bb7256900badad682c499de4" [[package]] name = "simba" @@ -7301,30 +7563,21 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.3.7" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "533494a8f9b724d33625ab53c6c4800f7cc445895924a8ef649222dcb76e938b" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" [[package]] name = "slab" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" - -[[package]] -name = "slog" -version = "2.7.0" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06" -dependencies = [ - "erased-serde", -] +checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" [[package]] name = "smallvec" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "snap" @@ -7339,14 +7592,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6142f7c25e94f6fd25a32c3348ec230df9109b463f59c8c7acc4bd34936babb7" dependencies = [ "aes-gcm", - "blake2", + "blake2 0.9.2", "chacha20poly1305", - "rand 0.8.4", + "rand 0.8.5", "rand_core 0.6.3", "ring", "rustc_version 0.3.3", - "sha2 0.9.8", - "subtle 2.4.1", + "sha2 0.9.9", + "subtle", "x25519-dalek", ] @@ -7363,9 +7616,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" dependencies = [ "libc", "winapi 0.3.9", @@ -7373,24 +7626,24 @@ dependencies = [ [[package]] name = "soketto" -version = "0.4.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5c71ed3d54db0a699f4948e1bb3e45b450fa31fe602621dee6680361d569c88" +checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" dependencies = [ - "base64 0.12.3", - "bytes 0.5.6", + "base64", + "bytes 1.1.0", "flate2", - "futures 0.3.18", + "futures 0.3.21", "httparse", "log", - "rand 0.7.3", + "rand 0.8.5", "sha-1 0.9.8", ] [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "hash-db", "log", @@ -7407,10 +7660,10 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ - "blake2-rfc", - "proc-macro-crate 1.1.0", + "blake2 0.10.4", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn", @@ -7418,8 +7671,8 @@ dependencies = [ [[package]] name = "sp-application-crypto" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "parity-scale-codec", "scale-info", @@ -7431,8 +7684,8 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "integer-sqrt", "num-traits", @@ -7447,7 +7700,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "async-trait", "parity-scale-codec", @@ -7459,7 +7712,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "parity-scale-codec", "sp-api", @@ -7471,13 +7724,13 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ - "futures 0.3.18", + "futures 0.3.21", "log", - "lru", + "lru 0.7.5", "parity-scale-codec", - "parking_lot 0.11.2", + "parking_lot 0.12.0", "sp-api", "sp-consensus", "sp-database", @@ -7489,11 +7742,11 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "async-trait", - "futures 0.3.18", - "futures-timer 3.0.2", + "futures 0.3.21", + "futures-timer", "log", "parity-scale-codec", "sp-core", @@ -7508,7 +7761,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "async-trait", "parity-scale-codec", @@ -7526,7 +7779,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "async-trait", "merlin", @@ -7549,18 +7802,21 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "parity-scale-codec", "scale-info", + "serde", "sp-arithmetic", "sp-runtime", + "sp-std", + "sp-timestamp", ] [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -7571,62 +7827,88 @@ dependencies = [ [[package]] name = "sp-core" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "base58", + "bitflags", "blake2-rfc", "byteorder", "dyn-clonable", "ed25519-dalek", - "futures 0.3.18", + "futures 0.3.21", "hash-db", "hash256-std-hasher", "hex", "impl-serde", "lazy_static", - "libsecp256k1 0.6.0", + "libsecp256k1 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "log", "merlin", "num-traits", "parity-scale-codec", "parity-util-mem", - "parking_lot 0.11.2", + "parking_lot 0.12.0", "primitive-types", "rand 0.7.3", "regex", "scale-info", "schnorrkel", + "secp256k1", "secrecy", "serde", - "sha2 0.9.8", + "sp-core-hashing", "sp-debug-derive", "sp-externalities", "sp-runtime-interface", "sp-std", "sp-storage", + "ss58-registry", "substrate-bip39", "thiserror", "tiny-bip39", - "tiny-keccak", - "twox-hash", "wasmi", "zeroize", ] +[[package]] +name = "sp-core-hashing" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" +dependencies = [ + "blake2 0.10.4", + "byteorder", + "digest 0.10.3", + "sha2 0.10.2", + "sha3 0.10.1", + "sp-std", + "twox-hash", +] + +[[package]] +name = "sp-core-hashing-proc-macro" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" +dependencies = [ + "proc-macro2", + "quote", + "sp-core-hashing", + "syn", +] + [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "kvdb", - "parking_lot 0.11.2", + "parking_lot 0.12.0", ] [[package]] name = "sp-debug-derive" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "proc-macro2", "quote", @@ -7635,8 +7917,8 @@ dependencies = [ [[package]] name = "sp-externalities" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "0.12.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "environmental", "parity-scale-codec", @@ -7647,7 +7929,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "finality-grandpa", "log", @@ -7665,7 +7947,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -7678,15 +7960,16 @@ dependencies = [ [[package]] name = "sp-io" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ - "futures 0.3.18", + "futures 0.3.21", "hash-db", - "libsecp256k1 0.6.0", + "libsecp256k1 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "log", "parity-scale-codec", - "parking_lot 0.11.2", + "parking_lot 0.12.0", + "secp256k1", "sp-core", "sp-externalities", "sp-keystore", @@ -7702,8 +7985,8 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "lazy_static", "sp-core", @@ -7713,33 +7996,34 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "0.12.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "async-trait", - "derive_more", - "futures 0.3.18", + "futures 0.3.21", "merlin", "parity-scale-codec", - "parking_lot 0.11.2", + "parking_lot 0.12.0", "schnorrkel", "serde", "sp-core", "sp-externalities", + "thiserror", ] [[package]] name = "sp-maybe-compressed-blob" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "4.1.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ + "thiserror", "zstd", ] [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "parity-scale-codec", "scale-info", @@ -7754,9 +8038,9 @@ dependencies = [ [[package]] name = "sp-npos-elections-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn", @@ -7765,7 +8049,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "sp-api", "sp-core", @@ -7774,16 +8058,18 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "backtrace", + "lazy_static", + "regex", ] [[package]] name = "sp-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "rustc-hash", "serde", @@ -7792,8 +8078,8 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "either", "hash256-std-hasher", @@ -7814,8 +8100,8 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -7831,11 +8117,11 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "Inflector", - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn", @@ -7843,8 +8129,8 @@ dependencies = [ [[package]] name = "sp-serializer" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "serde", "serde_json", @@ -7853,7 +8139,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "parity-scale-codec", "scale-info", @@ -7867,7 +8153,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "parity-scale-codec", "scale-info", @@ -7877,14 +8163,14 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "0.12.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "hash-db", "log", "num-traits", "parity-scale-codec", - "parking_lot 0.11.2", + "parking_lot 0.12.0", "rand 0.7.3", "smallvec", "sp-core", @@ -7900,13 +8186,13 @@ dependencies = [ [[package]] name = "sp-std" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" [[package]] name = "sp-storage" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "impl-serde", "parity-scale-codec", @@ -7919,7 +8205,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "log", "sp-core", @@ -7932,10 +8218,10 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "async-trait", - "futures-timer 3.0.2", + "futures-timer", "log", "parity-scale-codec", "sp-api", @@ -7947,16 +8233,10 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ - "erased-serde", - "log", "parity-scale-codec", - "parking_lot 0.10.2", - "serde", - "serde_json", - "slog", "sp-std", "tracing", "tracing-core", @@ -7966,7 +8246,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "sp-api", "sp-runtime", @@ -7975,7 +8255,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "async-trait", "log", @@ -7990,8 +8270,8 @@ dependencies = [ [[package]] name = "sp-trie" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "hash-db", "memory-db", @@ -7999,20 +8279,22 @@ dependencies = [ "scale-info", "sp-core", "sp-std", + "thiserror", "trie-db", "trie-root", ] [[package]] name = "sp-version" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "impl-serde", "parity-scale-codec", "parity-wasm 0.42.2", "scale-info", "serde", + "sp-core-hashing-proc-macro", "sp-runtime", "sp-std", "sp-version-proc-macro", @@ -8022,7 +8304,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -8032,13 +8314,15 @@ dependencies = [ [[package]] name = "sp-wasm-interface" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "impl-trait-for-tuples", + "log", "parity-scale-codec", "sp-std", "wasmi", + "wasmtime", ] [[package]] @@ -8047,6 +8331,21 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "ss58-registry" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b84a70894df7a73666e0694f44b41a9571625e9546fb58a0818a565d2c7e084" +dependencies = [ + "Inflector", + "num-format", + "proc-macro2", + "quote", + "serde", + "serde_json", + "unicode-xid", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -8068,58 +8367,35 @@ dependencies = [ "approx", "lazy_static", "nalgebra", - "num-traits", - "rand 0.8.4", -] - -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - -[[package]] -name = "structopt" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40b9788f4202aa75c240ecc9c15c65185e6a39ccdeb0fd5d008b98825464c87c" -dependencies = [ - "clap", - "lazy_static", - "structopt-derive", + "num-traits", + "rand 0.8.5", ] [[package]] -name = "structopt-derive" -version = "0.4.18" +name = "strsim" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" -dependencies = [ - "heck", - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strum" -version = "0.20.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7318c509b5ba57f18533982607f24070a55d353e90d4cae30c467cdb2ad5ac5c" +checksum = "cae14b91c7d11c9a851d3fbc80a963198998c2a64eec840477fa92d8ce9b70bb" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.20.1" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee8bc6b87a5112aeeab1f4a9f7ab634fe6cbefc4850006df31267f4cfb9e3149" +checksum = "5bb0dc7ee9c15cea6199cde9a127fa16a4c5819af85395457ad72d68edc85a38" dependencies = [ - "heck", + "heck 0.3.3", "proc-macro2", "quote", + "rustversion", "syn", ] @@ -8132,7 +8408,7 @@ dependencies = [ "hmac 0.11.0", "pbkdf2 0.8.0", "schnorrkel", - "sha2 0.9.8", + "sha2 0.9.9", "zeroize", ] @@ -8145,14 +8421,14 @@ dependencies = [ "byteorder", "crunchy", "lazy_static", - "rand 0.8.4", + "rand 0.8.5", "rustc-hex", ] [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "platforms", ] @@ -8160,10 +8436,10 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "frame-system-rpc-runtime-api", - "futures 0.3.18", + "futures 0.3.21", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -8181,39 +8457,33 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" -version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ - "async-std", - "derive_more", "futures-util", "hyper", "log", "prometheus", + "thiserror", "tokio", ] [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.11#57346f6b24875f8935280dba51fa8ab0a9ba1e39" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" dependencies = [ "ansi_term", "build-helper", "cargo_metadata", "sp-maybe-compressed-blob", + "strum", "tempfile", "toml", "walkdir", "wasm-gc-api", ] -[[package]] -name = "subtle" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" - [[package]] name = "subtle" version = "2.4.1" @@ -8222,9 +8492,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.82" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8daf5dd0bb60cbd4137b1b587d2fc0ae729bc07cf01cd70b36a1ed5ade3b9d59" +checksum = "b683b2b825c8eef438b77c36a06dc262294da3d5a5813fac20da149241dcd44d" dependencies = [ "proc-macro2", "quote", @@ -8251,41 +8521,38 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bffcddbc2458fa3e6058414599e3c838a022abae82e5c67b4f7f80298d5bff" +checksum = "d7fa7e55043acb85fca6b3c01485a2eeb6b69c5d21002e273c79e465f43b7ac1" [[package]] name = "tempfile" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ "cfg-if 1.0.0", + "fastrand", "libc", - "rand 0.8.4", - "redox_syscall 0.2.10", + "redox_syscall", "remove_dir_all", "winapi 0.3.9", ] [[package]] name = "termcolor" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" dependencies = [ "winapi-util", ] [[package]] name = "textwrap" -version = "0.11.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] +checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" [[package]] name = "thiserror" @@ -8309,9 +8576,9 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" dependencies = [ "once_cell", ] @@ -8325,6 +8592,17 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "tikv-jemalloc-sys" +version = "0.4.3+5.2.1-patched.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1792ccb507d955b46af42c123ea8863668fae24d03721e40cad6a41773dbb49" +dependencies = [ + "cc", + "fs_extra", + "libc", +] + [[package]] name = "time" version = "0.1.44" @@ -8348,7 +8626,7 @@ dependencies = [ "pbkdf2 0.4.0", "rand 0.7.3", "rustc-hash", - "sha2 0.9.8", + "sha2 0.9.9", "thiserror", "unicode-normalization", "wasm-bindgen", @@ -8366,9 +8644,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] @@ -8381,31 +8659,55 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.14.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e992e41e0d2fb9f755b37446f20900f64446ef54874f40a60c78f021ac6144" +checksum = "0f48b6d60512a392e34dbf7fd456249fd2de3c83669ab642e021903f4015185b" dependencies = [ - "autocfg", "bytes 1.1.0", "libc", "memchr", - "mio 0.7.14", + "mio 0.8.2", "num_cpus", "once_cell", - "pin-project-lite 0.2.7", + "parking_lot 0.12.0", + "pin-project-lite 0.2.9", "signal-hook-registry", + "socket2 0.4.4", + "tokio-macros", "winapi 0.3.9", ] +[[package]] +name = "tokio-macros" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tokio-rustls" version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" dependencies = [ - "rustls", + "rustls 0.19.1", + "tokio", + "webpki 0.21.4", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4151fda0cf2798550ad0b34bcfc9b9dcc2a9d2471c895c68f3a8818e54f2389e" +dependencies = [ + "rustls 0.20.4", "tokio", - "webpki", + "webpki 0.22.0", ] [[package]] @@ -8415,7 +8717,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" dependencies = [ "futures-core", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.9", "tokio", ] @@ -8427,17 +8729,32 @@ checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" dependencies = [ "bytes 1.1.0", "futures-core", + "futures-io", "futures-sink", "log", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.9", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0edfdeb067411dba2044da6d1cb2df793dd35add7888d73c16e3381ded401764" +dependencies = [ + "bytes 1.1.0", + "futures-core", + "futures-sink", + "pin-project-lite 0.2.9", "tokio", + "tracing", ] [[package]] name = "toml" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" dependencies = [ "serde", ] @@ -8450,21 +8767,21 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.29" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" +checksum = "5d0ecdcb44a79f0fe9844f0c4f33a342cbcbb5117de8001e6ba0dc2351327d09" dependencies = [ "cfg-if 1.0.0", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.9", "tracing-attributes", "tracing-core", ] [[package]] name = "tracing-attributes" -version = "0.1.18" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" +checksum = "cc6b8ad3567499f98a1db7a752b07a7c8c7c7c34c332ec00effb2b0027974b7c" dependencies = [ "proc-macro2", "quote", @@ -8473,11 +8790,12 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.21" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" +checksum = "f54c8ca710e81886d498c2fd3331b56c93aa248d49de2222ad2742247c60072f" dependencies = [ "lazy_static", + "valuable", ] [[package]] @@ -8486,15 +8804,15 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ - "pin-project 1.0.8", + "pin-project 1.0.10", "tracing", ] [[package]] name = "tracing-log" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" dependencies = [ "lazy_static", "log", @@ -8503,9 +8821,9 @@ dependencies = [ [[package]] name = "tracing-serde" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb65ea441fbb84f9f6748fd496cf7f63ec9af5bca94dd86456978d055e8eb28b" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" dependencies = [ "serde", "tracing-core", @@ -8521,6 +8839,7 @@ dependencies = [ "chrono", "lazy_static", "matchers", + "parking_lot 0.11.2", "regex", "serde", "serde_json", @@ -8535,12 +8854,12 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.22.6" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eac131e334e81b6b3be07399482042838adcd7957aa0010231d0813e39e02fa" +checksum = "d32d034c0d3db64b43c31de38e945f15b40cd4ca6d2dcfc26d4798ce8de4ab83" dependencies = [ "hash-db", - "hashbrown", + "hashbrown 0.12.0", "log", "rustc-hex", "smallvec", @@ -8548,9 +8867,9 @@ dependencies = [ [[package]] name = "trie-root" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "652931506d2c1244d7217a70b99f56718a7b4161b37f04e7cd868072a99f68cd" +checksum = "9a36c5ca3911ed3c9a5416ee6c679042064b93fc637ded67e25f92e68d783891" dependencies = [ "hash-db", ] @@ -8567,9 +8886,9 @@ dependencies = [ [[package]] name = "trust-dns-proto" -version = "0.20.3" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0d7f5db438199a6e2609debe3f69f808d074e0a2888ee0bccb45fe234d03f4" +checksum = "ca94d4e9feb6a181c690c4040d7a24ef34018d8313ac5044a61d21222ae24e31" dependencies = [ "async-trait", "cfg-if 1.0.0", @@ -8582,7 +8901,7 @@ dependencies = [ "ipnet", "lazy_static", "log", - "rand 0.8.4", + "rand 0.8.5", "smallvec", "thiserror", "tinyvec", @@ -8591,9 +8910,9 @@ dependencies = [ [[package]] name = "trust-dns-resolver" -version = "0.20.3" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ad17b608a64bd0735e67bde16b0636f8aa8591f831a25d18443ed00a699770" +checksum = "ecae383baad9995efaa34ce8e57d12c3f305e545887472a492b838f4b5cfb77a" dependencies = [ "cfg-if 1.0.0", "futures-util", @@ -8614,22 +8933,54 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +[[package]] +name = "try-runtime-cli" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.18#fc3fd073d3a0acf9933c3994b660ebd7b5833f65" +dependencies = [ + "clap", + "jsonrpsee 0.4.1", + "log", + "parity-scale-codec", + "remote-externalities", + "sc-chain-spec", + "sc-cli", + "sc-executor", + "sc-service", + "serde", + "sp-core", + "sp-externalities", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-state-machine", + "sp-version", + "zstd", +] + +[[package]] +name = "tt-call" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e66dcbec4290c69dd03c57e76c2469ea5c7ce109c6dd4351c13055cf71ea055" + [[package]] name = "twox-hash" -version = "1.6.1" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f559b464de2e2bdabcac6a210d12e9b5a5973c251e102c44c585c71d51bd78e" +checksum = "4ee73e6e4924fe940354b8d4d98cad5231175d615cd855b758adc658c0aac6a0" dependencies = [ "cfg-if 1.0.0", - "rand 0.8.4", + "digest 0.10.3", + "rand 0.8.5", "static_assertions", ] [[package]] name = "typenum" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "ucd-trie" @@ -8639,9 +8990,9 @@ checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" [[package]] name = "uint" -version = "0.9.1" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6470ab50f482bde894a037a57064480a246dbfdd5960bd65a44824693f08da5f" +checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" dependencies = [ "byteorder", "crunchy", @@ -8660,9 +9011,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-normalization" @@ -8675,15 +9026,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" - -[[package]] -name = "unicode-width" -version = "0.1.9" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" [[package]] name = "unicode-xid" @@ -8697,8 +9042,8 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" dependencies = [ - "generic-array 0.14.4", - "subtle 2.4.1", + "generic-array 0.14.5", + "subtle", ] [[package]] @@ -8760,6 +9105,12 @@ dependencies = [ "percent-encoding 2.1.0", ] +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "value-bag" version = "1.0.0-alpha.8" @@ -8776,17 +9127,11 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - [[package]] name = "version_check" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "void" @@ -8833,11 +9178,17 @@ 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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + [[package]] name = "wasm-bindgen" -version = "0.2.78" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -8845,9 +9196,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.78" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" dependencies = [ "bumpalo", "lazy_static", @@ -8860,9 +9211,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.28" +version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8d7523cb1f2a4c96c1317ca690031b714a51cc14e05f712446691f413f5d39" +checksum = "6f741de44b75e14c35df886aff5f1eb73aa114fa5d4d00dcd37b5e01259bf3b2" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -8872,9 +9223,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.78" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -8882,9 +9233,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.78" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" dependencies = [ "proc-macro2", "quote", @@ -8895,9 +9246,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.78" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" +checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" [[package]] name = "wasm-gc-api" @@ -8910,13 +9261,22 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "wasm-instrument" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "962e5b0401bbb6c887f54e69b8c496ea36f704df65db73e81fd5ff8dc3e63a9f" +dependencies = [ + "parity-wasm 0.42.2", +] + [[package]] name = "wasm-timer" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ - "futures 0.3.18", + "futures 0.3.21", "js-sys", "parking_lot 0.11.2", "pin-utils", @@ -8951,15 +9311,15 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.79.0" +version = "0.81.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b5894be15a559c85779254700e1d35f02f843b5a69152e5c82c626d9fd66c0e" +checksum = "98930446519f63d00a836efdc22f67766ceae8dbcc1571379f2bcabc6b2b9abc" [[package]] name = "wasmtime" -version = "0.29.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bbb8a082a8ef50f7eeb8b82dda9709ef1e68963ea3c94e45581644dd4041835" +checksum = "4c9c724da92e39a85d2231d4c2a942c8be295211441dbca581c6c3f3f45a9f00" dependencies = [ "anyhow", "backtrace", @@ -8970,38 +9330,38 @@ dependencies = [ "lazy_static", "libc", "log", + "object 0.27.1", "paste", "psm", + "rayon", "region", "rustc-demangle", "serde", - "smallvec", "target-lexicon", "wasmparser", "wasmtime-cache", + "wasmtime-cranelift", "wasmtime-environ", "wasmtime-jit", - "wasmtime-profiling", "wasmtime-runtime", "winapi 0.3.9", ] [[package]] name = "wasmtime-cache" -version = "0.29.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d73391579ca7f24573138ef768b73b2aed5f9d542385c64979b65d60d0912399" +checksum = "da4439d99100298344567c0eb6916ad5864e99e54760b8177c427e529077fb30" dependencies = [ "anyhow", - "base64 0.13.0", + "base64", "bincode", "directories-next", - "errno", "file-per-thread-logger", - "libc", "log", + "rustix", "serde", - "sha2 0.9.8", + "sha2 0.9.9", "toml", "winapi 0.3.9", "zstd", @@ -9009,29 +9369,20 @@ dependencies = [ [[package]] name = "wasmtime-cranelift" -version = "0.29.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81c6f5ae9205382345c7cd7454932a906186836999a2161c385e38a15f52e1fe" +checksum = "1762765dd69245f00e5d9783b695039e449a7be0f9c5383e4c78465dd6131aeb" dependencies = [ + "anyhow", "cranelift-codegen", "cranelift-entity", "cranelift-frontend", + "cranelift-native", "cranelift-wasm", - "target-lexicon", - "wasmparser", - "wasmtime-environ", -] - -[[package]] -name = "wasmtime-debug" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c69e08f55e12f15f50b1b533bc3626723e7224254a065de6576934c86258c9e8" -dependencies = [ - "anyhow", - "gimli 0.25.0", + "gimli", + "log", "more-asserts", - "object 0.26.2", + "object 0.27.1", "target-lexicon", "thiserror", "wasmparser", @@ -9040,94 +9391,51 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "0.29.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "005d93174040af37fb8625f891cd9827afdad314261f7ec4ee61ec497d6e9d3c" +checksum = "c4468301d95ec71710bb6261382efe27d1296447711645e3dbabaea6e4de3504" dependencies = [ - "cfg-if 1.0.0", - "cranelift-codegen", + "anyhow", "cranelift-entity", - "cranelift-wasm", - "gimli 0.25.0", + "gimli", "indexmap", "log", "more-asserts", + "object 0.27.1", "serde", + "target-lexicon", "thiserror", "wasmparser", + "wasmtime-types", ] [[package]] name = "wasmtime-jit" -version = "0.29.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0bf1dfb213a35d8f21aefae40e597fe72778a907011ffdff7affb029a02af9a" +checksum = "ab0ae6e581ff014b470ec35847ea3c0b4c3ace89a55df5a04c802a11f4574e7d" dependencies = [ - "addr2line 0.16.0", + "addr2line", "anyhow", + "bincode", "cfg-if 1.0.0", - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "cranelift-native", - "cranelift-wasm", - "gimli 0.25.0", - "log", - "more-asserts", - "object 0.26.2", - "rayon", + "gimli", + "object 0.27.1", "region", + "rustix", "serde", "target-lexicon", "thiserror", - "wasmparser", - "wasmtime-cranelift", - "wasmtime-debug", "wasmtime-environ", - "wasmtime-obj", - "wasmtime-profiling", "wasmtime-runtime", "winapi 0.3.9", ] -[[package]] -name = "wasmtime-obj" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231491878e710c68015228c9f9fc5955fe5c96dbf1485c15f7bed55b622c83c" -dependencies = [ - "anyhow", - "more-asserts", - "object 0.26.2", - "target-lexicon", - "wasmtime-debug", - "wasmtime-environ", -] - -[[package]] -name = "wasmtime-profiling" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21486cfb5255c2069666c1f116f9e949d4e35c9a494f11112fa407879e42198d" -dependencies = [ - "anyhow", - "cfg-if 1.0.0", - "gimli 0.25.0", - "lazy_static", - "libc", - "object 0.26.2", - "scroll", - "serde", - "target-lexicon", - "wasmtime-environ", - "wasmtime-runtime", -] - [[package]] name = "wasmtime-runtime" -version = "0.29.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7ddfdf32e0a20d81f48be9dacd31612bc61de5a174d1356fef806d300f507de" +checksum = "6d9c28877ae37a367cda7b52b8887589816152e95dde9b7c80cc686f52761961" dependencies = [ "anyhow", "backtrace", @@ -9140,18 +9448,31 @@ dependencies = [ "mach", "memoffset", "more-asserts", - "rand 0.8.4", + "rand 0.8.5", "region", + "rustix", "thiserror", "wasmtime-environ", "winapi 0.3.9", ] +[[package]] +name = "wasmtime-types" +version = "0.33.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395726e8f5dd8c57cb0db445627b842343f7e29ed7489467fdf7953ed9d3cd4f" +dependencies = [ + "cranelift-entity", + "serde", + "thiserror", + "wasmparser", +] + [[package]] name = "web-sys" -version = "0.3.55" +version = "0.3.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" +checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" dependencies = [ "js-sys", "wasm-bindgen", @@ -9167,13 +9488,32 @@ dependencies = [ "untrusted", ] +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "webpki-roots" version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" dependencies = [ - "webpki", + "webpki 0.21.4", +] + +[[package]] +name = "webpki-roots" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d8de8415c823c8abd270ad483c6feeac771fad964890779f9a8cb24fbbc1bf" +dependencies = [ + "webpki 0.22.0", ] [[package]] @@ -9187,9 +9527,9 @@ dependencies = [ [[package]] name = "which" -version = "4.2.2" +version = "4.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea187a8ef279bc014ec368c27a920da2024d2a711109bfbe3440585d5cf27ad9" +checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" dependencies = [ "either", "lazy_static", @@ -9245,6 +9585,49 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5acdd78cb4ba54c0045ac14f62d8f94a03d10047904ae2a40afa1e99d8f70825" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" + +[[package]] +name = "windows_i686_gnu" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" + +[[package]] +name = "windows_i686_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" + [[package]] name = "winreg" version = "0.6.2" @@ -9266,9 +9649,12 @@ dependencies = [ [[package]] name = "wyz" -version = "0.2.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" +checksum = "30b31594f29d27036c383b53b59ed3476874d518f0efb151b27a4c275141390e" +dependencies = [ + "tap", +] [[package]] name = "x25519-dalek" @@ -9380,7 +9766,6 @@ dependencies = [ "lazy_static", "light-bitcoin", "musig2", - "orml-utilities", "pallet-assets", "pallet-balances", "pallet-elections-phragmen", @@ -9509,7 +9894,6 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "orml-utilities", "pallet-assets", "pallet-balances", "parity-scale-codec", @@ -9568,28 +9952,28 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7d9028f208dd5e63c614be69f115c1b53cacc1111437d4c765185856666c107" dependencies = [ - "futures 0.3.18", + "futures 0.3.21", "log", "nohash-hasher", "parking_lot 0.11.2", - "rand 0.8.4", + "rand 0.8.5", "static_assertions", ] [[package]] name = "zeroize" -version = "1.4.3" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d68d9dcec5f9b43a30d38c49f91dfedfaac384cb8f085faca366c26207dd1619" +checksum = "7eb5728b8afd3f280a869ce1d4c554ffaed35f45c231fc41bfbd0381bef50317" dependencies = [ "zeroize_derive", ] [[package]] name = "zeroize_derive" -version = "1.2.2" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65f1a51723ec88c66d5d1fe80c841f17f63587d6691901d66be9bec6c3b51f73" +checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" dependencies = [ "proc-macro2", "quote", @@ -9599,18 +9983,18 @@ dependencies = [ [[package]] name = "zstd" -version = "0.9.0+zstd.1.5.0" +version = "0.9.2+zstd.1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07749a5dc2cb6b36661290245e350f15ec3bbb304e493db54a1d354480522ccd" +checksum = "2390ea1bf6c038c39674f22d95f0564725fc06034a47129179810b2fc58caa54" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "4.1.1+zstd.1.5.0" +version = "4.1.3+zstd.1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c91c90f2c593b003603e5e0493c837088df4469da25aafff8bce42ba48caf079" +checksum = "e99d81b99fb3c2c2c794e3fe56c305c63d5173a16a46b5850b07c935ffc7db79" dependencies = [ "libc", "zstd-sys", @@ -9618,9 +10002,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "1.6.1+zstd.1.5.0" +version = "1.6.2+zstd.1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "615120c7a2431d16cf1cf979e7fc31ba7a5b5e5707b29c8a99e5dbf8a8392a33" +checksum = "2daf2f248d9ea44454bfcb2516534e8b8ad2fc91bf818a1885495fc42bc8ac9f" dependencies = [ "cc", "libc", diff --git a/Makefile b/Makefile index 6d05d6b0..60a29847 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,12 @@ build: release: @cargo build --release #--features "${ENABLE_FEATURES}" +benchmarks: + @cargo build --release --features="runtime-benchmarks" + +try-runtime: + @cargo build --release --features="try-runtime" + test: export LOG_LEVEL=DEBUG && \ export RUST_BACKTRACE=1 && \ diff --git a/develop_docs/Ethereum-JSON-RPC.postman_collection.json b/develop_docs/Ethereum-JSON-RPC.postman_collection.json index dd428517..aa06b0b8 100644 --- a/develop_docs/Ethereum-JSON-RPC.postman_collection.json +++ b/develop_docs/Ethereum-JSON-RPC.postman_collection.json @@ -619,6 +619,54 @@ }, "response": [] }, + { + "name": "feeHistory", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"jsonrpc\":\"2.0\",\n \"method\":\"eth_feeHistory\",\n \"params\":[\"0x2\", \"latest\", [25, 30]],\n \"id\":1\n}" + }, + "url": { + "raw": "{{sherpax-dev}}", + "host": [ + "{{sherpax-dev}}" + ] + }, + "description": "Returns a collection of historical gas information from which you can decide what to submit as your maxFeePerGas and/or maxPriorityFeePerGas. This method was introduced with EIP 1559.\n\n# **Parameters**\n\n* **BLOCKCOUNT** - Number of blocks in the requested range. Between 1 and 1024 blocks can be requested in a single query. Less than requested may be returned if not all blocks are available.\n* **NEWESTBLOCK** - Highest number block of the requested range.\n* **REWARDPERCENTILES** - (optional) A monotonically increasing list of percentile values to sample from each block's effective priority fees per gas in ascending order, weighted by gas used.\n \n\n# **Returns**\n\n## Object\n\n* **OLDESTBLOCK** - Lowest number block of the returned range.\n* **BASEFEEPERGAS** - An array of block base fees per gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. Zeroes are returned for pre-EIP-1559 blocks.\n* **GASUSEDRATIO** - An array of block gas used ratios. These are calculated as the ratio of gasUsed and gasLimit.\n* **REWARD** - (Optional) An array of effective priority fee per gas data points from a single block. All zeroes are returned if the block is empty.\n \n\n# Result example\n\n``` json\n{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"baseFeePerGas\": [\n \"0x68c6171400\",\n \"0x68c6171400\",\n \"0x5bad543180\"\n ],\n \"gasUsedRatio\": [\n 0.0,\n 0.0\n ],\n \"oldestBlock\": \"0x1ac913\",\n \"reward\": [\n [\n \"0x0\",\n \"0x0\"\n ],\n [\n \"0x0\",\n \"0x0\"\n ]\n ]\n },\n \"id\": 1\n}\n```" + }, + "response": [] + }, + { + "name": "maxPriorityFeePerGas", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"jsonrpc\":\"2.0\",\n \"method\":\"eth_maxPriorityFeePerGas\",\n \"params\":[],\n \"id\":1\n}" + }, + "url": { + "raw": "{{sherpax-dev}}", + "host": [ + "{{sherpax-dev}}" + ] + }, + "description": "Returns a fee per gas that is an estimate of how much you can pay as a priority fee, or \"tip\", to get a transaction included in the current block.\n\n## Parameters\n\n**none**\n\n## \nReturns\n\n* QUANTITY - the estimated priority fee per gas.\n \n\n## Result example\n\n``` json\n{\n \"jsonrpc\": \"2.0\",\n \"result\": \"0x0\",\n \"id\": 1\n}\n```" + }, + "response": [] + }, { "name": "getBlockByNumber", "request": { @@ -1448,4 +1496,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/node/Cargo.toml b/node/Cargo.toml index 25b2a0ef..5ddb4e5b 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "sherpax" -version = "1.2.0" +version = "1.3.0" authors = ['The ChainX Authors'] -edition = "2018" +edition = "2021" build = "build.rs" [package.metadata.docs.rs] @@ -12,49 +12,50 @@ targets = ["x86_64-unknown-linux-gnu"] name = "sherpax" [dependencies] -structopt = "0.3.8" +clap = { version = "3.0", features = ["derive"] } jsonrpc-core = "18.0.0" hex = "0.4" -hex-literal = "0.3.3" -serde = { version = "1.0.119", features = ["derive"] } -serde_json = "1.0.68" +hex-literal = "0.3.4" +maplit = "1.0.2" +serde = { version = "1.0.136", features = ["derive"] } +serde_json = "1.0.79" # Substrate -sc-cli = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", features = ["wasmtime"] } -sc-client-api = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -sc-consensus = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -sc-consensus-aura = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -sc-executor = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", features = ["wasmtime"] } -sc-finality-grandpa = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -sc-keystore = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -sc-service = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", features = ["wasmtime"] } -sc-telemetry = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -sc-transaction-pool = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -sc-transaction-pool-api = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -sc-sync-state-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } -sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } +sc-cli = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", features = ["wasmtime"] } +sc-client-api = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +sc-consensus = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +sc-consensus-aura = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +sc-executor = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", features = ["wasmtime"] } +sc-finality-grandpa = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +sc-keystore = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +sc-service = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", features = ["wasmtime"] } +sc-telemetry = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +sc-transaction-pool = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +sc-transaction-pool-api = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +sc-sync-state-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } +sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } -sp-consensus-aura = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -sp-consensus = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -sp-core = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -sp-finality-grandpa = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -sp-inherents = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -sp-runtime = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -sp-timestamp = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } +sp-consensus-aura = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +sp-consensus = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +sp-core = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +sp-finality-grandpa = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +sp-inherents = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +sp-runtime = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +sp-timestamp = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } # These dependencies are used for the node template's RPCs -sc-rpc = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -sc-rpc-api = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -sc-basic-authorship = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -sp-api = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -sp-blockchain = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -sp-block-builder = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -substrate-frame-rpc-system = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -pallet-transaction-payment-rpc = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } - +sc-rpc = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +sc-rpc-api = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +sc-basic-authorship = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +sp-api = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +sp-blockchain = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +sp-block-builder = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +substrate-frame-rpc-system = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +pallet-transaction-payment-rpc = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } # These dependencies are used for runtime benchmarking -frame-benchmarking = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } -frame-benchmarking-cli = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } +frame-benchmarking = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } +frame-benchmarking-cli = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } # SherpaX sherpax-runtime = { version = "1.0.0", path = "../runtime/sherpax" } @@ -62,15 +63,15 @@ sherpax-runtime = { version = "1.0.0", path = "../runtime/sherpax" } # EVM futures = { version = "0.3", features = ["compat"] } jsonrpc-pubsub = "18.0.0" -sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } -fp-consensus = { git = "https://github.com/chainx-org/frontier", branch = "new-polkadot-v0.9.11" } -fp-rpc = { git = "https://github.com/chainx-org/frontier", branch = "new-polkadot-v0.9.11" } -fc-consensus = { git = "https://github.com/chainx-org/frontier", branch = "new-polkadot-v0.9.11" } -fc-rpc-core = { git = "https://github.com/chainx-org/frontier", branch = "new-polkadot-v0.9.11" } -fc-rpc = { git = "https://github.com/chainx-org/frontier", branch = "new-polkadot-v0.9.11", features = ["rpc_binary_search_estimate"] } -fc-mapping-sync = { git = "https://github.com/chainx-org/frontier", branch = "new-polkadot-v0.9.11" } -fc-db = { git = "https://github.com/chainx-org/frontier", branch = "new-polkadot-v0.9.11" } -pallet-ethereum = { git="https://github.com/chainx-org/frontier", branch = "new-polkadot-v0.9.11" } +sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } +fp-consensus = { git = "https://github.com/chainx-org/frontier", branch = "polkadot-v0.9.18" } +fp-rpc = { git = "https://github.com/chainx-org/frontier", branch = "polkadot-v0.9.18" } +fp-storage = { git="https://github.com/chainx-org/frontier", branch = "polkadot-v0.9.18" } +fc-consensus = { git = "https://github.com/chainx-org/frontier", branch = "polkadot-v0.9.18" } +fc-rpc-core = { git = "https://github.com/chainx-org/frontier", branch = "polkadot-v0.9.18" } +fc-rpc = { git = "https://github.com/chainx-org/frontier", branch = "polkadot-v0.9.18", features = ["rpc_binary_search_estimate"] } +fc-mapping-sync = { git = "https://github.com/chainx-org/frontier", branch = "polkadot-v0.9.18" } +fc-db = { git = "https://github.com/chainx-org/frontier", branch = "polkadot-v0.9.18" } # Cross Chain sherpax-primitives = { path = "../primitives" } @@ -81,12 +82,17 @@ xpallet-gateway-common-rpc-runtime-api = { path = "../xpallets/gateway/common/rp xpallet-gateway-records-rpc = { path = "../xpallets/gateway/records/rpc" } xpallet-gateway-records-rpc-runtime-api = { path = "../xpallets/gateway/records/rpc/runtime-api" } +# CLI-specific dependencies +try-runtime-cli = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", optional = true } [build-dependencies] -substrate-build-script-utils = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } +substrate-build-script-utils = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } [features] default = [] runtime-benchmarks = [ "sherpax-runtime/runtime-benchmarks", ] +# Enable features that allow the runtime to be tried and debugged. Name might be subject to change +# in the near future. +try-runtime = ["sherpax-runtime/try-runtime", "try-runtime-cli"] diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index a17f9e9a..58e0bde4 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -11,9 +11,10 @@ use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; pub use sherpax_runtime::{ constants::currency::UNITS, opaque::SessionKeys, AccountId, AssetsBridgeConfig, AssetsConfig, - AuraConfig, Balance, BalancesConfig, BlockNumber, EthereumChainIdConfig, EthereumConfig, - EvmConfig, GenesisAccount, GenesisConfig, GrandpaConfig, SessionConfig, Signature, SudoConfig, - SystemConfig, TechnicalMembershipConfig, VestingConfig, DAYS, WASM_BINARY, + AuraConfig, Balance, BalancesConfig, BaseFeeConfig, BlockNumber, DefaultBaseFeePerGas, + EthereumChainIdConfig, EthereumConfig, EvmConfig, GenesisConfig, GrandpaConfig, SessionConfig, + Signature, SudoConfig, SystemConfig, TechnicalMembershipConfig, VestingConfig, DAYS, + WASM_BINARY, }; use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_core::crypto::UncheckedInto; @@ -214,6 +215,7 @@ pub fn benchmarks_config() -> Result { // Protocol ID None, // Properties + None, Some(properties), // Extensions Default::default(), @@ -256,6 +258,7 @@ pub fn development_config() -> Result { None, // Protocol ID None, + None, // Properties Some(properties), // Extensions @@ -309,6 +312,7 @@ pub fn local_testnet_config() -> Result { None, // Protocol ID None, + None, // Properties Some(properties), // Extensions @@ -387,6 +391,7 @@ pub fn mainnet_config() -> Result { ), // Protocol ID Some(DEFAULT_PROTOCOL_ID), + None, // Properties Some(properties), // Extensions @@ -452,7 +457,6 @@ pub fn sherpax_genesis( system: SystemConfig { // Add Wasm runtime to storage. code: wasm_binary.to_vec(), - changes_trie_config: Default::default(), }, balances: BalancesConfig { balances }, aura: Default::default(), @@ -471,12 +475,17 @@ pub fn sherpax_genesis( }, sudo: SudoConfig { // Assign network admin rights. - key: root_key, + key: Some(root_key), }, vesting: VestingConfig { vesting }, ethereum_chain_id: EthereumChainIdConfig { chain_id: 1506u64 }, evm: Default::default(), ethereum: Default::default(), + base_fee: BaseFeeConfig::new( + DefaultBaseFeePerGas::get(), + false, + sp_runtime::Permill::from_parts(125_000), + ), assets: sherpax_runtime::AssetsConfig { assets: assets_info.0, metadata: assets_info.1, diff --git a/node/src/cli.rs b/node/src/cli.rs index c6f35151..0fd52cbc 100644 --- a/node/src/cli.rs +++ b/node/src/cli.rs @@ -1,19 +1,20 @@ use sc_cli::RunCmd; -use structopt::StructOpt; -#[derive(Debug, StructOpt)] +#[derive(Debug, clap::Parser)] pub struct Cli { - #[structopt(subcommand)] + #[clap(subcommand)] pub subcommand: Option, - #[structopt(flatten)] + #[clap(flatten)] pub run: RunCmd, } -#[derive(Debug, StructOpt)] +#[derive(Debug, clap::Subcommand)] pub enum Subcommand { /// Key management cli utilities + #[clap(subcommand)] Key(sc_cli::KeySubcommand), + /// Build a chain specification. BuildSpec(sc_cli::BuildSpecCmd), @@ -36,6 +37,14 @@ pub enum Subcommand { Revert(sc_cli::RevertCmd), /// The custom benchmark subcommmand benchmarking runtime pallets. - #[structopt(name = "benchmark", about = "Benchmark runtime pallets.")] + #[clap(name = "benchmark", about = "Benchmark runtime pallets.")] Benchmark(frame_benchmarking_cli::BenchmarkCmd), + + /// Try some command against runtime state. + #[cfg(feature = "try-runtime")] + TryRuntime(try_runtime_cli::TryRuntimeCmd), + + /// Try some command against runtime state. Note: `try-runtime` feature must be enabled. + #[cfg(not(feature = "try-runtime"))] + TryRuntime, } diff --git a/node/src/command.rs b/node/src/command.rs index 204352f7..9f5c7e0d 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -17,7 +17,7 @@ use crate::cli::{Cli, Subcommand}; use crate::{chain_spec, service}; -use sc_cli::{ChainSpec, Role, RuntimeVersion, SubstrateCli}; +use sc_cli::{ChainSpec, RuntimeVersion, SubstrateCli}; use sc_service::PartialComponents; use sherpax_runtime::Block; @@ -39,7 +39,7 @@ impl SubstrateCli for Cli { } fn support_url() -> String { - "support.anonymous.an".into() + "https://github.com/chainx-org/SherpaX".into() } fn copyright_start_year() -> i32 { @@ -48,7 +48,7 @@ impl SubstrateCli for Cli { fn load_spec(&self, id: &str) -> Result, String> { use sp_core::crypto::{set_default_ss58_version, Ss58AddressFormat}; - set_default_ss58_version(Ss58AddressFormat::ChainXAccount); + set_default_ss58_version(Ss58AddressFormat::custom(44)); Ok(match id { "dev" => Box::new(chain_spec::development_config()?), @@ -103,47 +103,47 @@ pub fn run() -> sc_cli::Result<()> { } Some(Subcommand::CheckBlock(cmd)) => { let runner = cli.create_runner(cmd)?; - runner.async_run(|config| { + runner.async_run(|mut config| { let PartialComponents { client, task_manager, import_queue, .. - } = service::new_partial(&config)?; + } = service::new_partial(&mut config)?; Ok((cmd.run(client, import_queue), task_manager)) }) } Some(Subcommand::ExportBlocks(cmd)) => { let runner = cli.create_runner(cmd)?; - runner.async_run(|config| { + runner.async_run(|mut config| { let PartialComponents { client, task_manager, .. - } = service::new_partial(&config)?; + } = service::new_partial(&mut config)?; Ok((cmd.run(client, config.database), task_manager)) }) } Some(Subcommand::ExportState(cmd)) => { let runner = cli.create_runner(cmd)?; - runner.async_run(|config| { + runner.async_run(|mut config| { let PartialComponents { client, task_manager, .. - } = service::new_partial(&config)?; + } = service::new_partial(&mut config)?; Ok((cmd.run(client, config.chain_spec), task_manager)) }) } Some(Subcommand::ImportBlocks(cmd)) => { let runner = cli.create_runner(cmd)?; - runner.async_run(|config| { + runner.async_run(|mut config| { let PartialComponents { client, task_manager, import_queue, .. - } = service::new_partial(&config)?; + } = service::new_partial(&mut config)?; Ok((cmd.run(client, import_queue), task_manager)) }) } @@ -161,13 +161,13 @@ pub fn run() -> sc_cli::Result<()> { } Some(Subcommand::Revert(cmd)) => { let runner = cli.create_runner(cmd)?; - runner.async_run(|config| { + runner.async_run(|mut config| { let PartialComponents { client, task_manager, backend, .. - } = service::new_partial(&config)?; + } = service::new_partial(&mut config)?; Ok((cmd.run(client, backend), task_manager)) }) } @@ -175,21 +175,37 @@ pub fn run() -> sc_cli::Result<()> { if cfg!(feature = "runtime-benchmarks") { let runner = cli.create_runner(cmd)?; - runner.sync_run(|config| cmd.run::(config)) + runner.sync_run(|config| cmd.run::(config)) } else { Err("Benchmarking wasn't enabled when building the node. \ You can enable it with `--features runtime-benchmarks`." .into()) } } + #[cfg(feature = "try-runtime")] + Some(Subcommand::TryRuntime(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.async_run(|config| { + // we don't need any of the components of new_partial, just a runtime, or a task + // manager to do `async_run`. + let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry); + let task_manager = + sc_service::TaskManager::new(config.tokio_handle.clone(), registry) + .map_err(|e| sc_cli::Error::Service(sc_service::Error::Prometheus(e)))?; + Ok(( + cmd.run::(config), + task_manager, + )) + }) + } + #[cfg(not(feature = "try-runtime"))] + Some(Subcommand::TryRuntime) => Err("TryRuntime wasn't enabled when building the node. \ + You can enable it with `--features try-runtime`." + .into()), None => { let runner = cli.create_runner(&cli.run)?; runner.run_node_until_exit(|config| async move { - match config.role { - Role::Light => service::new_light(config), - _ => service::new_full(config), - } - .map_err(sc_cli::Error::Service) + service::new_full(config).map_err(sc_cli::Error::Service) }) } } diff --git a/node/src/rpc.rs b/node/src/rpc.rs index bf073dbf..473dc0a4 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -16,12 +16,12 @@ use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; // EVM use fc_rpc::{ - EthBlockDataCache, OverrideHandle, RuntimeApiStorageOverride, SchemaV1Override, - SchemaV2Override, StorageOverride, + EthBlockDataCacheTask, OverrideHandle, RuntimeApiStorageOverride, SchemaV1Override, + SchemaV2Override, SchemaV3Override, StorageOverride, }; use fc_rpc_core::types::{FeeHistoryCache, FilterPool}; +use fp_storage::EthereumStorageSchema; use jsonrpc_pubsub::manager::SubscriptionManager; -use pallet_ethereum::EthereumStorageSchema; use sc_client_api::{ backend::{AuxStore, Backend, StateBackend, StorageProvider}, client::BlockchainEvents, @@ -60,6 +60,10 @@ pub struct FullDeps { pub fee_history_limit: u64, /// Fee history cache. pub fee_history_cache: FeeHistoryCache, + /// Ethereum data access overrides. + pub overrides: Arc>, + /// Cache for Ethereum block data. + pub block_data_cache: Arc>, } pub fn overrides_handle(client: Arc) -> Arc> @@ -67,7 +71,9 @@ where C: ProvideRuntimeApi + StorageProvider + AuxStore, C: HeaderBackend + HeaderMetadata, C: Send + Sync + 'static, - C::Api: fp_rpc::EthereumRuntimeRPCApi, + C::Api: sp_api::ApiExt + + fp_rpc::EthereumRuntimeRPCApi + + fp_rpc::ConvertTransactionRuntimeApi, BE: Backend + 'static, BE::State: StateBackend, { @@ -83,6 +89,12 @@ where 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)), @@ -93,7 +105,6 @@ where pub fn create_full( deps: FullDeps, subscription_task_executor: SubscriptionTaskExecutor, - overrides: Arc>, ) -> RpcExtension where BE: Backend + 'static, @@ -103,9 +114,10 @@ where C: HeaderBackend + HeaderMetadata, C: Send + Sync + 'static, C::Api: substrate_frame_rpc_system::AccountNonceApi, - C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, C::Api: BlockBuilder, + C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, C::Api: fp_rpc::EthereumRuntimeRPCApi, + C::Api: fp_rpc::ConvertTransactionRuntimeApi, C::Api: xpallet_gateway_bitcoin_rpc_runtime_api::XGatewayBitcoinApi, C::Api: xpallet_gateway_common_rpc_runtime_api::XGatewayCommonApi< Block, @@ -122,10 +134,6 @@ where P: TransactionPool + Sync + Send + 'static, A: ChainApi + 'static, { - use fc_rpc::{ - EthApi, EthApiServer, EthFilterApi, EthFilterApiServer, EthPubSubApi, EthPubSubApiServer, - HexEncodedIdProvider, NetApi, NetApiServer, Web3Api, Web3ApiServer, - }; use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi}; use substrate_frame_rpc_system::{FullSystem, SystemApi}; use xpallet_gateway_bitcoin_rpc::{XGatewayBitcoin, XGatewayBitcoinApi}; @@ -133,6 +141,7 @@ where use xpallet_gateway_records_rpc::{XGatewayRecords, XGatewayRecordsApi}; let mut io = jsonrpc_core::IoHandler::default(); + let FullDeps { client, pool, @@ -145,6 +154,8 @@ where max_past_logs, fee_history_limit, fee_history_cache, + overrides, + block_data_cache, } = deps; io.extend_with(SystemApi::to_delegate(FullSystem::new( @@ -157,14 +168,18 @@ where client.clone(), ))); + // eth api { - let block_data_cache = Arc::new(EthBlockDataCache::new(50, 50)); + use fc_rpc::{ + EthApi, EthApiServer, EthFilterApi, EthFilterApiServer, EthPubSubApi, + EthPubSubApiServer, HexEncodedIdProvider, NetApi, NetApiServer, Web3Api, Web3ApiServer, + }; io.extend_with(EthApiServer::to_delegate(EthApi::new( client.clone(), pool.clone(), graph, - sherpax_runtime::TransactionConverter, + Some(sherpax_runtime::TransactionConverter), network.clone(), Vec::new(), overrides.clone(), @@ -172,7 +187,7 @@ where is_authority, max_past_logs, block_data_cache.clone(), - fc_rpc::format::Legacy, + fc_rpc::format::Geth, fee_history_limit, fee_history_cache, ))); @@ -183,7 +198,6 @@ where backend, filter_pool, 500_usize, // max stored filters - overrides.clone(), max_past_logs, block_data_cache, ))); @@ -208,15 +222,15 @@ where ), overrides, ))); - - io.extend_with(XGatewayBitcoinApi::to_delegate(XGatewayBitcoin::new( - client.clone(), - ))); - io.extend_with(XGatewayRecordsApi::to_delegate(XGatewayRecords::new( - client.clone(), - ))); - io.extend_with(XGatewayCommonApi::to_delegate(XGatewayCommon::new(client))); } + io.extend_with(XGatewayBitcoinApi::to_delegate(XGatewayBitcoin::new( + client.clone(), + ))); + io.extend_with(XGatewayRecordsApi::to_delegate(XGatewayRecords::new( + client.clone(), + ))); + io.extend_with(XGatewayCommonApi::to_delegate(XGatewayCommon::new(client))); + io } diff --git a/node/src/service.rs b/node/src/service.rs index 29bbfe13..729ddd18 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -1,7 +1,7 @@ //! Service and ServiceFactory implementation. Specialized wrapper over substrate service. #![allow(clippy::all)] -use sc_client_api::{ExecutorProvider, RemoteBackend}; +use sc_client_api::{BlockBackend, ExecutorProvider}; use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams}; pub use sc_executor::NativeElseWasmExecutor; use sc_finality_grandpa::SharedVoterState; @@ -9,7 +9,6 @@ use sc_keystore::LocalKeystore; use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; use sc_telemetry::{Telemetry, TelemetryWorker}; use sherpax_runtime::{self, opaque::Block, RuntimeApi}; -use sp_consensus::SlotData; use sp_consensus_aura::sr25519::AuthorityPair as AuraPair; use std::{sync::Arc, time::Duration}; @@ -19,16 +18,23 @@ use fc_mapping_sync::{MappingSyncWorker, SyncStrategy::Normal}; use fc_rpc::EthTask; use fc_rpc_core::types::{FeeHistoryCache, FilterPool}; use futures::StreamExt; -use sc_cli::SubstrateCli; +use maplit::hashmap; use sc_client_api::BlockchainEvents; +use sc_service::config::PrometheusConfig; use sc_service::BasePath; use std::{collections::BTreeMap, sync::Mutex}; +use substrate_prometheus_endpoint::Registry; // Our native executor instance. -pub struct Executor; +pub struct ExecutorDispatch; -impl sc_executor::NativeExecutionDispatch for Executor { +impl sc_executor::NativeExecutionDispatch for ExecutorDispatch { + /// Only enable the benchmarking host functions when we actually want to benchmark. + #[cfg(feature = "runtime-benchmarks")] type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions; + /// Otherwise we only use the default Substrate host functions. + #[cfg(not(feature = "runtime-benchmarks"))] + type ExtendHostFunctions = (); fn dispatch(method: &str, data: &[u8]) -> Option> { sherpax_runtime::api::dispatch(method, data) @@ -39,7 +45,8 @@ impl sc_executor::NativeExecutionDispatch for Executor { } } -type FullClient = sc_service::TFullClient>; +type FullClient = + sc_service::TFullClient>; type FullBackend = sc_service::TFullBackend; type FullSelectChain = sc_consensus::LongestChain; @@ -54,8 +61,7 @@ pub fn frontier_database_dir(config: &Configuration) -> std::path::PathBuf { .as_ref() .map(|base_path| base_path.config_dir(config.chain_spec.id())) .unwrap_or_else(|| { - BasePath::from_project("", "", &crate::cli::Cli::executable_name()) - .config_dir(config.chain_spec.id()) + BasePath::from_project("", "", "sherpax").config_dir(config.chain_spec.id()) }); config_dir.join("frontier").join("db") } @@ -71,8 +77,20 @@ pub fn open_frontier_backend(config: &Configuration) -> Result Result<(), ServiceError> { + if let Some(PrometheusConfig { registry, .. }) = config.prometheus_config.as_mut() { + let labels = hashmap! { + "chain".into() => config.chain_spec.id().into(), + }; + *registry = Registry::new_custom(Some("frontier".into()), Some(labels))?; + } + + Ok(()) +} + pub fn new_partial( - config: &Configuration, + config: &mut Configuration, ) -> Result< sc_service::PartialComponents< FullClient, @@ -91,11 +109,13 @@ pub fn new_partial( ServiceError, > { if config.keystore_remote.is_some() { - return Err(ServiceError::Other(format!( - "Remote Keystores are not supported." - ))); + return Err(ServiceError::Other( + "Remote Keystores are not supported.".into(), + )); } + set_prometheus_registry(config)?; + let telemetry = config .telemetry_endpoints .clone() @@ -107,10 +127,11 @@ pub fn new_partial( }) .transpose()?; - let executor = NativeElseWasmExecutor::::new( + let executor = NativeElseWasmExecutor::::new( config.wasm_method, config.default_heap_pages, config.max_runtime_instances, + config.runtime_cache_size, ); let (client, backend, keystore_container, task_manager) = @@ -122,7 +143,9 @@ pub fn new_partial( let client = Arc::new(client); let telemetry = telemetry.map(|(worker, telemetry)| { - task_manager.spawn_handle().spawn("telemetry", worker.run()); + task_manager + .spawn_handle() + .spawn("telemetry", None, worker.run()); telemetry }); @@ -153,10 +176,10 @@ pub fn new_partial( frontier_backend.clone(), ); - let slot_duration = sc_consensus_aura::slot_duration(&*client)?.slot_duration(); + let slot_duration = sc_consensus_aura::slot_duration(&*client)?; - let import_queue = - sc_consensus_aura::import_queue::(ImportQueueParams { + let import_queue = sc_consensus_aura::import_queue::( + ImportQueueParams { block_import: frontier_block_import.clone(), justification_import: Some(Box::new(grandpa_block_import.clone())), client: client.clone(), @@ -164,7 +187,7 @@ pub fn new_partial( let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); let slot = - sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_duration( + sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( *timestamp, slot_duration, ); @@ -178,7 +201,8 @@ pub fn new_partial( registry: config.prometheus_registry(), check_for_equivocation: Default::default(), telemetry: telemetry.as_ref().map(|x| x.handle()), - })?; + }, + )?; Ok(sc_service::PartialComponents { client, @@ -216,7 +240,7 @@ pub fn new_full(mut config: Configuration) -> Result select_chain, transaction_pool, other: (consensus_result, filter_pool, frontier_backend, mut telemetry, fee_history_cache), - } = new_partial(&config)?; + } = new_partial(&mut config)?; if let Some(url) = &config.keystore_remote { match remote_keystore(url) { @@ -229,14 +253,26 @@ pub fn new_full(mut config: Configuration) -> Result } }; } + let grandpa_protocol_name = sc_finality_grandpa::protocol_standard_name( + &client + .block_hash(0) + .ok() + .flatten() + .expect("Genesis block exists; qed"), + &config.chain_spec, + ); config .network .extra_sets - .push(sc_finality_grandpa::grandpa_peers_set_config()); + .push(sc_finality_grandpa::grandpa_peers_set_config( + grandpa_protocol_name.clone(), + )); + let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new( backend.clone(), consensus_result.1.shared_authority_set().clone(), + Vec::default(), )); let (network, system_rpc_tx, network_starter) = @@ -246,7 +282,6 @@ pub fn new_full(mut config: Configuration) -> Result transaction_pool: transaction_pool.clone(), spawn_handle: task_manager.spawn_handle(), import_queue, - on_demand: None, block_announce_validator_builder: None, warp_sync: Some(warp_sync), })?; @@ -263,16 +298,24 @@ pub fn new_full(mut config: Configuration) -> Result let overrides = crate::rpc::overrides_handle(client.clone()); let fee_history_limit = 2048; + let block_data_cache = Arc::new(fc_rpc::EthBlockDataCacheTask::new( + task_manager.spawn_handle(), + overrides.clone(), + 50, + 50, + prometheus_registry.clone(), + )); + let rpc_extensions_builder = { let client = client.clone(); let pool = transaction_pool.clone(); let network = network.clone(); let filter_pool = filter_pool.clone(); let frontier_backend = frontier_backend.clone(); - let is_authority = false; - let max_past_logs = 10000; let overrides = overrides.clone(); let fee_history_cache = fee_history_cache.clone(); + let is_authority = false; + let max_past_logs = 10000; Box::new(move |deny_unsafe, _| { let deps = crate::rpc::FullDeps { @@ -287,12 +330,13 @@ pub fn new_full(mut config: Configuration) -> Result max_past_logs, fee_history_limit, fee_history_cache: fee_history_cache.clone(), + overrides: overrides.clone(), + block_data_cache: block_data_cache.clone(), }; Ok(crate::rpc::create_full( deps, subscription_task_executor.clone(), - overrides.clone(), )) }) }; @@ -304,8 +348,6 @@ pub fn new_full(mut config: Configuration) -> Result task_manager: &mut task_manager, transaction_pool: transaction_pool.clone(), rpc_extensions_builder, - on_demand: None, - remote_blockchain: None, backend: backend.clone(), system_rpc_tx, config, @@ -314,12 +356,15 @@ pub fn new_full(mut config: Configuration) -> Result 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.clone(), frontier_backend.clone(), + 3, + 0, Normal, ) .for_each(|()| futures::future::ready(())), @@ -331,6 +376,7 @@ pub fn new_full(mut config: Configuration) -> Result const FILTER_RETAIN_THRESHOLD: u64 = 100; task_manager.spawn_essential_handle().spawn( "frontier-filter-pool", + Some("frontier"), EthTask::filter_pool_task(Arc::clone(&client), filter_pool, FILTER_RETAIN_THRESHOLD), ); } @@ -338,6 +384,7 @@ pub fn new_full(mut config: Configuration) -> Result // Spawn Frontier FeeHistory cache maintenance task. task_manager.spawn_essential_handle().spawn( "frontier-fee-history", + Some("frontier"), EthTask::fee_history_task( Arc::clone(&client), Arc::clone(&overrides), @@ -348,6 +395,7 @@ pub fn new_full(mut config: Configuration) -> Result task_manager.spawn_essential_handle().spawn( "frontier-schema-cache-task", + Some("frontier"), EthTask::ethereum_schema_cache_task(Arc::clone(&client), Arc::clone(&frontier_backend)), ); @@ -366,7 +414,6 @@ pub fn new_full(mut config: Configuration) -> Result sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()); let slot_duration = sc_consensus_aura::slot_duration(&*client)?; - let raw_slot_duration = slot_duration.slot_duration(); let aura = sc_consensus_aura::start_aura::( StartAuraParams { @@ -379,9 +426,9 @@ pub fn new_full(mut config: Configuration) -> Result let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); let slot = - sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_duration( + sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( *timestamp, - raw_slot_duration, + slot_duration, ); Ok((timestamp, slot)) @@ -402,7 +449,7 @@ pub fn new_full(mut config: Configuration) -> Result // fails we take down the service with it. task_manager .spawn_essential_handle() - .spawn_blocking("aura", aura); + .spawn_blocking("aura", Some("block-authoring"), aura); } // if the node isn't actively participating in consensus then it doesn't @@ -422,6 +469,7 @@ pub fn new_full(mut config: Configuration) -> Result keystore, local_role: role, telemetry: telemetry.as_ref().map(|x| x.handle()), + protocol_name: grandpa_protocol_name, }; if enable_grandpa { @@ -445,6 +493,7 @@ pub fn new_full(mut config: Configuration) -> Result // if it fails we take down the service with it. task_manager.spawn_essential_handle().spawn_blocking( "grandpa-voter", + None, sc_finality_grandpa::run_grandpa_voter(grandpa_config)?, ); } @@ -452,146 +501,3 @@ pub fn new_full(mut config: Configuration) -> Result network_starter.start_network(); Ok(task_manager) } - -/// Builds a new service for a light client. -pub fn new_light(mut config: Configuration) -> Result { - let telemetry = config - .telemetry_endpoints - .clone() - .filter(|x| !x.is_empty()) - .map(|endpoints| -> Result<_, sc_telemetry::Error> { - let worker = TelemetryWorker::new(16)?; - let telemetry = worker.handle().new_telemetry(endpoints); - Ok((worker, telemetry)) - }) - .transpose()?; - - let executor = NativeElseWasmExecutor::::new( - config.wasm_method, - config.default_heap_pages, - config.max_runtime_instances, - ); - - let (client, backend, keystore_container, mut task_manager, on_demand) = - sc_service::new_light_parts::( - &config, - telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), - executor, - )?; - - let mut telemetry = telemetry.map(|(worker, telemetry)| { - task_manager.spawn_handle().spawn("telemetry", worker.run()); - telemetry - }); - - config - .network - .extra_sets - .push(sc_finality_grandpa::grandpa_peers_set_config()); - - let select_chain = sc_consensus::LongestChain::new(backend.clone()); - - let transaction_pool = Arc::new(sc_transaction_pool::BasicPool::new_light( - config.transaction_pool.clone(), - config.prometheus_registry(), - task_manager.spawn_essential_handle(), - client.clone(), - on_demand.clone(), - )); - - let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import( - client.clone(), - &(client.clone() as Arc<_>), - select_chain.clone(), - telemetry.as_ref().map(|x| x.handle()), - )?; - - let slot_duration = sc_consensus_aura::slot_duration(&*client)?.slot_duration(); - - let import_queue = - sc_consensus_aura::import_queue::(ImportQueueParams { - block_import: grandpa_block_import.clone(), - justification_import: Some(Box::new(grandpa_block_import.clone())), - client: client.clone(), - create_inherent_data_providers: move |_, ()| async move { - let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); - - let slot = - sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_duration( - *timestamp, - slot_duration, - ); - - Ok((timestamp, slot)) - }, - spawner: &task_manager.spawn_essential_handle(), - can_author_with: sp_consensus::NeverCanAuthor, - registry: config.prometheus_registry(), - check_for_equivocation: Default::default(), - telemetry: telemetry.as_ref().map(|x| x.handle()), - })?; - - let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new( - backend.clone(), - grandpa_link.shared_authority_set().clone(), - )); - - let (network, system_rpc_tx, network_starter) = - sc_service::build_network(sc_service::BuildNetworkParams { - config: &config, - client: client.clone(), - transaction_pool: transaction_pool.clone(), - spawn_handle: task_manager.spawn_handle(), - import_queue, - on_demand: Some(on_demand.clone()), - block_announce_validator_builder: None, - warp_sync: Some(warp_sync), - })?; - - if config.offchain_worker.enabled { - sc_service::build_offchain_workers( - &config, - task_manager.spawn_handle(), - client.clone(), - network.clone(), - ); - } - - let enable_grandpa = !config.disable_grandpa; - if enable_grandpa { - let name = config.network.node_name.clone(); - - let config = sc_finality_grandpa::Config { - gossip_duration: std::time::Duration::from_millis(333), - justification_period: 512, - name: Some(name), - observer_enabled: false, - keystore: None, - local_role: config.role.clone(), - telemetry: telemetry.as_ref().map(|x| x.handle()), - }; - - task_manager.spawn_handle().spawn_blocking( - "grandpa-observer", - sc_finality_grandpa::run_grandpa_observer(config, grandpa_link, network.clone())?, - ); - } - - sc_service::spawn_tasks(sc_service::SpawnTasksParams { - remote_blockchain: Some(backend.remote_blockchain()), - transaction_pool, - task_manager: &mut task_manager, - on_demand: Some(on_demand), - rpc_extensions_builder: Box::new(|_, _| Ok(())), - config, - client, - keystore: keystore_container.sync_keystore(), - backend, - network, - system_rpc_tx, - telemetry: telemetry.as_mut(), - })?; - - network_starter.start_network(); - Ok(task_manager) -} diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index c517109f..7b293358 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -2,21 +2,21 @@ name = "sherpax-primitives" version = "3.0.0" authors = ["The ChainX Authors"] -edition = "2018" +edition = "2021" [dependencies] -codec = { package = "parity-scale-codec", version = "2.3.1", default-features = false } -serde = { version = "1.0", features = ["derive"], optional = true } -scale-info = { version = "1.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false } +serde = { version = "1.0.136", features = ["derive"], optional = true } +scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } # Substrate primitives -sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } # Substrate pallets -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } [features] default = ["std"] diff --git a/primitives/assets-registrar/Cargo.toml b/primitives/assets-registrar/Cargo.toml index f4feb9c0..9df9053b 100644 --- a/primitives/assets-registrar/Cargo.toml +++ b/primitives/assets-registrar/Cargo.toml @@ -2,17 +2,17 @@ name = "xp-assets-registrar" version = "3.0.0" authors = ["The ChainX Authors"] -edition = "2018" +edition = "2021" [dependencies] -codec = { package = "parity-scale-codec", version = "2.3.1", default-features = false } -serde = { version = "1.0", features = ["derive"], optional = true } -scale-info = { version = "1.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false } +serde = { version = "1.0.136", features = ["derive"], optional = true } +scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } impl-trait-for-tuples = "0.2.1" # Substrate primitives -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } # ChainX primitives sherpax-primitives = { path = "../../primitives", default-features = false } diff --git a/primitives/gateway/bitcoin/Cargo.toml b/primitives/gateway/bitcoin/Cargo.toml index e2d19111..5872fed5 100644 --- a/primitives/gateway/bitcoin/Cargo.toml +++ b/primitives/gateway/bitcoin/Cargo.toml @@ -2,26 +2,26 @@ name = "xp-gateway-bitcoin" version = "3.0.0" authors = ["The ChainX Authors"] -edition = "2018" +edition = "2021" [dependencies] -codec = { package = "parity-scale-codec", version = "2.3.1", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } hex = { version = "0.4", default-features = false } -serde = { version = "1.0", features = ["derive"], optional = true } -scale-info = { version = "1.0", default-features = false, features = ["derive"] } +serde = { version = "1.0.136", features = ["derive"], optional = true } +scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } # Substrate primitives -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } # ChainX primitives sherpax-primitives = { path = "../../../primitives", default-features = false } xp-gateway-common = { path = "../../gateway/common", default-features = false } # light-bitcoin -light-bitcoin = { git = "https://github.com/chainx-org/light-bitcoin", branch = "taproot", default-features = false } +light-bitcoin = { git = "https://github.com/chainx-org/light-bitcoin", branch = "upgrade-2021", default-features = false } [features] default = ["std"] diff --git a/primitives/gateway/bitcoin/src/detector.rs b/primitives/gateway/bitcoin/src/detector.rs index d10644ab..6798ddf1 100644 --- a/primitives/gateway/bitcoin/src/detector.rs +++ b/primitives/gateway/bitcoin/src/detector.rs @@ -230,7 +230,7 @@ impl BtcTxTypeDetector { #[cfg(test)] mod tests { - use sp_core::crypto::{set_default_ss58_version, Ss58AddressFormat}; + use sp_core::crypto::{set_default_ss58_version, Ss58AddressFormatRegistry}; use sp_runtime::AccountId32; use super::{Address, BtcTxTypeDetector, Network, Transaction}; @@ -242,7 +242,7 @@ mod tests { #[test] fn test_parse_deposit_transaction_outputs() { - set_default_ss58_version(Ss58AddressFormat::ChainXAccount); + set_default_ss58_version(Ss58AddressFormatRegistry::ChainxAccount.into()); // tx from MathWallet test let cases = vec![ diff --git a/primitives/gateway/bitcoin/src/extractor.rs b/primitives/gateway/bitcoin/src/extractor.rs index a4138fae..0f6d70a3 100644 --- a/primitives/gateway/bitcoin/src/extractor.rs +++ b/primitives/gateway/bitcoin/src/extractor.rs @@ -50,15 +50,15 @@ impl AccountExtractor for OpReturnExtractor { #[test] fn test_opreturn_extractor() { use sp_core::{ - crypto::{set_default_ss58_version, Ss58AddressFormat, UncheckedInto}, + crypto::{set_default_ss58_version, Ss58AddressFormatRegistry, UncheckedInto}, H256, }; let addr = "f778a69d4166401048acb0f7b2625e9680609f8859c78e3d28e2549f84f0269a" .parse::() .unwrap(); - let mainnet = Ss58AddressFormat::ChainXAccount; - let testnet = Ss58AddressFormat::SubstrateAccount; + let mainnet = Ss58AddressFormatRegistry::ChainxAccount.into(); + let testnet = Ss58AddressFormatRegistry::SubstrateAccount.into(); { set_default_ss58_version(mainnet); @@ -86,7 +86,7 @@ fn test_opreturn_extractor() { "5VEW3R1T4LR3kDhYwXeeCnYrHRwRaH7E9V1KprypBe68XmY4".as_bytes(), ); #[cfg(feature = "ss58check")] - assert_eq!(result, None); + assert_eq!(result, Some((addr.unchecked_into(), None))); #[cfg(not(feature = "ss58check"))] assert_eq!(result, Some((addr.unchecked_into(), None))); } diff --git a/primitives/gateway/common/Cargo.toml b/primitives/gateway/common/Cargo.toml index c6a245b0..e67cdcaa 100644 --- a/primitives/gateway/common/Cargo.toml +++ b/primitives/gateway/common/Cargo.toml @@ -2,15 +2,15 @@ name = "xp-gateway-common" version = "3.0.0" authors = ["The ChainX Authors"] -edition = "2018" +edition = "2021" [dependencies] bs58 = { version = "0.3", default-features = false, features = ["alloc"] } hex = { version = "0.4", default-features = false } # Substrate primitives -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } # ChainX primitives xp-io = { path = "../../io", default-features = false, optional = true } diff --git a/primitives/io/Cargo.toml b/primitives/io/Cargo.toml index 88814473..c8444496 100644 --- a/primitives/io/Cargo.toml +++ b/primitives/io/Cargo.toml @@ -2,15 +2,15 @@ name = "xp-io" version = "3.0.0" authors = ["The ChainX Authors"] -edition = "2018" +edition = "2021" [dependencies] -codec = { package = "parity-scale-codec", version = "2.3.1", default-features = false } +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false } # Substrate primitives -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-runtime-interface = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-runtime-interface = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } [dev-dependencies] hex = "0.4" diff --git a/primitives/io/src/lib.rs b/primitives/io/src/lib.rs index 50ed0a5b..b9593b8d 100644 --- a/primitives/io/src/lib.rs +++ b/primitives/io/src/lib.rs @@ -14,10 +14,12 @@ pub enum Ss58CheckError { BadBase58, /// Bad length. BadLength, - /// Unknown version. - UnknownVersion, + /// Unknown ss58 address format. + UnknownSs58AddressFormat, /// Invalid checksum. InvalidChecksum, + /// Invalid prefix + InvalidPrefix, /// Invalid format. InvalidFormat, /// Invalid derivation path. @@ -31,22 +33,26 @@ pub enum Ss58CheckError { #[runtime_interface] pub trait Ss58Codec { fn from_ss58check(addr: &[u8]) -> Result { - use sp_core::crypto::{PublicError, Ss58AddressFormat, Ss58Codec}; + use sp_core::crypto::{PublicError, Ss58Codec}; let s = String::from_utf8_lossy(addr).into_owned(); AccountId32::from_ss58check_with_version(&s) + .map(|(account, _)| { + // https://github.com/paritytech/substrate/blob/polkadot-v0.9.18/primitives/core/src/crypto.rs#L310 + // Support all ss58 versions. + account + }) .map_err(|err| match err { PublicError::BadBase58 => Ss58CheckError::BadBase58, PublicError::BadLength => Ss58CheckError::BadLength, - PublicError::UnknownVersion => Ss58CheckError::UnknownVersion, + PublicError::UnknownSs58AddressFormat(_) => { + Ss58CheckError::UnknownSs58AddressFormat + } PublicError::InvalidChecksum => Ss58CheckError::InvalidChecksum, + PublicError::InvalidPrefix => Ss58CheckError::InvalidPrefix, PublicError::InvalidFormat => Ss58CheckError::InvalidFormat, PublicError::InvalidPath => Ss58CheckError::InvalidPath, PublicError::FormatNotAllowed => Ss58CheckError::FormatNotAllowed, }) - .and_then(|(account, ver)| match ver { - ver if ver == Ss58AddressFormat::default() => Ok(account), - _ => Err(Ss58CheckError::MismatchVersion), - }) } } @@ -59,13 +65,13 @@ fn ss58_check() { let pubkey = hex::decode("072ec6e199a69a1a38f0299afc083b2b6c85899bdad56d250b2ec39a9788b7a2").unwrap(); - set_default_ss58_version(Ss58AddressFormat::ChainXAccount); + set_default_ss58_version(Ss58AddressFormat::from(44u16)); let account = ss_58_codec::from_ss58check(addr44).unwrap(); assert_eq!(AsRef::<[u8]>::as_ref(&account), pubkey.as_slice()); - assert!(ss_58_codec::from_ss58check(addr42).is_err()); + assert!(ss_58_codec::from_ss58check(addr42).is_ok()); - set_default_ss58_version(Ss58AddressFormat::SubstrateAccount); + set_default_ss58_version(Ss58AddressFormat::from(42u16)); let account = ss_58_codec::from_ss58check(addr42).unwrap(); assert_eq!(AsRef::<[u8]>::as_ref(&account), pubkey.as_slice()); - assert!(ss_58_codec::from_ss58check(addr44).is_err()); + assert!(ss_58_codec::from_ss58check(addr44).is_ok()); } diff --git a/primitives/protocol/Cargo.toml b/primitives/protocol/Cargo.toml index 12ccaf8b..5ac57fe1 100644 --- a/primitives/protocol/Cargo.toml +++ b/primitives/protocol/Cargo.toml @@ -2,15 +2,15 @@ name = "xp-protocol" version = "3.0.0" authors = ["The ChainX Authors"] -edition = "2018" +edition = "2021" [dependencies] -codec = { package = "parity-scale-codec", version = "2.3.1", features = ["derive"], default-features = false } -serde = { version = "1.0", features = ["derive"], optional = true } -scale-info = { version = "1.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive"], default-features = false } +serde = { version = "1.0.136", features = ["derive"], optional = true } +scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } # Substrate primitives -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } # ChainX primitives sherpax-primitives = { path = "..", default-features = false } diff --git a/primitives/rpc/Cargo.toml b/primitives/rpc/Cargo.toml index 0af84b49..095ff8f5 100644 --- a/primitives/rpc/Cargo.toml +++ b/primitives/rpc/Cargo.toml @@ -2,12 +2,12 @@ name = "xp-rpc" version = "3.0.0" authors = ["The ChainX Authors"] -edition = "2018" +edition = "2021" [dependencies] hex = "0.4" jsonrpc-core = "18.0.0" -serde = { version = "1.0", features = ["derive"] } +serde = { version = "1.0.136", features = ["derive"] } [dev-dependencies] -serde_json = "1.0" +serde_json = "1.0.79" diff --git a/primitives/runtime/Cargo.toml b/primitives/runtime/Cargo.toml index 8ae7671b..7b67fd77 100644 --- a/primitives/runtime/Cargo.toml +++ b/primitives/runtime/Cargo.toml @@ -2,17 +2,17 @@ name = "xp-runtime" version = "3.0.0" authors = ["The ChainX Authors"] -edition = "2018" +edition = "2021" [dependencies] -codec = { package = "parity-scale-codec", version = "2.3.1", default-features = false } -serde = { version = "1.0", optional = true, features = ["derive"] } -scale-info = { version = "1.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false } +serde = { version = "1.0.136", optional = true, features = ["derive"] } +scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } # Substrate primitives -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } [dev-dependencies] hex = "0.4" diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index 7d8e1621..a9ca30ea 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -40,7 +40,7 @@ pub type Hash = sp_core::H256; pub type Timestamp = u64; /// Digest item type. -pub type DigestItem = generic::DigestItem; +pub type DigestItem = generic::DigestItem; /// Header type. pub type Header = generic::Header; @@ -78,34 +78,3 @@ pub type ReferralId = Vec; pub type AddrStr = Vec; pub type ChainAddress = Vec; - -/// App-specific crypto used for reporting equivocation/misbehavior in BABE and -/// GRANDPA. Any rewards for misbehavior reporting will be paid out to this -/// account. -pub mod report { - use super::{Signature, Verify}; - use frame_system::offchain::AppCrypto; - use sp_core::crypto::{key_types, KeyTypeId}; - - /// Key type for the reporting module. Used for reporting BABE and GRANDPA - /// equivocations. - pub const KEY_TYPE: KeyTypeId = key_types::REPORTING; - - mod app { - use sp_application_crypto::{app_crypto, sr25519}; - app_crypto!(sr25519, super::KEY_TYPE); - } - - /// Identity of the equivocation/misbehavior reporter. - pub type ReporterId = app::Public; - - /// An `AppCrypto` type to allow submitting signed transactions using the reporting - /// application key as signer. - pub struct ReporterAppCrypto; - - impl AppCrypto<::Signer, Signature> for ReporterAppCrypto { - type RuntimeAppPublic = ReporterId; - type GenericPublic = sp_core::sr25519::Public; - type GenericSignature = sp_core::sr25519::Signature; - } -} diff --git a/runtime/sherpax/Cargo.toml b/runtime/sherpax/Cargo.toml index 83bb4032..37296b93 100644 --- a/runtime/sherpax/Cargo.toml +++ b/runtime/sherpax/Cargo.toml @@ -1,86 +1,86 @@ [package] name = "sherpax-runtime" -version = "1.2.0" +version = "1.3.0" authors = ['The ChainX Authors'] -edition = "2018" +edition = "2021" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", version = "2.3.1", default-features = false, features = ["derive"] } -hex-literal = { version = "0.3.1", optional = true } -scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } -smallvec = "1.7.0" +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } +hex-literal = { version = "0.3.4", optional = true } +scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } +smallvec = "1.8.0" static_assertions = "1.1.0" -sp-api = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -sp-block-builder = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -sp-consensus-aura = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -sp-core = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -sp-inherents = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -sp-offchain = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -sp-runtime = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -sp-session = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -sp-staking = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -sp-std = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -sp-transaction-pool = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -sp-version = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } - -frame-executive = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -frame-support = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -frame-system = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -# Used for runtime benchmarking -frame-benchmarking = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false, optional = true } -frame-system-benchmarking = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false, optional = true } -# Used for the node template's RPCs -frame-system-rpc-runtime-api = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } - -pallet-aura = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -pallet-balances = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -pallet-grandpa = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -pallet-session = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -pallet-sudo = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -pallet-timestamp = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -pallet-transaction-payment-rpc-runtime-api = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -pallet-utility = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +sp-api = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +sp-block-builder = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +sp-consensus-aura = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +sp-core = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +sp-inherents = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +sp-offchain = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +sp-runtime = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +sp-session = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +sp-staking = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +sp-std = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +sp-transaction-pool = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +sp-version = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } + +frame-executive = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +frame-support = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +frame-system = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +frame-try-runtime = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false, optional = true } +frame-benchmarking = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false, optional = true } +frame-system-benchmarking = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false, optional = true } +frame-system-rpc-runtime-api = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } + +pallet-aura = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +pallet-balances = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +pallet-grandpa = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +pallet-session = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +pallet-sudo = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +pallet-timestamp = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +pallet-utility = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } # Governance -pallet-bounties = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -pallet-democracy = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -pallet-membership = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.11" } -pallet-scheduler = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -pallet-tips = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } -pallet-treasury = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11", default-features = false } +pallet-bounties = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +pallet-democracy = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +pallet-membership = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.18" } +pallet-scheduler = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +pallet-tips = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } +pallet-treasury = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18", default-features = false } # SherpaX pallet-assets = { path = "../../xpallets/assets", default-features = false } pallet-assets-bridge = { path = "../../xpallets/assets-bridge", default-features = false } # Evm -pallet-evm = { git = "https://github.com/chainx-org/frontier", branch = "new-polkadot-v0.9.11", default-features = false } -pallet-ethereum = { git = "https://github.com/chainx-org/frontier", branch = "new-polkadot-v0.9.11", default-features = false } +pallet-evm = { git = "https://github.com/chainx-org/frontier", branch = "polkadot-v0.9.18", default-features = false } +pallet-ethereum = { git = "https://github.com/chainx-org/frontier", branch = "polkadot-v0.9.18", default-features = false } +pallet-base-fee = { git = "https://github.com/chainx-org/frontier", branch = "polkadot-v0.9.18", default-features = false } pallet-ethereum-chain-id = { path = "../../xpallets/ethereum-chain-id", default-features = false } # EVM precompile -fp-evm = { git = "https://github.com/chainx-org/frontier", default-features = false, branch = "new-polkadot-v0.9.11" } -pallet-evm-precompile-bn128 = { git = "https://github.com/chainx-org/frontier", default-features = false, branch = "new-polkadot-v0.9.11" } -pallet-evm-precompile-dispatch = { git = "https://github.com/chainx-org/frontier", default-features = false, branch = "new-polkadot-v0.9.11" } -pallet-evm-precompile-modexp = { git = "https://github.com/chainx-org/frontier", default-features = false, branch = "new-polkadot-v0.9.11" } -pallet-evm-precompile-simple = { git = "https://github.com/chainx-org/frontier", default-features = false, branch = "new-polkadot-v0.9.11" } -pallet-evm-precompile-sha3fips = { git = "https://github.com/chainx-org/frontier", default-features = false, branch = "new-polkadot-v0.9.11" } -pallet-evm-precompile-blake2 = { git = "https://github.com/chainx-org/frontier", default-features = false, branch = "new-polkadot-v0.9.11" } +fp-evm = { git = "https://github.com/chainx-org/frontier", default-features = false, branch = "polkadot-v0.9.18" } +pallet-evm-precompile-bn128 = { git = "https://github.com/chainx-org/frontier", default-features = false, branch = "polkadot-v0.9.18" } +pallet-evm-precompile-dispatch = { git = "https://github.com/chainx-org/frontier", default-features = false, branch = "polkadot-v0.9.18" } +pallet-evm-precompile-modexp = { git = "https://github.com/chainx-org/frontier", default-features = false, branch = "polkadot-v0.9.18" } +pallet-evm-precompile-simple = { git = "https://github.com/chainx-org/frontier", default-features = false, branch = "polkadot-v0.9.18" } +pallet-evm-precompile-sha3fips = { git = "https://github.com/chainx-org/frontier", default-features = false, branch = "polkadot-v0.9.18" } +pallet-evm-precompile-blake2 = { git = "https://github.com/chainx-org/frontier", default-features = false, branch = "polkadot-v0.9.18" } # ETH API -fp-rpc = { git = "https://github.com/chainx-org/frontier", default-features = false, branch = "new-polkadot-v0.9.11" } -fp-self-contained = { git = "https://github.com/chainx-org/frontier", default-features = false, branch = "new-polkadot-v0.9.11" } +fp-rpc = { git = "https://github.com/chainx-org/frontier", default-features = false, branch = "polkadot-v0.9.18" } +fp-self-contained = { git = "https://github.com/chainx-org/frontier", default-features = false, branch = "polkadot-v0.9.18" } # Cross chain sherpax-primitives = { path = "../../primitives", default-features = false } @@ -96,7 +96,7 @@ xpallet-gateway-records-rpc-runtime-api = { path = "../../xpallets/gateway/recor xpallet-support = { path = "../../xpallets/support", default-features = false } [build-dependencies] -substrate-wasm-builder = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.11" } +substrate-wasm-builder = { git = 'https://github.com/paritytech/substrate', branch = "polkadot-v0.9.18" } [features] default = ["std"] @@ -119,6 +119,7 @@ std = [ "frame-executive/std", "frame-support/std", + "frame-try-runtime/std", "frame-system/std", "frame-system-rpc-runtime-api/std", "pallet-aura/std", @@ -151,11 +152,11 @@ std = [ "pallet-multisig/std", "pallet-evm/std", "pallet-ethereum/std", + "pallet-base-fee/std", "pallet-ethereum-chain-id/std", "fp-evm/std", "fp-rpc/std", "fp-self-contained/std", - "sherpax-primitives/std", "xp-assets-registrar/std", "xp-gateway-bitcoin/std", @@ -178,8 +179,40 @@ runtime-benchmarks = [ "pallet-balances/runtime-benchmarks", "pallet-collective/runtime-benchmarks", "pallet-ethereum/runtime-benchmarks", + "pallet-evm/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "xpallet-gateway-bitcoin/runtime-benchmarks", "xpallet-gateway-common/runtime-benchmarks", "xpallet-gateway-records/runtime-benchmarks", ] +try-runtime = [ + "frame-executive/try-runtime", + "frame-try-runtime", + "frame-system/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-sudo/try-runtime", + "pallet-balances/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-assets/try-runtime", + "pallet-vesting/try-runtime", + "pallet-authorship/try-runtime", + "pallet-session/try-runtime", + "pallet-aura/try-runtime", + "pallet-grandpa/try-runtime", + "pallet-democracy/try-runtime", + "pallet-collective/try-runtime", + "pallet-elections-phragmen/try-runtime", + "pallet-membership/try-runtime", + "pallet-treasury/try-runtime", + "pallet-scheduler/try-runtime", + "pallet-identity/try-runtime", + "pallet-bounties/try-runtime", + "pallet-tips/try-runtime", + "pallet-utility/try-runtime", + "pallet-multisig/try-runtime", + "pallet-ethereum/try-runtime", + "pallet-assets-bridge/try-runtime", + "xpallet-gateway-bitcoin/try-runtime", + "xpallet-gateway-common/try-runtime", + "xpallet-gateway-records/try-runtime" +] diff --git a/runtime/sherpax/src/impls.rs b/runtime/sherpax/src/impls.rs index 86103a11..791cbc04 100644 --- a/runtime/sherpax/src/impls.rs +++ b/runtime/sherpax/src/impls.rs @@ -23,7 +23,9 @@ pub type SlowAdjustingFeeUpdate = pub struct Author; impl OnUnbalanced for Author { fn on_nonzero_unbalanced(amount: NegativeImbalance) { - Balances::resolve_creating(&Authorship::author(), amount); + if let Some(author) = Authorship::author() { + Balances::resolve_creating(&author, amount); + } } } diff --git a/runtime/sherpax/src/lib.rs b/runtime/sherpax/src/lib.rs index 3e6e13aa..2f9df459 100644 --- a/runtime/sherpax/src/lib.rs +++ b/runtime/sherpax/src/lib.rs @@ -11,11 +11,7 @@ use pallet_grandpa::fg_primitives; use pallet_grandpa::{AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList}; use sp_api::impl_runtime_apis; use sp_consensus_aura::sr25519::AuthorityId as AuraId; -use sp_core::{ - crypto::KeyTypeId, - u32_trait::{_1, _2, _3, _4, _5}, - OpaqueMetadata, -}; +use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, @@ -35,15 +31,18 @@ use static_assertions::const_assert; // A few exports that help ease life for downstream crates. pub use frame_support::{ construct_runtime, parameter_types, - traits::{Get, KeyOwnerProofSystem, LockIdentifier, Randomness}, + traits::{ + ConstBool, ConstU32, EnsureOneOf, EqualPrivilegeOnly, FindAuthor, Get, KeyOwnerProofSystem, + LockIdentifier, OnRuntimeUpgrade, Randomness, + }, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, RuntimeDbWeight, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, }, - PalletId, StorageValue, + ConsensusEngineId, PalletId, StorageValue, }; -use frame_system::{EnsureOneOf, EnsureRoot}; +use frame_system::EnsureRoot; pub use pallet_balances::Call as BalancesCall; pub use pallet_timestamp::Call as TimestampCall; @@ -98,7 +97,7 @@ pub type Index = u32; pub type Hash = sp_core::H256; /// Digest item type. -pub type DigestItem = generic::DigestItem; +pub type DigestItem = generic::DigestItem; /// Opaque types. These are used by the CLI to instantiate machinery that don't need to know /// the specifics of the runtime. They can then be made to be agnostic over specific formats @@ -154,10 +153,11 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // `spec_version`, and `authoring_version` are the same between Wasm and native. // This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use // the compatible custom types. - spec_version: 33, + spec_version: 38, impl_version: 1, apis: RUNTIME_API_VERSIONS, - transaction_version: 2, + transaction_version: 3, + state_version: 0, }; /// This determines the average expected block time that we are targeting. @@ -251,12 +251,13 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; /// The set code logic, just the default since we're not a parachain. type OnSetCode = (); + type MaxConsumers = frame_support::traits::ConstU32<16>; } impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; - type DisabledValidators = (); type MaxAuthorities = MaxAuthorities; + type DisabledValidators = (); } parameter_types! { @@ -271,7 +272,6 @@ impl pallet_authorship::Config for Runtime { } parameter_types! { - pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(33); pub const Period: u32 = 30 * MINUTES; pub const Offset: u32 = 0; } @@ -288,20 +288,19 @@ impl pallet_session::Config for Runtime { type SessionHandler = ::KeyTypeIdProviders; type Keys = opaque::SessionKeys; - type DisabledValidatorsThreshold = DisabledValidatorsThreshold; type WeightInfo = (); } impl pallet_grandpa::Config for Runtime { type Event = Event; type Call = Call; - type KeyOwnerProofSystem = (); type KeyOwnerProof = >::Proof; type KeyOwnerIdentification = >::IdentificationTuple; + type KeyOwnerProofSystem = (); type HandleEquivocation = (); type WeightInfo = (); type MaxAuthorities = MaxAuthorities; @@ -326,17 +325,17 @@ parameter_types! { } impl pallet_balances::Config for Runtime { - type MaxLocks = MaxLocks; /// The type for recording an account's balance. type Balance = Balance; + type DustRemoval = (); /// The ubiquitous event type. type Event = Event; - type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; + type WeightInfo = pallet_balances::weights::SubstrateWeight; + type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; - type WeightInfo = pallet_balances::weights::SubstrateWeight; } parameter_types! { @@ -349,9 +348,9 @@ impl pallet_transaction_payment::Config for Runtime { type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; type TransactionByteFee = TransactionByteFee; + type OperationalFeeMultiplier = OperationalFeeMultiplier; type WeightToFee = constants::fee::WeightToFee; type FeeMultiplierUpdate = impls::SlowAdjustingFeeUpdate; - type OperationalFeeMultiplier = OperationalFeeMultiplier; } impl pallet_sudo::Config for Runtime { @@ -362,6 +361,7 @@ impl pallet_sudo::Config for Runtime { impl pallet_utility::Config for Runtime { type Event = Event; type Call = Call; + type PalletsOrigin = OriginCaller; type WeightInfo = (); } @@ -400,9 +400,8 @@ impl pallet_collective::Config for Runtime { } type EnsureRootOrHalfCouncil = EnsureOneOf< - AccountId, EnsureRoot, - pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>, + pallet_collective::EnsureProportionMoreThan, >; impl pallet_membership::Config for Runtime { type Event = Event; @@ -455,7 +454,8 @@ impl pallet_elections_phragmen::Config for Runtime { parameter_types! { pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) * BlockWeights::get().max_block; - pub const MaxScheduledPerBlock: u32 = 50; + // Retry a scheduled item every 10 blocks (1 minute) until the preimage exists. + pub const NoPreimagePostponement: Option = Some(10); } impl pallet_scheduler::Config for Runtime { type Event = Event; @@ -464,8 +464,11 @@ impl pallet_scheduler::Config for Runtime { type Call = Call; type MaximumWeight = MaximumSchedulerWeight; type ScheduleOrigin = EnsureRoot; - type MaxScheduledPerBlock = MaxScheduledPerBlock; + type OriginPrivilegeCmp = EqualPrivilegeOnly; + type MaxScheduledPerBlock = ConstU32<50>; type WeightInfo = pallet_scheduler::weights::SubstrateWeight; + type PreimageProvider = (); + type NoPreimagePostponement = NoPreimagePostponement; } parameter_types! { @@ -516,30 +519,29 @@ impl pallet_democracy::Config for Runtime { type MinimumDeposit = MinimumDeposit; /// A straight majority of the council can decide what their next motion is. type ExternalOrigin = - pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>; + pallet_collective::EnsureProportionAtLeast; /// A super-majority can have the next scheduled referendum be a straight majority-carries vote. type ExternalMajorityOrigin = - pallet_collective::EnsureProportionAtLeast<_3, _4, AccountId, CouncilCollective>; + pallet_collective::EnsureProportionAtLeast; /// A unanimous council can have the next scheduled referendum be a straight default-carries /// (NTB) vote. type ExternalDefaultOrigin = - pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, CouncilCollective>; + pallet_collective::EnsureProportionAtLeast; /// Two thirds of the technical committee can have an ExternalMajority/ExternalDefault vote /// be tabled immediately and with a shorter voting/enactment period. type FastTrackOrigin = - pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, TechnicalCollective>; + pallet_collective::EnsureProportionAtLeast; type InstantOrigin = - pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>; + pallet_collective::EnsureProportionAtLeast; type InstantAllowed = InstantAllowed; type FastTrackVotingPeriod = FastTrackVotingPeriod; // To cancel a proposal which has been passed, 2/3 of the council must agree to it. type CancellationOrigin = - pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>; + pallet_collective::EnsureProportionAtLeast; // To cancel a proposal before it has been passed, the technical committee must be unanimous or // Root must agree. type CancelProposalOrigin = EnsureOneOf< - AccountId, - pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>, + pallet_collective::EnsureProportionAtLeast, EnsureRoot, >; type BlacklistOrigin = EnsureRoot; @@ -561,6 +563,8 @@ parameter_types! { pub const ProposalBond: Permill = Permill::from_percent(5); // 10 KSX pub const ProposalBondMinimum: Balance = 10 * UNITS; + // 100 KSX + pub const ProposalBondMaximum: Balance = 100 * UNITS; pub const SpendPeriod: BlockNumber = 6 * DAYS; pub const NoBurn: Permill = Permill::from_percent(0); pub const TipCountdown: BlockNumber = DAYS; @@ -580,14 +584,12 @@ impl pallet_treasury::Config for Runtime { type PalletId = TreasuryPalletId; type Currency = Balances; type ApproveOrigin = EnsureOneOf< - AccountId, EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective>, + pallet_collective::EnsureProportionAtLeast, >; type RejectOrigin = EnsureOneOf< - AccountId, EnsureRoot, - pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>, + pallet_collective::EnsureProportionMoreThan, >; type Event = Event; type OnSlash = Treasury; @@ -599,6 +601,7 @@ impl pallet_treasury::Config for Runtime { type SpendFunds = Bounties; type WeightInfo = pallet_treasury::weights::SubstrateWeight; type MaxApprovals = MaxApprovals; + type ProposalBondMaximum = ProposalBondMaximum; } impl pallet_bounties::Config for Runtime { type Event = Event; @@ -610,15 +613,16 @@ impl pallet_bounties::Config for Runtime { type DataDepositPerByte = DataDepositPerByte; type MaximumReasonLength = MaximumReasonLength; type WeightInfo = pallet_bounties::weights::SubstrateWeight; + type ChildBountyManager = (); } impl pallet_tips::Config for Runtime { type Event = Event; - type DataDepositPerByte = DataDepositPerByte; type MaximumReasonLength = MaximumReasonLength; - type Tippers = Elections; + type DataDepositPerByte = DataDepositPerByte; type TipCountdown = TipCountdown; type TipFindersFee = TipFindersFee; type TipReportDepositBase = TipReportDepositBase; + type Tippers = Elections; type WeightInfo = pallet_tips::weights::SubstrateWeight; } @@ -653,15 +657,8 @@ impl pallet_evm::GasWeightMapping for SherpaXGasWeightMapping { } } -pub struct FixedGasPrice; -impl FeeCalculator for FixedGasPrice { - fn min_gas_price() -> U256 { - 450_000_000_000u128.into() - } -} - impl pallet_evm::Config for Runtime { - type FeeCalculator = FixedGasPrice; + type FeeCalculator = BaseFee; type GasWeightMapping = SherpaXGasWeightMapping; type BlockHashMapping = pallet_ethereum::EthereumBlockHashMapping; type CallOrigin = EnsureAddressRoot; @@ -676,15 +673,42 @@ impl pallet_evm::Config for Runtime { type OnChargeTransaction = pallet_evm::EVMCurrencyAdapter; type BlockGasLimit = BlockGasLimit; type FindAuthor = (); + type WeightInfo = pallet_evm::weights::SubstrateWeight; } impl pallet_ethereum::Config for Runtime { type Event = Event; - type StateRoot = pallet_ethereum::IntermediateStateRoot; + type StateRoot = pallet_ethereum::IntermediateStateRoot; +} + +frame_support::parameter_types! { + pub DefaultBaseFeePerGas: U256 = U256::from(450_000_000_000u128); +} + +pub struct BaseFeeThreshold; +impl pallet_base_fee::BaseFeeThreshold for BaseFeeThreshold { + fn lower() -> Permill { + Permill::zero() + } + fn ideal() -> Permill { + Permill::from_parts(500_000) + } + fn upper() -> Permill { + Permill::from_parts(1_000_000) + } +} + +impl pallet_base_fee::Config for Runtime { + type Event = Event; + type Threshold = BaseFeeThreshold; + // Tells `pallet_base_fee` whether to calculate a new BaseFee `on_finalize` or not. + type IsActive = ConstBool; + type DefaultBaseFeePerGas = DefaultBaseFeePerGas; } parameter_types! { pub const AssetDeposit: Balance = 100 * UNITS; + pub const AssetAccountDeposit: Balance = 5 * CENTS; pub const ApprovalDeposit: Balance = UNITS; pub const StringLimit: u32 = 50; pub const MetadataDepositBase: Balance = 10 * UNITS; @@ -698,6 +722,7 @@ impl pallet_assets::Config for Runtime { type Currency = Balances; type ForceOrigin = frame_system::EnsureRoot; type AssetDeposit = AssetDeposit; + type AssetAccountDeposit = AssetAccountDeposit; type MetadataDepositBase = MetadataDepositBase; type MetadataDepositPerByte = MetadataDepositPerByte; type ApprovalDeposit = ApprovalDeposit; @@ -770,7 +795,7 @@ impl xpallet_gateway_common::Config for Runtime { type Validator = (); type DetermineMultisigAddress = MultisigProvider; type CouncilOrigin = - pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>; + pallet_collective::EnsureProportionAtLeast; type Bitcoin = XGatewayBitcoin; type BitcoinTrustee = XGatewayBitcoin; type BitcoinTrusteeSessionProvider = trustees::bitcoin::BtcTrusteeSessionManager; @@ -783,7 +808,7 @@ impl xpallet_gateway_bitcoin::Config for Runtime { type Event = Event; type UnixTime = Timestamp; type CouncilOrigin = - pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>; + pallet_collective::EnsureProportionAtLeast; type AccountExtractor = xp_gateway_bitcoin::OpReturnExtractor; type TrusteeSessionProvider = trustees::bitcoin::BtcTrusteeSessionManager; type TrusteeInfoUpdate = XGatewayCommon; @@ -837,6 +862,7 @@ construct_runtime!( Evm: pallet_evm::{Pallet, Config, Call, Storage, Event} = 51, Ethereum: pallet_ethereum::{Pallet, Call, Storage, Event, Config, Origin} = 52, AssetsBridge: pallet_assets_bridge::{Pallet, Call, Storage, Config, Event} = 53, + BaseFee: pallet_base_fee::{Pallet, Call, Storage, Config, Event} = 54, // Crypto gateway stuff. XGatewayRecords: xpallet_gateway_records::{Pallet, Call, Storage, Event, Config} = 60, @@ -845,6 +871,21 @@ construct_runtime!( } ); +#[cfg(feature = "runtime-benchmarks")] +#[macro_use] +extern crate frame_benchmarking; + +#[cfg(feature = "runtime-benchmarks")] +mod benches { + define_benchmarks!( + [frame_benchmarking, BaselineBench::] + [frame_system, SystemBench::] + [xpallet_gateway_records, XGatewayRecords] + [xpallet_gateway_common, XGatewayCommon] + [xpallet_gateway_bitcoin, XGatewayBitcoin] + ); +} + pub struct TransactionConverter; impl fp_rpc::ConvertTransaction for TransactionConverter { @@ -881,6 +922,7 @@ pub type SignedBlock = generic::SignedBlock; pub type BlockId = generic::BlockId; /// The SignedExtension to the basic transaction logic. pub type SignedExtra = ( + frame_system::CheckNonZeroSender, frame_system::CheckSpecVersion, frame_system::CheckTxVersion, frame_system::CheckGenesis, @@ -900,10 +942,23 @@ pub type Executive = frame_executive::Executive< Block, frame_system::ChainContext, Runtime, - AllPallets, - (), + AllPalletsWithSystem, + SchedulerMigrationV3, >; +// Migration for scheduler pallet to move from a plain Call to a CallOrHash. +pub struct SchedulerMigrationV3; + +impl OnRuntimeUpgrade for SchedulerMigrationV3 { + fn on_runtime_upgrade() -> frame_support::weights::Weight { + frame_support::log::info!("🔍️ SchedulerMigrationV3 start"); + let w = Scheduler::migrate_v2_to_v3(); + frame_support::log::info!("🚀 SchedulerMigrationV3 end"); + + w + } +} + impl fp_self_contained::SelfContainedCall for Call { type SignedInfo = H160; @@ -1082,6 +1137,14 @@ impl_runtime_apis! { } } + impl fp_rpc::ConvertTransactionRuntimeApi for Runtime { + fn convert_transaction(transaction: EthereumTransaction) -> ::Extrinsic { + UncheckedExtrinsic::new_unsigned( + pallet_ethereum::Call::::transact { transaction }.into(), + ) + } + } + impl fp_rpc::EthereumRuntimeRPCApi for Runtime { fn chain_id() -> u64 { ::ChainId::get() @@ -1120,6 +1183,7 @@ impl_runtime_apis! { max_priority_fee_per_gas: Option, nonce: Option, estimate: bool, + access_list: Option)>>, ) -> Result { let config = if estimate { let mut config = ::config().clone(); @@ -1129,6 +1193,7 @@ impl_runtime_apis! { None }; + let is_transactional = false; ::Runner::call( from, to, @@ -1138,7 +1203,8 @@ impl_runtime_apis! { max_fee_per_gas, max_priority_fee_per_gas, nonce, - Vec::new(), + access_list.unwrap_or_default(), + is_transactional, config.as_ref().unwrap_or_else(|| ::config()), ).map_err(|err| err.into()) } @@ -1153,6 +1219,7 @@ impl_runtime_apis! { max_priority_fee_per_gas: Option, nonce: Option, estimate: bool, + access_list: Option)>>, ) -> Result { let config = if estimate { let mut config = ::config().clone(); @@ -1162,6 +1229,7 @@ impl_runtime_apis! { None }; + let is_transactional = false; ::Runner::create( from, data, @@ -1170,7 +1238,8 @@ impl_runtime_apis! { max_fee_per_gas, max_priority_fee_per_gas, nonce, - Vec::new(), + access_list.unwrap_or_default(), + is_transactional, config.as_ref().unwrap_or_else(|| ::config()), ).map_err(|err| err.into()) } @@ -1209,7 +1278,7 @@ impl_runtime_apis! { } fn elasticity() -> Option { - None + Some(BaseFee::elasticity()) } } @@ -1314,14 +1383,14 @@ impl_runtime_apis! { Vec, Vec, ) { - use frame_benchmarking::{list_benchmark, Benchmarking, BenchmarkList}; + use frame_benchmarking::{baseline, Benchmarking, BenchmarkList}; use frame_support::traits::StorageInfoTrait; + use frame_system_benchmarking::Pallet as SystemBench; + use baseline::Pallet as BaselineBench; let mut list = Vec::::new(); - list_benchmark!(list, extra, xpallet_gateway_records, XGatewayRecords); - list_benchmark!(list, extra, xpallet_gateway_common, XGatewayCommon); - list_benchmark!(list, extra, xpallet_gateway_bitcoin, XGatewayBitcoin); + list_benchmarks!(list, extra); let storage_info = AllPalletsWithSystem::storage_info(); @@ -1331,10 +1400,13 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey}; + use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, TrackedStorageKey}; use frame_system_benchmarking::Pallet as SystemBench; + use baseline::Pallet as BaselineBench; + impl frame_system_benchmarking::Config for Runtime {} + impl baseline::Config for Runtime {} let whitelist: Vec = vec![ // Block Number @@ -1352,12 +1424,25 @@ impl_runtime_apis! { let mut batches = Vec::::new(); let params = (&config, &whitelist); - add_benchmark!(params, batches, xpallet_gateway_records, XGatewayRecords); - add_benchmark!(params, batches, xpallet_gateway_common, XGatewayCommon); - add_benchmark!(params, batches, xpallet_gateway_bitcoin, XGatewayBitcoin); + add_benchmarks!(params, batches); if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } Ok(batches) } } + + #[cfg(feature = "try-runtime")] + impl frame_try_runtime::TryRuntime for Runtime { + fn on_runtime_upgrade() -> (Weight, Weight) { + // NOTE: intentional unwrap: we don't want to propagate the error backwards, and want to + // have a backtrace here. If any of the pre/post migration checks fail, we shall stop + // right here and right now. + let weight = Executive::try_runtime_upgrade().unwrap(); + (weight, BlockWeights::get().max_block) + } + + fn execute_block_no_check(block: Block) -> Weight { + Executive::execute_block_no_check(block) + } + } } diff --git a/scripts/try-runtime.txt b/scripts/try-runtime.txt new file mode 100644 index 00000000..fbfed16f --- /dev/null +++ b/scripts/try-runtime.txt @@ -0,0 +1,3 @@ +./sherpax-old --dev --tmp --ws-port 9944 --ws-max-out-buffer-capacity 1000 --rpc-max-payload 1000 --rpc-cors all + +./sherpax-new try-runtime --no-spec-name-check on-runtime-upgrade live -u ws://127.0.0.1:9944 diff --git a/xpallets/assets-bridge/Cargo.toml b/xpallets/assets-bridge/Cargo.toml index 5b25a536..cdfec35f 100644 --- a/xpallets/assets-bridge/Cargo.toml +++ b/xpallets/assets-bridge/Cargo.toml @@ -1,40 +1,36 @@ [package] name = "pallet-assets-bridge" -version = "1.1.0" +version = "1.3.0" authors = ["ChainX Developers"] -edition = "2018" - +edition = "2021" [dependencies] -serde = { version = "1.0.119", optional = true } -codec = { package = "parity-scale-codec", version = "2.3.1", default-features = false } -libsecp256k1 = { version = "0.6", default-features = false, features = ["hmac", "static-context"], optional = true } -scale-info = { version = "1.0", default-features = false, features = ["derive"] } +serde = { version = "1.0.136", optional = true } +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false } +scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } pallet-assets = { path = "../assets", default-features = false } -pallet-evm = { git = "https://github.com/chainx-org/frontier", branch = "new-polkadot-v0.9.11", default-features = false } +pallet-evm = { git = "https://github.com/chainx-org/frontier", branch = "polkadot-v0.9.18", default-features = false } [dev-dependencies] -ethabi = { version = "15.0.0" } +ethabi = { version = "17.0.0" } hex-literal = { version = "0.3.1" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } [features] default = ["std"] std = [ "serde", "codec/std", - "libsecp256k1", - "libsecp256k1/std", "scale-info/std", "sp-core/std", @@ -47,3 +43,4 @@ std = [ "pallet-assets/std", "pallet-evm/std", ] +try-runtime = ["frame-support/try-runtime"] diff --git a/xpallets/assets-bridge/src/lib.rs b/xpallets/assets-bridge/src/lib.rs index 95c32d18..89e0b936 100644 --- a/xpallets/assets-bridge/src/lib.rs +++ b/xpallets/assets-bridge/src/lib.rs @@ -55,6 +55,11 @@ pub mod pallet { use frame_support::traits::ReservableCurrency; use frame_system::pallet_prelude::*; + #[pallet::pallet] + #[pallet::generate_store(pub(super) trait Store)] + #[pallet::without_storage_info] + pub struct Pallet(_); + #[pallet::config] pub trait Config: frame_system::Config + pallet_assets::Config + pallet_evm::Config { /// The overarching event type. @@ -200,9 +205,6 @@ pub mod pallet { ZeroBalance, } - #[pallet::pallet] - pub struct Pallet(_); - #[pallet::call] impl Pallet where @@ -625,6 +627,7 @@ where None, None, Vec::new(), + false, T::config(), )?; diff --git a/xpallets/assets-bridge/src/mock.rs b/xpallets/assets-bridge/src/mock.rs index a6d3052f..bad02fd9 100644 --- a/xpallets/assets-bridge/src/mock.rs +++ b/xpallets/assets-bridge/src/mock.rs @@ -1,6 +1,7 @@ pub use crate as assets_bridge; pub use assets_bridge::{Config, Error, Event as AssetsBridgeEvent}; +use frame_support::traits::ConstU32; use frame_support::{parameter_types, traits::GenesisBuild}; use frame_system as system; use sp_core::{H160, H256}; @@ -58,6 +59,7 @@ impl system::Config for Test { type SystemWeightInfo = (); type SS58Prefix = SS58Prefix; type OnSetCode = (); + type MaxConsumers = ConstU32<5>; } parameter_types! { @@ -110,6 +112,7 @@ impl pallet_assets::Config for Test { type Freezer = (); type WeightInfo = (); type Extra = (); + type AssetAccountDeposit = (); } impl pallet_evm::Config for Test { @@ -128,6 +131,7 @@ impl pallet_evm::Config for Test { type OnChargeTransaction = (); type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; type FindAuthor = (); + type WeightInfo = (); } impl assets_bridge::Config for Test { diff --git a/xpallets/assets-bridge/src/tests.rs b/xpallets/assets-bridge/src/tests.rs index 26285bfe..6d8bebde 100644 --- a/xpallets/assets-bridge/src/tests.rs +++ b/xpallets/assets-bridge/src/tests.rs @@ -40,7 +40,7 @@ pub fn mint_into_abi() -> Function { }, ], outputs: vec![], - constant: false, + constant: Some(false), state_mutability: Default::default(), } } @@ -62,7 +62,7 @@ pub fn burn_from_abi() -> Function { }, ], outputs: vec![], - constant: false, + constant: Some(false), state_mutability: Default::default(), } } @@ -93,7 +93,7 @@ fn test_to_ascii_hex() { #[test] fn recover_eth_address() { new_test_ext().execute_with(|| { - let s = EcdsaSignature::from_slice(&SIGNATURE); + let s = EcdsaSignature::from_slice(&SIGNATURE).unwrap(); let p = PUBKEY.as_bytes(); let address = crate::eth_recover(&s, p, &[][..]).unwrap(); diff --git a/xpallets/assets/Cargo.toml b/xpallets/assets/Cargo.toml index 84d522ae..e9362032 100644 --- a/xpallets/assets/Cargo.toml +++ b/xpallets/assets/Cargo.toml @@ -2,7 +2,7 @@ name = "pallet-assets" version = "4.0.0-dev" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" license = "Apache-2.0" homepage = "https://substrate.io" repository = "https://github.com/paritytech/substrate/" @@ -13,37 +13,38 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } -scale-info = { version = "1.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false } +scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } # Needed for various traits. In our case, `OnFinalize`. -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } # Needed for type-safe access to storage DB. -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } # `system` module provides us with all sorts of useful stuff and macros depend on it being around. -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false, optional = true } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false, optional = true } [dev-dependencies] -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } [features] default = ["std"] std = [ - "codec/std", - "scale-info/std", - "sp-std/std", - "sp-runtime/std", - "frame-support/std", - "frame-system/std", - "frame-benchmarking/std", + "codec/std", + "scale-info/std", + "sp-std/std", + "sp-runtime/std", + "frame-support/std", + "frame-system/std", + "frame-benchmarking/std", ] runtime-benchmarks = [ - "frame-benchmarking", - "sp-runtime/runtime-benchmarks", - "frame-system/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "frame-system/runtime-benchmarks", ] try-runtime = ["frame-support/try-runtime"] diff --git a/xpallets/assets/README.md b/xpallets/assets/README.md index a99b60fa..aae52449 100644 --- a/xpallets/assets/README.md +++ b/xpallets/assets/README.md @@ -69,35 +69,43 @@ Import the Assets module and types and derive your runtime's configuration trait ```rust use pallet_assets as assets; -use frame_support::{decl_module, dispatch, ensure}; -use frame_system::ensure_signed; use sp_runtime::ArithmeticError; -pub trait Config: assets::Config { } +#[frame_support::pallet] +pub mod pallet { + use super::*; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::*; -decl_module! { - pub struct Module for enum Call where origin: T::Origin { - pub fn issue_token_airdrop(origin) -> dispatch::DispatchResult { - let sender = ensure_signed(origin).map_err(|e| e.as_str())?; + #[pallet::pallet] + pub struct Pallet(_); - const ACCOUNT_ALICE: u64 = 1; - const ACCOUNT_BOB: u64 = 2; - const COUNT_AIRDROP_RECIPIENTS: u64 = 2; - const TOKENS_FIXED_SUPPLY: u64 = 100; + #[pallet::config] + pub trait Config: frame_system::Config + assets::Config {} - ensure!(!COUNT_AIRDROP_RECIPIENTS.is_zero(), ArithmeticError::DivisionByZero); + #[pallet::call] + impl Pallet { + pub fn issue_token_airdrop(origin: OriginFor) -> DispatchResult { + let sender = ensure_signed(origin)?; - let asset_id = Self::next_asset_id(); + const ACCOUNT_ALICE: u64 = 1; + const ACCOUNT_BOB: u64 = 2; + const COUNT_AIRDROP_RECIPIENTS: u64 = 2; + const TOKENS_FIXED_SUPPLY: u64 = 100; - >::mutate(|asset_id| *asset_id += 1); - >::insert((asset_id, &ACCOUNT_ALICE), TOKENS_FIXED_SUPPLY / COUNT_AIRDROP_RECIPIENTS); - >::insert((asset_id, &ACCOUNT_BOB), TOKENS_FIXED_SUPPLY / COUNT_AIRDROP_RECIPIENTS); - >::insert(asset_id, TOKENS_FIXED_SUPPLY); + ensure!(!COUNT_AIRDROP_RECIPIENTS.is_zero(), ArithmeticError::DivisionByZero); - Self::deposit_event(RawEvent::Issued(asset_id, sender, TOKENS_FIXED_SUPPLY)); - Ok(()) - } - } + let asset_id = Self::next_asset_id(); + + >::mutate(|asset_id| *asset_id += 1); + >::insert((asset_id, &ACCOUNT_ALICE), TOKENS_FIXED_SUPPLY / COUNT_AIRDROP_RECIPIENTS); + >::insert((asset_id, &ACCOUNT_BOB), TOKENS_FIXED_SUPPLY / COUNT_AIRDROP_RECIPIENTS); + >::insert(asset_id, TOKENS_FIXED_SUPPLY); + + Self::deposit_event(Event::Issued(asset_id, sender, TOKENS_FIXED_SUPPLY)); + Ok(()) + } + } } ``` diff --git a/xpallets/assets/src/benchmarking.rs b/xpallets/assets/src/benchmarking.rs index cce5741c..1e489d7b 100644 --- a/xpallets/assets/src/benchmarking.rs +++ b/xpallets/assets/src/benchmarking.rs @@ -1,13 +1,13 @@ // This file is part of Substrate. -// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd. +// Copyright (C) 2020-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 +// 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, @@ -155,7 +155,7 @@ benchmarks_instance_pallet! { T::Currency::make_free_balance_be(&caller, DepositBalanceOf::::max_value()); }: _(SystemOrigin::Signed(caller.clone()), Default::default(), caller_lookup, 1u32.into()) verify { - assert_last_event::(Event::Created(Default::default(), caller.clone(), caller).into()); + assert_last_event::(Event::Created { asset_id: Default::default(), creator: caller.clone(), owner: caller }.into()); } force_create { @@ -163,7 +163,7 @@ benchmarks_instance_pallet! { let caller_lookup = T::Lookup::unlookup(caller.clone()); }: _(SystemOrigin::Root, Default::default(), caller_lookup, true, 1u32.into()) verify { - assert_last_event::(Event::ForceCreated(Default::default(), caller).into()); + assert_last_event::(Event::ForceCreated { asset_id: Default::default(), owner: caller }.into()); } destroy { @@ -177,7 +177,7 @@ benchmarks_instance_pallet! { let witness = Asset::::get(T::AssetId::default()).unwrap().destroy_witness(); }: _(SystemOrigin::Signed(caller), Default::default(), witness) verify { - assert_last_event::(Event::Destroyed(Default::default()).into()); + assert_last_event::(Event::Destroyed { asset_id: Default::default() }.into()); } mint { @@ -185,7 +185,7 @@ benchmarks_instance_pallet! { let amount = T::Balance::from(100u32); }: _(SystemOrigin::Signed(caller.clone()), Default::default(), caller_lookup, amount) verify { - assert_last_event::(Event::Issued(Default::default(), caller, amount).into()); + assert_last_event::(Event::Issued { asset_id: Default::default(), owner: caller, total_supply: amount }.into()); } burn { @@ -193,7 +193,7 @@ benchmarks_instance_pallet! { let (caller, caller_lookup) = create_default_minted_asset::(true, amount); }: _(SystemOrigin::Signed(caller.clone()), Default::default(), caller_lookup, amount) verify { - assert_last_event::(Event::Burned(Default::default(), caller, amount).into()); + assert_last_event::(Event::Burned { asset_id: Default::default(), owner: caller, balance: amount }.into()); } transfer { @@ -203,7 +203,7 @@ benchmarks_instance_pallet! { let target_lookup = T::Lookup::unlookup(target.clone()); }: _(SystemOrigin::Signed(caller.clone()), Default::default(), target_lookup, amount) verify { - assert_last_event::(Event::Transferred(Default::default(), caller, target, amount).into()); + assert_last_event::(Event::Transferred { asset_id: Default::default(), from: caller, to: target, amount }.into()); } transfer_keep_alive { @@ -215,7 +215,7 @@ benchmarks_instance_pallet! { }: _(SystemOrigin::Signed(caller.clone()), Default::default(), target_lookup, amount) verify { assert!(frame_system::Pallet::::account_exists(&caller)); - assert_last_event::(Event::Transferred(Default::default(), caller, target, amount).into()); + assert_last_event::(Event::Transferred { asset_id: Default::default(), from: caller, to: target, amount }.into()); } force_transfer { @@ -226,7 +226,7 @@ benchmarks_instance_pallet! { }: _(SystemOrigin::Signed(caller.clone()), Default::default(), caller_lookup, target_lookup, amount) verify { assert_last_event::( - Event::Transferred(Default::default(), caller, target, amount).into() + Event::Transferred { asset_id: Default::default(), from: caller, to: target, amount }.into() ); } @@ -234,7 +234,7 @@ benchmarks_instance_pallet! { let (caller, caller_lookup) = create_default_minted_asset::(true, 100u32.into()); }: _(SystemOrigin::Signed(caller.clone()), Default::default(), caller_lookup) verify { - assert_last_event::(Event::Frozen(Default::default(), caller).into()); + assert_last_event::(Event::Frozen { asset_id: Default::default(), who: caller }.into()); } thaw { @@ -246,14 +246,14 @@ benchmarks_instance_pallet! { )?; }: _(SystemOrigin::Signed(caller.clone()), Default::default(), caller_lookup) verify { - assert_last_event::(Event::Thawed(Default::default(), caller).into()); + assert_last_event::(Event::Thawed { asset_id: Default::default(), who: caller }.into()); } freeze_asset { let (caller, caller_lookup) = create_default_minted_asset::(true, 100u32.into()); }: _(SystemOrigin::Signed(caller.clone()), Default::default()) verify { - assert_last_event::(Event::AssetFrozen(Default::default()).into()); + assert_last_event::(Event::AssetFrozen { asset_id: Default::default() }.into()); } thaw_asset { @@ -264,7 +264,7 @@ benchmarks_instance_pallet! { )?; }: _(SystemOrigin::Signed(caller.clone()), Default::default()) verify { - assert_last_event::(Event::AssetThawed(Default::default()).into()); + assert_last_event::(Event::AssetThawed { asset_id: Default::default() }.into()); } transfer_ownership { @@ -273,7 +273,7 @@ benchmarks_instance_pallet! { let target_lookup = T::Lookup::unlookup(target.clone()); }: _(SystemOrigin::Signed(caller), Default::default(), target_lookup) verify { - assert_last_event::(Event::OwnerChanged(Default::default(), target).into()); + assert_last_event::(Event::OwnerChanged { asset_id: Default::default(), owner: target }.into()); } set_team { @@ -283,12 +283,12 @@ benchmarks_instance_pallet! { let target2 = T::Lookup::unlookup(account("target", 2, SEED)); }: _(SystemOrigin::Signed(caller), Default::default(), target0.clone(), target1.clone(), target2.clone()) verify { - assert_last_event::(Event::TeamChanged( - Default::default(), - account("target", 0, SEED), - account("target", 1, SEED), - account("target", 2, SEED), - ).into()); + assert_last_event::(Event::TeamChanged { + asset_id: Default::default(), + issuer: account("target", 0, SEED), + admin: account("target", 1, SEED), + freezer: account("target", 2, SEED), + }.into()); } set_metadata { @@ -304,7 +304,7 @@ benchmarks_instance_pallet! { }: _(SystemOrigin::Signed(caller), Default::default(), name.clone(), symbol.clone(), decimals) verify { let id = Default::default(); - assert_last_event::(Event::MetadataSet(id, name, symbol, decimals, false).into()); + assert_last_event::(Event::MetadataSet { asset_id: id, name, symbol, decimals, is_frozen: false }.into()); } clear_metadata { @@ -315,7 +315,7 @@ benchmarks_instance_pallet! { Assets::::set_metadata(origin, Default::default(), dummy.clone(), dummy, 12)?; }: _(SystemOrigin::Signed(caller), Default::default()) verify { - assert_last_event::(Event::MetadataCleared(Default::default()).into()); + assert_last_event::(Event::MetadataCleared { asset_id: Default::default() }.into()); } force_set_metadata { @@ -339,7 +339,7 @@ benchmarks_instance_pallet! { }: { call.dispatch_bypass_filter(origin)? } verify { let id = Default::default(); - assert_last_event::(Event::MetadataSet(id, name, symbol, decimals, false).into()); + assert_last_event::(Event::MetadataSet { asset_id: id, name, symbol, decimals, is_frozen: false }.into()); } force_clear_metadata { @@ -353,7 +353,7 @@ benchmarks_instance_pallet! { let call = Call::::force_clear_metadata { id: Default::default() }; }: { call.dispatch_bypass_filter(origin)? } verify { - assert_last_event::(Event::MetadataCleared(Default::default()).into()); + assert_last_event::(Event::MetadataCleared { asset_id: Default::default() }.into()); } force_asset_status { @@ -372,7 +372,7 @@ benchmarks_instance_pallet! { }; }: { call.dispatch_bypass_filter(origin)? } verify { - assert_last_event::(Event::AssetStatusChanged(Default::default()).into()); + assert_last_event::(Event::AssetStatusChanged { asset_id: Default::default() }.into()); } approve_transfer { @@ -385,7 +385,7 @@ benchmarks_instance_pallet! { let amount = 100u32.into(); }: _(SystemOrigin::Signed(caller.clone()), id, delegate_lookup, amount) verify { - assert_last_event::(Event::ApprovedTransfer(id, caller, delegate, amount).into()); + assert_last_event::(Event::ApprovedTransfer { asset_id: id, source: caller, delegate, amount }.into()); } transfer_approved { @@ -405,7 +405,7 @@ benchmarks_instance_pallet! { }: _(SystemOrigin::Signed(delegate.clone()), id, owner_lookup, dest_lookup, amount) verify { assert!(T::Currency::reserved_balance(&owner).is_zero()); - assert_event::(Event::Transferred(id, owner, dest, amount).into()); + assert_event::(Event::Transferred { asset_id: id, from: owner, to: dest, amount }.into()); } cancel_approval { @@ -420,7 +420,7 @@ benchmarks_instance_pallet! { Assets::::approve_transfer(origin, id, delegate_lookup.clone(), amount)?; }: _(SystemOrigin::Signed(caller.clone()), id, delegate_lookup) verify { - assert_last_event::(Event::ApprovalCancelled(id, caller, delegate).into()); + assert_last_event::(Event::ApprovalCancelled { asset_id: id, owner: caller, delegate }.into()); } force_cancel_approval { @@ -435,8 +435,8 @@ benchmarks_instance_pallet! { Assets::::approve_transfer(origin, id, delegate_lookup.clone(), amount)?; }: _(SystemOrigin::Signed(caller.clone()), id, caller_lookup, delegate_lookup) verify { - assert_last_event::(Event::ApprovalCancelled(id, caller, delegate).into()); + assert_last_event::(Event::ApprovalCancelled { asset_id: id, owner: caller, delegate }.into()); } - // impl_benchmark_test_suite!(Assets, crate::mock::new_test_ext(), crate::mock::Test) + impl_benchmark_test_suite!(Assets, crate::mock::new_test_ext(), crate::mock::Test) } diff --git a/xpallets/assets/src/extra_mutator.rs b/xpallets/assets/src/extra_mutator.rs index 81dbbc5b..64c60f38 100644 --- a/xpallets/assets/src/extra_mutator.rs +++ b/xpallets/assets/src/extra_mutator.rs @@ -1,13 +1,13 @@ // This file is part of Substrate. -// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd. +// Copyright (C) 2017-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 +// 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, @@ -65,11 +65,11 @@ impl, I: 'static> ExtraMutator { id: T::AssetId, who: impl sp_std::borrow::Borrow, ) -> Option> { - if Account::::contains_key(id, who.borrow()) { + if let Some(a) = Account::::get(id, who.borrow()) { Some(ExtraMutator:: { id, who: who.borrow().clone(), - original: Account::::get(id, who.borrow()).extra, + original: a.extra, pending: None, }) } else { @@ -80,13 +80,11 @@ impl, I: 'static> ExtraMutator { /// Commit any changes to storage. pub fn commit(&mut self) -> Result<(), ()> { if let Some(extra) = self.pending.take() { - Account::::try_mutate_exists(self.id, self.who.borrow(), |maybe_account| { - if let Some(ref mut account) = maybe_account { - account.extra = extra; - Ok(()) - } else { - Err(()) - } + Account::::try_mutate(self.id, self.who.borrow(), |maybe_account| { + maybe_account + .as_mut() + .ok_or(()) + .map(|account| account.extra = extra) }) } else { Ok(()) @@ -96,13 +94,11 @@ impl, I: 'static> ExtraMutator { /// Revert any changes, even those already committed by `self` and drop self. pub fn revert(mut self) -> Result<(), ()> { self.pending = None; - Account::::try_mutate_exists(self.id, self.who.borrow(), |maybe_account| { - if let Some(ref mut account) = maybe_account { - account.extra = self.original.clone(); - Ok(()) - } else { - Err(()) - } + Account::::try_mutate(self.id, self.who.borrow(), |maybe_account| { + maybe_account + .as_mut() + .ok_or(()) + .map(|account| account.extra = self.original.clone()) }) } } diff --git a/xpallets/assets/src/functions.rs b/xpallets/assets/src/functions.rs index 5fd02686..f6853a27 100644 --- a/xpallets/assets/src/functions.rs +++ b/xpallets/assets/src/functions.rs @@ -1,13 +1,13 @@ // This file is part of Substrate. -// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd. +// Copyright (C) 2017-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 +// 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, @@ -20,6 +20,14 @@ use super::*; use frame_support::{traits::Get, BoundedVec}; +#[must_use] +pub(super) enum DeadConsequence { + Remove, + Keep, +} + +use DeadConsequence::*; + // The main implementation block for the module. impl, I: 'static> Pallet { // Public immutables @@ -32,49 +40,67 @@ impl, I: 'static> Pallet { ExtraMutator::maybe_new(id, who) } - /// Get the asset `id` balance of `who`. + /// Get the asset `id` balance of `who`, or zero if the asset-account doesn't exist. pub fn balance(id: T::AssetId, who: impl sp_std::borrow::Borrow) -> T::Balance { - Account::::get(id, who.borrow()).balance + Self::maybe_balance(id, who).unwrap_or_default() + } + + /// Get the asset `id` balance of `who` if the asset-account exists. + pub fn maybe_balance( + id: T::AssetId, + who: impl sp_std::borrow::Borrow, + ) -> Option { + Account::::get(id, who.borrow()).map(|a| a.balance) } /// Get the total supply of an asset `id`. pub fn total_supply(id: T::AssetId) -> T::Balance { - Asset::::get(id) - .map(|x| x.supply) - .unwrap_or_else(Zero::zero) + Self::maybe_total_supply(id).unwrap_or_default() + } + + /// Get the total supply of an asset `id` if the asset exists. + pub fn maybe_total_supply(id: T::AssetId) -> Option { + Asset::::get(id).map(|x| x.supply) } pub(super) fn new_account( who: &T::AccountId, d: &mut AssetDetails>, - ) -> Result { + maybe_deposit: Option>, + ) -> Result>, DispatchError> { let accounts = d.accounts.checked_add(1).ok_or(ArithmeticError::Overflow)?; - let is_sufficient = if d.is_sufficient { + let reason = if let Some(deposit) = maybe_deposit { + ExistenceReason::DepositHeld(deposit) + } else if d.is_sufficient { frame_system::Pallet::::inc_sufficients(who); d.sufficients += 1; - true + ExistenceReason::Sufficient } else { frame_system::Pallet::::inc_consumers(who).map_err(|_| Error::::NoProvider)?; - false + ExistenceReason::Consumer }; d.accounts = accounts; - Ok(is_sufficient) + Ok(reason) } pub(super) fn dead_account( - what: T::AssetId, who: &T::AccountId, d: &mut AssetDetails>, - sufficient: bool, - ) { - if sufficient { - d.sufficients = d.sufficients.saturating_sub(1); - frame_system::Pallet::::dec_sufficients(who); - } else { - frame_system::Pallet::::dec_consumers(who); + reason: &ExistenceReason>, + force: bool, + ) -> DeadConsequence { + match *reason { + ExistenceReason::Consumer => frame_system::Pallet::::dec_consumers(who), + ExistenceReason::Sufficient => { + d.sufficients = d.sufficients.saturating_sub(1); + frame_system::Pallet::::dec_sufficients(who); + } + ExistenceReason::DepositRefunded => {} + ExistenceReason::DepositHeld(_) if !force => return Keep, + ExistenceReason::DepositHeld(_) => {} } d.accounts = d.accounts.saturating_sub(1); - T::Freezer::died(what, who) + Remove } pub(super) fn can_increase( @@ -89,15 +115,15 @@ impl, I: 'static> Pallet { if details.supply.checked_add(&amount).is_none() { return DepositConsequence::Overflow; } - let account = Account::::get(id, who); - if account.balance.checked_add(&amount).is_none() { - return DepositConsequence::Overflow; - } - if account.balance.is_zero() { + if let Some(balance) = Self::maybe_balance(id, who) { + if balance.checked_add(&amount).is_none() { + return DepositConsequence::Overflow; + } + } else { if amount < details.min_balance { return DepositConsequence::BelowMinimum; } - if !details.is_sufficient && frame_system::Pallet::::providers(who) == 0 { + if !details.is_sufficient && !frame_system::Pallet::::can_inc_consumer(who) { return DepositConsequence::CannotCreate; } if details.is_sufficient && details.sufficients.checked_add(1).is_none() { @@ -126,7 +152,13 @@ impl, I: 'static> Pallet { if details.is_frozen { return Frozen; } - let account = Account::::get(id, who); + if amount.is_zero() { + return Success; + } + let account = match Account::::get(id, who) { + Some(a) => a, + None => return NoFunds, + }; if account.is_frozen { return Frozen; } @@ -167,7 +199,7 @@ impl, I: 'static> Pallet { let details = Asset::::get(id).ok_or_else(|| Error::::Unknown)?; ensure!(!details.is_frozen, Error::::Frozen); - let account = Account::::get(id, who); + let account = Account::::get(id, who).ok_or(Error::::NoAccount)?; ensure!(!account.is_frozen, Error::::Frozen); let amount = if let Some(frozen) = T::Freezer::frozen_balance(id, who) { @@ -256,6 +288,59 @@ impl, I: 'static> Pallet { Ok((credit, maybe_burn)) } + /// Creates a account for `who` to hold asset `id` with a zero balance and takes a deposit. + pub(super) fn do_touch(id: T::AssetId, who: T::AccountId) -> DispatchResult { + ensure!( + !Account::::contains_key(id, &who), + Error::::AlreadyExists + ); + let deposit = T::AssetAccountDeposit::get(); + let mut details = Asset::::get(&id).ok_or(Error::::Unknown)?; + let reason = Self::new_account(&who, &mut details, Some(deposit))?; + T::Currency::reserve(&who, deposit)?; + Asset::::insert(&id, details); + Account::::insert( + id, + &who, + AssetAccountOf:: { + balance: Zero::zero(), + is_frozen: false, + reason, + extra: T::Extra::default(), + }, + ); + Ok(()) + } + + /// Returns a deposit, destroying an asset-account. + pub(super) fn do_refund(id: T::AssetId, who: T::AccountId, allow_burn: bool) -> DispatchResult { + let mut account = Account::::get(id, &who).ok_or(Error::::NoDeposit)?; + let deposit = account + .reason + .take_deposit() + .ok_or(Error::::NoDeposit)?; + let mut details = Asset::::get(&id).ok_or(Error::::Unknown)?; + + ensure!( + account.balance.is_zero() || allow_burn, + Error::::WouldBurn + ); + ensure!(!details.is_frozen, Error::::Frozen); + ensure!(!account.is_frozen, Error::::Frozen); + + T::Currency::unreserve(&who, deposit); + + if let Remove = Self::dead_account(&who, &mut details, &account.reason, false) { + Account::::remove(id, &who); + } else { + debug_assert!(false, "refund did not result in dead account?!"); + } + Asset::::insert(&id, details); + // Executing a hook here is safe, since it is not in a `mutate`. + T::Freezer::died(id, &who); + Ok(()) + } + /// Increases the asset `id` balance of `beneficiary` by `amount`. /// /// This alters the registered supply of the asset and emits an event. @@ -281,7 +366,11 @@ impl, I: 'static> Pallet { details.supply = details.supply.saturating_add(amount); Ok(()) })?; - Self::deposit_event(Event::Issued(id, beneficiary.clone(), amount)); + Self::deposit_event(Event::Issued { + asset_id: id, + owner: beneficiary.clone(), + total_supply: amount, + }); Ok(()) } @@ -309,13 +398,22 @@ impl, I: 'static> Pallet { check(details)?; - Account::::try_mutate(id, beneficiary, |t| -> DispatchResult { - let new_balance = t.balance.saturating_add(amount); - ensure!(new_balance >= details.min_balance, TokenError::BelowMinimum); - if t.balance.is_zero() { - t.sufficient = Self::new_account(beneficiary, details)?; + Account::::try_mutate(id, beneficiary, |maybe_account| -> DispatchResult { + match maybe_account { + Some(ref mut account) => { + account.balance.saturating_accrue(amount); + } + maybe_account @ None => { + // Note this should never fail as it's already checked by `can_increase`. + ensure!(amount >= details.min_balance, TokenError::BelowMinimum); + *maybe_account = Some(AssetAccountOf:: { + balance: amount, + reason: Self::new_account(beneficiary, details, None)?, + is_frozen: false, + extra: T::Extra::default(), + }); + } } - t.balance = new_balance; Ok(()) })?; Ok(()) @@ -348,7 +446,11 @@ impl, I: 'static> Pallet { Ok(()) })?; - Self::deposit_event(Event::Burned(id, target.clone(), actual)); + Self::deposit_event(Event::Burned { + asset_id: id, + owner: target.clone(), + balance: actual, + }); Ok(actual) } @@ -375,31 +477,42 @@ impl, I: 'static> Pallet { } let actual = Self::prep_debit(id, target, amount, f)?; + let mut target_died: Option = None; Asset::::try_mutate(id, |maybe_details| -> DispatchResult { - let details = maybe_details.as_mut().ok_or(Error::::Unknown)?; + let mut details = maybe_details.as_mut().ok_or(Error::::Unknown)?; check(actual, details)?; - Account::::try_mutate_exists(id, target, |maybe_account| -> DispatchResult { - let mut account = maybe_account.take().unwrap_or_default(); + Account::::try_mutate(id, target, |maybe_account| -> DispatchResult { + let mut account = maybe_account.take().ok_or(Error::::NoAccount)?; debug_assert!(account.balance >= actual, "checked in prep; qed"); // Make the debit. account.balance = account.balance.saturating_sub(actual); - *maybe_account = if account.balance < details.min_balance { + if account.balance < details.min_balance { debug_assert!(account.balance.is_zero(), "checked in prep; qed"); - Self::dead_account(id, target, details, account.sufficient); - None - } else { - Some(account) + target_died = Some(Self::dead_account( + target, + &mut details, + &account.reason, + false, + )); + if let Some(Remove) = target_died { + return Ok(()); + } }; + *maybe_account = Some(account); Ok(()) })?; Ok(()) })?; + // Execute hook outside of `mutate`. + if let Some(Remove) = target_died { + T::Freezer::died(id, target); + } Ok(actual) } @@ -419,17 +532,42 @@ impl, I: 'static> Pallet { maybe_need_admin: Option, f: TransferFlags, ) -> Result { + let (balance, died) = + Self::transfer_and_die(id, source, dest, amount, maybe_need_admin, f)?; + if let Some(Remove) = died { + T::Freezer::died(id, source); + } + Ok(balance) + } + + /// Same as `do_transfer` but it does not execute the `FrozenBalance::died` hook and + /// instead returns whether and how the `source` account died in this operation. + fn transfer_and_die( + id: T::AssetId, + source: &T::AccountId, + dest: &T::AccountId, + amount: T::Balance, + maybe_need_admin: Option, + f: TransferFlags, + ) -> Result<(T::Balance, Option), DispatchError> { // Early exist if no-op. if amount.is_zero() { - Self::deposit_event(Event::Transferred(id, source.clone(), dest.clone(), amount)); - return Ok(amount); + Self::deposit_event(Event::Transferred { + asset_id: id, + from: source.clone(), + to: dest.clone(), + amount, + }); + return Ok((amount, None)); } // Figure out the debit and credit, together with side-effects. let debit = Self::prep_debit(id, &source, amount, f.into())?; let (credit, maybe_burn) = Self::prep_credit(id, &dest, amount, debit, f.burn_dust)?; - let mut source_account = Account::::get(id, &source); + let mut source_account = + Account::::get(id, &source).ok_or(Error::::NoAccount)?; + let mut source_died: Option = None; Asset::::try_mutate(id, |maybe_details| -> DispatchResult { let details = maybe_details.as_mut().ok_or(Error::::Unknown)?; @@ -456,37 +594,54 @@ impl, I: 'static> Pallet { debug_assert!(source_account.balance >= debit, "checked in prep; qed"); source_account.balance = source_account.balance.saturating_sub(debit); - Account::::try_mutate(id, &dest, |a| -> DispatchResult { - // Calculate new balance; this will not saturate since it's already checked in prep. - debug_assert!( - a.balance.checked_add(&credit).is_some(), - "checked in prep; qed" - ); - let new_balance = a.balance.saturating_add(credit); - - // Create a new account if there wasn't one already. - if a.balance.is_zero() { - a.sufficient = Self::new_account(&dest, details)?; + Account::::try_mutate(id, &dest, |maybe_account| -> DispatchResult { + match maybe_account { + Some(ref mut account) => { + // Calculate new balance; this will not saturate since it's already checked + // in prep. + debug_assert!( + account.balance.checked_add(&credit).is_some(), + "checked in prep; qed" + ); + account.balance.saturating_accrue(credit); + } + maybe_account @ None => { + *maybe_account = Some(AssetAccountOf:: { + balance: credit, + is_frozen: false, + reason: Self::new_account(&dest, details, None)?, + extra: T::Extra::default(), + }); + } } - - a.balance = new_balance; Ok(()) })?; // Remove source account if it's now dead. if source_account.balance < details.min_balance { debug_assert!(source_account.balance.is_zero(), "checked in prep; qed"); - Self::dead_account(id, &source, details, source_account.sufficient); - Account::::remove(id, &source); - } else { - Account::::insert(id, &source, &source_account) + source_died = Some(Self::dead_account( + &source, + details, + &source_account.reason, + false, + )); + if let Some(Remove) = source_died { + Account::::remove(id, &source); + return Ok(()); + } } - + Account::::insert(id, &source, &source_account); Ok(()) })?; - Self::deposit_event(Event::Transferred(id, source.clone(), dest.clone(), credit)); - Ok(credit) + Self::deposit_event(Event::Transferred { + asset_id: id, + from: source.clone(), + to: dest.clone(), + amount: credit, + }); + Ok((credit, source_died)) } /// Create a new asset without taking a deposit. @@ -523,7 +678,10 @@ impl, I: 'static> Pallet { is_frozen: false, }, ); - Self::deposit_event(Event::ForceCreated(id, owner)); + Self::deposit_event(Event::ForceCreated { + asset_id: id, + owner, + }); Ok(()) } @@ -539,47 +697,62 @@ impl, I: 'static> Pallet { witness: DestroyWitness, maybe_check_owner: Option, ) -> Result { - Asset::::try_mutate_exists(id, |maybe_details| { - let mut details = maybe_details.take().ok_or(Error::::Unknown)?; - if let Some(check_owner) = maybe_check_owner { - ensure!(details.owner == check_owner, Error::::NoPermission); - } - ensure!( - details.accounts <= witness.accounts, - Error::::BadWitness - ); - ensure!( - details.sufficients <= witness.sufficients, - Error::::BadWitness - ); - ensure!( - details.approvals <= witness.approvals, - Error::::BadWitness - ); + let mut dead_accounts: Vec = vec![]; - for (who, v) in Account::::drain_prefix(id) { - Self::dead_account(id, &who, &mut details, v.sufficient); - } - debug_assert_eq!(details.accounts, 0); - debug_assert_eq!(details.sufficients, 0); + let result_witness: DestroyWitness = Asset::::try_mutate_exists( + id, + |maybe_details| -> Result { + let mut details = maybe_details.take().ok_or(Error::::Unknown)?; + if let Some(check_owner) = maybe_check_owner { + ensure!(details.owner == check_owner, Error::::NoPermission); + } + ensure!( + details.accounts <= witness.accounts, + Error::::BadWitness + ); + ensure!( + details.sufficients <= witness.sufficients, + Error::::BadWitness + ); + ensure!( + details.approvals <= witness.approvals, + Error::::BadWitness + ); - let metadata = Metadata::::take(&id); - T::Currency::unreserve( - &details.owner, - details.deposit.saturating_add(metadata.deposit), - ); + for (who, v) in Account::::drain_prefix(id) { + // We have to force this as it's destroying the entire asset class. + // This could mean that some accounts now have irreversibly reserved + // funds. + let _ = Self::dead_account(&who, &mut details, &v.reason, true); + dead_accounts.push(who); + } + debug_assert_eq!(details.accounts, 0); + debug_assert_eq!(details.sufficients, 0); - for ((owner, _), approval) in Approvals::::drain_prefix((&id,)) { - T::Currency::unreserve(&owner, approval.deposit); - } - Self::deposit_event(Event::Destroyed(id)); + let metadata = Metadata::::take(&id); + T::Currency::unreserve( + &details.owner, + details.deposit.saturating_add(metadata.deposit), + ); - Ok(DestroyWitness { - accounts: details.accounts, - sufficients: details.sufficients, - approvals: details.approvals, - }) - }) + for ((owner, _), approval) in Approvals::::drain_prefix((&id,)) { + T::Currency::unreserve(&owner, approval.deposit); + } + Self::deposit_event(Event::Destroyed { asset_id: id }); + + Ok(DestroyWitness { + accounts: details.accounts, + sufficients: details.sufficients, + approvals: details.approvals, + }) + }, + )?; + + // Execute hooks outside of `mutate`. + for who in dead_accounts { + T::Freezer::died(id, &who); + } + Ok(result_witness) } /// Creates an approval from `owner` to spend `amount` of asset `id` tokens by 'delegate' @@ -617,12 +790,12 @@ impl, I: 'static> Pallet { }, )?; Asset::::insert(id, d); - Self::deposit_event(Event::ApprovedTransfer( - id, - owner.clone(), - delegate.clone(), + Self::deposit_event(Event::ApprovedTransfer { + asset_id: id, + source: owner.clone(), + delegate: delegate.clone(), amount, - )); + }); Ok(()) } @@ -641,6 +814,8 @@ impl, I: 'static> Pallet { destination: &T::AccountId, amount: T::Balance, ) -> DispatchResult { + let mut owner_died: Option = None; + Approvals::::try_mutate_exists( (id, &owner, delegate), |maybe_approved| -> DispatchResult { @@ -655,7 +830,7 @@ impl, I: 'static> Pallet { best_effort: false, burn_dust: false, }; - Self::do_transfer(id, &owner, &destination, amount, None, f)?; + owner_died = Self::transfer_and_die(id, &owner, &destination, amount, None, f)?.1; if remaining.is_zero() { T::Currency::unreserve(&owner, approved.deposit); @@ -671,6 +846,11 @@ impl, I: 'static> Pallet { Ok(()) }, )?; + + // Execute hook outside of `mutate`. + if let Some(Remove) = owner_died { + T::Freezer::died(id, owner); + } Ok(()) } @@ -719,7 +899,13 @@ impl, I: 'static> Pallet { is_frozen: false, }); - Self::deposit_event(Event::MetadataSet(id, name, symbol, decimals, false)); + Self::deposit_event(Event::MetadataSet { + asset_id: id, + name, + symbol, + decimals, + is_frozen: false, + }); Ok(()) }) } diff --git a/xpallets/assets/src/impl_fungibles.rs b/xpallets/assets/src/impl_fungibles.rs index c045db8c..af95180e 100644 --- a/xpallets/assets/src/impl_fungibles.rs +++ b/xpallets/assets/src/impl_fungibles.rs @@ -1,13 +1,13 @@ // This file is part of Substrate. -// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd. +// Copyright (C) 2017-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 +// 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, @@ -64,6 +64,25 @@ impl, I: 'static> fungibles::Inspect<::AccountId } } +impl, I: 'static> fungibles::InspectMetadata<::AccountId> + for Pallet +{ + /// Return the name of an asset. + fn name(asset: &Self::AssetId) -> Vec { + Metadata::::get(asset).name.to_vec() + } + + /// Return the symbol of an asset. + fn symbol(asset: &Self::AssetId) -> Vec { + Metadata::::get(asset).symbol.to_vec() + } + + /// Return the decimals of an asset. + fn decimals(asset: &Self::AssetId) -> u8 { + Metadata::::get(asset).decimals + } +} + impl, I: 'static> fungibles::Mutate<::AccountId> for Pallet { fn mint_into( asset: Self::AssetId, @@ -194,3 +213,72 @@ impl, I: 'static> fungibles::Destroy for Pallet Self::do_destroy(id, witness, maybe_check_owner) } } + +impl, I: 'static> fungibles::metadata::Inspect<::AccountId> + for Pallet +{ + fn name(asset: T::AssetId) -> Vec { + Metadata::::get(asset).name.to_vec() + } + + fn symbol(asset: T::AssetId) -> Vec { + Metadata::::get(asset).symbol.to_vec() + } + + fn decimals(asset: T::AssetId) -> u8 { + Metadata::::get(asset).decimals + } +} + +impl, I: 'static> fungibles::metadata::Mutate<::AccountId> + for Pallet +{ + fn set( + asset: T::AssetId, + from: &::AccountId, + name: Vec, + symbol: Vec, + decimals: u8, + ) -> DispatchResult { + Self::do_set_metadata(asset, from, name, symbol, decimals) + } +} + +impl, I: 'static> fungibles::approvals::Inspect<::AccountId> + for Pallet +{ + // Check the amount approved to be spent by an owner to a delegate + fn allowance( + asset: T::AssetId, + owner: &::AccountId, + delegate: &::AccountId, + ) -> T::Balance { + Approvals::::get((asset, &owner, &delegate)) + .map(|x| x.amount) + .unwrap_or_else(Zero::zero) + } +} + +impl, I: 'static> fungibles::approvals::Mutate<::AccountId> + for Pallet +{ + fn approve( + asset: T::AssetId, + owner: &::AccountId, + delegate: &::AccountId, + amount: T::Balance, + ) -> DispatchResult { + Self::do_approve_transfer(asset, owner, delegate, amount) + } + + // Aprove spending tokens from a given account + fn transfer_from( + asset: T::AssetId, + owner: &::AccountId, + delegate: &::AccountId, + dest: &::AccountId, + amount: T::Balance, + ) -> DispatchResult { + Self::do_transfer_approved(asset, owner, delegate, dest, amount) + } +} diff --git a/xpallets/assets/src/impl_stored_map.rs b/xpallets/assets/src/impl_stored_map.rs index c627fc7a..afa26c08 100644 --- a/xpallets/assets/src/impl_stored_map.rs +++ b/xpallets/assets/src/impl_stored_map.rs @@ -1,13 +1,13 @@ // This file is part of Substrate. -// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd. +// Copyright (C) 2017-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 +// 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, @@ -22,11 +22,9 @@ use super::*; impl, I: 'static> StoredMap<(T::AssetId, T::AccountId), T::Extra> for Pallet { fn get(id_who: &(T::AssetId, T::AccountId)) -> T::Extra { let &(id, ref who) = id_who; - if Account::::contains_key(id, who) { - Account::::get(id, who).extra - } else { - Default::default() - } + Account::::get(id, who) + .map(|a| a.extra) + .unwrap_or_default() } fn try_mutate_exists>( @@ -34,13 +32,13 @@ impl, I: 'static> StoredMap<(T::AssetId, T::AccountId), T::Extra> f f: impl FnOnce(&mut Option) -> Result, ) -> Result { let &(id, ref who) = id_who; - let mut maybe_extra = Some(Account::::get(id, who).extra); + let mut maybe_extra = Account::::get(id, who).map(|a| a.extra); let r = f(&mut maybe_extra)?; // They want to write some value or delete it. // If the account existed and they want to write a value, then we write. // If the account didn't exist and they want to delete it, then we let it pass. // Otherwise, we fail. - Account::::try_mutate_exists(id, who, |maybe_account| { + Account::::try_mutate(id, who, |maybe_account| { if let Some(extra) = maybe_extra { // They want to write a value. Let this happen only if the account actually exists. if let Some(ref mut account) = maybe_account { diff --git a/xpallets/assets/src/lib.rs b/xpallets/assets/src/lib.rs index 56e6c582..bcaf0eeb 100644 --- a/xpallets/assets/src/lib.rs +++ b/xpallets/assets/src/lib.rs @@ -1,13 +1,13 @@ // This file is part of Substrate. -// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd. +// Copyright (C) 2017-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 +// 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, @@ -141,6 +141,15 @@ mod types; pub use types::*; use codec::HasCompact; +use scale_info::TypeInfo; +use sp_runtime::{ + traits::{ + AtLeast32BitUnsigned, Bounded, CheckedAdd, CheckedSub, Saturating, StaticLookup, Zero, + }, + ArithmeticError, TokenError, +}; +use sp_std::{borrow::Borrow, convert::TryInto, prelude::*}; + use frame_support::{ dispatch::{DispatchError, DispatchResult}, ensure, @@ -152,17 +161,6 @@ use frame_support::{ }, }; use frame_system::Config as SystemConfig; -use scale_info::TypeInfo; -use sp_runtime::{ - traits::{ - AtLeast32BitUnsigned, Bounded, CheckedAdd, CheckedSub, Saturating, StaticLookup, Zero, - }, - ArithmeticError, TokenError, -}; -use sp_std::{borrow::Borrow, convert::TryInto, prelude::*}; - -#[cfg(feature = "std")] -use frame_support::traits::GenesisBuild; pub use pallet::*; pub use weights::WeightInfo; @@ -170,12 +168,11 @@ pub use weights::WeightInfo; #[frame_support::pallet] pub mod pallet { use super::*; - use frame_support::{dispatch::DispatchResult, pallet_prelude::*}; + use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; #[pallet::pallet] #[pallet::generate_store(pub(super) trait Store)] - #[pallet::generate_storage_info] pub struct Pallet(_); #[pallet::config] @@ -215,6 +212,11 @@ pub mod pallet { #[pallet::constant] type AssetDeposit: Get>; + /// The amount of funds that must be reserved for a non-provider asset account to be + /// maintained. + #[pallet::constant] + type AssetAccountDeposit: Get>; + /// The basic amount of funds that must be reserved when adding metadata to your asset. #[pallet::constant] type MetadataDepositBase: Get>; @@ -253,15 +255,15 @@ pub mod pallet { >; #[pallet::storage] - /// The number of units of assets held by any given account. + /// The holdings of a specific account for a specific asset. pub(super) type Account, I: 'static = ()> = StorageDoubleMap< _, Blake2_128Concat, T::AssetId, Blake2_128Concat, T::AccountId, - AssetBalance, - ValueQuery, + AssetAccountOf, + OptionQuery, GetDefault, >; @@ -378,61 +380,106 @@ pub mod pallet { #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event, I: 'static = ()> { - /// Some asset class was created. \[asset_id, creator, owner\] - Created(T::AssetId, T::AccountId, T::AccountId), - /// Some assets were issued. \[asset_id, owner, total_supply\] - Issued(T::AssetId, T::AccountId, T::Balance), - /// Some assets were transferred. \[asset_id, from, to, amount\] - Transferred(T::AssetId, T::AccountId, T::AccountId, T::Balance), - /// Some assets were destroyed. \[asset_id, owner, balance\] - Burned(T::AssetId, T::AccountId, T::Balance), - /// The management team changed \[asset_id, issuer, admin, freezer\] - TeamChanged(T::AssetId, T::AccountId, T::AccountId, T::AccountId), - /// The owner changed \[asset_id, owner\] - OwnerChanged(T::AssetId, T::AccountId), - /// Some account `who` was frozen. \[asset_id, who\] - Frozen(T::AssetId, T::AccountId), - /// Some account `who` was thawed. \[asset_id, who\] - Thawed(T::AssetId, T::AccountId), - /// Some asset `asset_id` was frozen. \[asset_id\] - AssetFrozen(T::AssetId), - /// Some asset `asset_id` was thawed. \[asset_id\] - AssetThawed(T::AssetId), + /// Some asset class was created. + Created { + asset_id: T::AssetId, + creator: T::AccountId, + owner: T::AccountId, + }, + /// Some assets were issued. + Issued { + asset_id: T::AssetId, + owner: T::AccountId, + total_supply: T::Balance, + }, + /// Some assets were transferred. + Transferred { + asset_id: T::AssetId, + from: T::AccountId, + to: T::AccountId, + amount: T::Balance, + }, + /// Some assets were destroyed. + Burned { + asset_id: T::AssetId, + owner: T::AccountId, + balance: T::Balance, + }, + /// The management team changed. + TeamChanged { + asset_id: T::AssetId, + issuer: T::AccountId, + admin: T::AccountId, + freezer: T::AccountId, + }, + /// The owner changed. + OwnerChanged { + asset_id: T::AssetId, + owner: T::AccountId, + }, + /// Some account `who` was frozen. + Frozen { + asset_id: T::AssetId, + who: T::AccountId, + }, + /// Some account `who` was thawed. + Thawed { + asset_id: T::AssetId, + who: T::AccountId, + }, + /// Some asset `asset_id` was frozen. + AssetFrozen { asset_id: T::AssetId }, + /// Some asset `asset_id` was thawed. + AssetThawed { asset_id: T::AssetId }, /// An asset class was destroyed. - Destroyed(T::AssetId), - /// Some asset class was force-created. \[asset_id, owner\] - ForceCreated(T::AssetId, T::AccountId), - /// New metadata has been set for an asset. \[asset_id, name, symbol, decimals, is_frozen\] - MetadataSet(T::AssetId, Vec, Vec, u8, bool), - /// Metadata has been cleared for an asset. \[asset_id\] - MetadataCleared(T::AssetId), + Destroyed { asset_id: T::AssetId }, + /// Some asset class was force-created. + ForceCreated { + asset_id: T::AssetId, + owner: T::AccountId, + }, + /// New metadata has been set for an asset. + MetadataSet { + asset_id: T::AssetId, + name: Vec, + symbol: Vec, + decimals: u8, + is_frozen: bool, + }, + /// Metadata has been cleared for an asset. + MetadataCleared { asset_id: T::AssetId }, /// (Additional) funds have been approved for transfer to a destination account. - /// \[asset_id, source, delegate, amount\] - ApprovedTransfer(T::AssetId, T::AccountId, T::AccountId, T::Balance), + ApprovedTransfer { + asset_id: T::AssetId, + source: T::AccountId, + delegate: T::AccountId, + amount: T::Balance, + }, /// An approval for account `delegate` was cancelled by `owner`. - /// \[id, owner, delegate\] - ApprovalCancelled(T::AssetId, T::AccountId, T::AccountId), + ApprovalCancelled { + asset_id: T::AssetId, + owner: T::AccountId, + delegate: T::AccountId, + }, /// An `amount` was transferred in its entirety from `owner` to `destination` by /// the approved `delegate`. - /// \[id, owner, delegate, destination\] - TransferredApproved( - T::AssetId, - T::AccountId, - T::AccountId, - T::AccountId, - T::Balance, - ), + TransferredApproved { + asset_id: T::AssetId, + owner: T::AccountId, + delegate: T::AccountId, + destination: T::AccountId, + amount: T::Balance, + }, /// An asset has had its attributes changed by the `Force` origin. - /// \[id\] - AssetStatusChanged(T::AssetId), + AssetStatusChanged { asset_id: T::AssetId }, } #[pallet::error] pub enum Error { /// Account balance must be greater than or equal to the transfer amount. BalanceLow, - /// Balance should be non-zero. - BalanceZero, + /// The account to alter does not exist. + NoAccount, /// The signing account has no permission to do the operation. NoPermission, /// The given asset ID is unknown. @@ -445,8 +492,9 @@ pub mod pallet { BadWitness, /// Minimum balance should be non-zero. MinBalanceZero, - /// No provider reference exists to allow a non-zero balance of a non-self-sufficient - /// asset. + /// Unable to increment the consumer reference counters on the account. Either no provider + /// reference exists to allow a non-zero balance of a non-self-sufficient asset, or the + /// maximum number of consumers has been reached. NoProvider, /// Invalid metadata given. BadMetadata, @@ -454,6 +502,12 @@ pub mod pallet { Unapproved, /// The source account would not survive the transfer and it needs to stay alive. WouldDie, + /// The asset-account already exists. + AlreadyExists, + /// The asset-account doesn't have an associated deposit. + NoDeposit, + /// The operation would result in funds being burned. + WouldBurn, } #[pallet::call] @@ -510,7 +564,11 @@ pub mod pallet { is_frozen: false, }, ); - Self::deposit_event(Event::Created(id, owner, admin)); + Self::deposit_event(Event::Created { + asset_id: id, + creator: owner, + owner: admin, + }); Ok(()) } @@ -565,10 +623,10 @@ pub mod pallet { /// - `s = witness.sufficients` /// - `a = witness.approvals` #[pallet::weight(T::WeightInfo::destroy( - witness.accounts.saturating_sub(witness.sufficients), - witness.sufficients, - witness.approvals, - ))] + witness.accounts.saturating_sub(witness.sufficients), + witness.sufficients, + witness.approvals, + ))] pub fn destroy( origin: OriginFor, #[pallet::compact] id: T::AssetId, @@ -616,7 +674,7 @@ pub mod pallet { /// /// Origin must be Signed and the sender should be the Manager of the asset `id`. /// - /// Bails with `BalanceZero` if the `who` is already dead. + /// Bails with `NoAccount` if the `who` is already dead. /// /// - `id`: The identifier of the asset to have some amount burned. /// - `who`: The account to be debited from. @@ -777,14 +835,16 @@ pub mod pallet { let d = Asset::::get(id).ok_or(Error::::Unknown)?; ensure!(&origin == &d.freezer, Error::::NoPermission); let who = T::Lookup::lookup(who)?; - ensure!( - Account::::contains_key(id, &who), - Error::::BalanceZero - ); - Account::::mutate(id, &who, |a| a.is_frozen = true); + Account::::try_mutate(id, &who, |maybe_account| -> DispatchResult { + maybe_account + .as_mut() + .ok_or(Error::::NoAccount)? + .is_frozen = true; + Ok(()) + })?; - Self::deposit_event(Event::::Frozen(id, who)); + Self::deposit_event(Event::::Frozen { asset_id: id, who }); Ok(()) } @@ -809,14 +869,16 @@ pub mod pallet { let details = Asset::::get(id).ok_or(Error::::Unknown)?; ensure!(&origin == &details.admin, Error::::NoPermission); let who = T::Lookup::lookup(who)?; - ensure!( - Account::::contains_key(id, &who), - Error::::BalanceZero - ); - Account::::mutate(id, &who, |a| a.is_frozen = false); + Account::::try_mutate(id, &who, |maybe_account| -> DispatchResult { + maybe_account + .as_mut() + .ok_or(Error::::NoAccount)? + .is_frozen = false; + Ok(()) + })?; - Self::deposit_event(Event::::Thawed(id, who)); + Self::deposit_event(Event::::Thawed { asset_id: id, who }); Ok(()) } @@ -842,7 +904,7 @@ pub mod pallet { d.is_frozen = true; - Self::deposit_event(Event::::AssetFrozen(id)); + Self::deposit_event(Event::::AssetFrozen { asset_id: id }); Ok(()) }) } @@ -869,7 +931,7 @@ pub mod pallet { d.is_frozen = false; - Self::deposit_event(Event::::AssetThawed(id)); + Self::deposit_event(Event::::AssetThawed { asset_id: id }); Ok(()) }) } @@ -908,7 +970,10 @@ pub mod pallet { details.owner = owner.clone(); - Self::deposit_event(Event::OwnerChanged(id, owner)); + Self::deposit_event(Event::OwnerChanged { + asset_id: id, + owner, + }); Ok(()) }) } @@ -946,7 +1011,12 @@ pub mod pallet { details.admin = admin.clone(); details.freezer = freezer.clone(); - Self::deposit_event(Event::TeamChanged(id, issuer, admin, freezer)); + Self::deposit_event(Event::TeamChanged { + asset_id: id, + issuer, + admin, + freezer, + }); Ok(()) }) } @@ -1003,7 +1073,7 @@ pub mod pallet { Metadata::::try_mutate_exists(id, |metadata| { let deposit = metadata.take().ok_or(Error::::Unknown)?.deposit; T::Currency::unreserve(&d.owner, deposit); - Self::deposit_event(Event::MetadataCleared(id)); + Self::deposit_event(Event::MetadataCleared { asset_id: id }); Ok(()) }) } @@ -1054,7 +1124,13 @@ pub mod pallet { is_frozen, }); - Self::deposit_event(Event::MetadataSet(id, name, symbol, decimals, is_frozen)); + Self::deposit_event(Event::MetadataSet { + asset_id: id, + name, + symbol, + decimals, + is_frozen, + }); Ok(()) }) } @@ -1081,7 +1157,7 @@ pub mod pallet { Metadata::::try_mutate_exists(id, |metadata| { let deposit = metadata.take().ok_or(Error::::Unknown)?.deposit; T::Currency::unreserve(&d.owner, deposit); - Self::deposit_event(Event::MetadataCleared(id)); + Self::deposit_event(Event::MetadataCleared { asset_id: id }); Ok(()) }) } @@ -1133,7 +1209,7 @@ pub mod pallet { asset.is_frozen = is_frozen; *maybe_asset = Some(asset); - Self::deposit_event(Event::AssetStatusChanged(id)); + Self::deposit_event(Event::AssetStatusChanged { asset_id: id }); Ok(()) }) } @@ -1199,7 +1275,11 @@ pub mod pallet { d.approvals.saturating_dec(); Asset::::insert(id, d); - Self::deposit_event(Event::ApprovalCancelled(id, owner, delegate)); + Self::deposit_event(Event::ApprovalCancelled { + asset_id: id, + owner, + delegate, + }); Ok(()) } @@ -1241,7 +1321,11 @@ pub mod pallet { d.approvals.saturating_dec(); Asset::::insert(id, d); - Self::deposit_event(Event::ApprovalCancelled(id, owner, delegate)); + Self::deposit_event(Event::ApprovalCancelled { + asset_id: id, + owner, + delegate, + }); Ok(()) } @@ -1276,5 +1360,36 @@ pub mod pallet { let destination = T::Lookup::lookup(destination)?; Self::do_transfer_approved(id, &owner, &delegate, &destination, amount) } + + /// Create an asset account for non-provider assets. + /// + /// A deposit will be taken from the signer account. + /// + /// - `origin`: Must be Signed; the signer account must have sufficient funds for a deposit + /// to be taken. + /// - `id`: The identifier of the asset for the account to be created. + /// + /// Emits `Touched` event when successful. + #[pallet::weight(T::WeightInfo::mint())] + pub fn touch(origin: OriginFor, #[pallet::compact] id: T::AssetId) -> DispatchResult { + Self::do_touch(id, ensure_signed(origin)?) + } + + /// Return the deposit (if any) of an asset account. + /// + /// The origin must be Signed. + /// + /// - `id`: The identifier of the asset for the account to be created. + /// - `allow_burn`: If `true` then assets may be destroyed in order to complete the refund. + /// + /// Emits `Refunded` event when successful. + #[pallet::weight(T::WeightInfo::mint())] + pub fn refund( + origin: OriginFor, + #[pallet::compact] id: T::AssetId, + allow_burn: bool, + ) -> DispatchResult { + Self::do_refund(id, ensure_signed(origin)?, allow_burn) + } } } diff --git a/xpallets/assets/src/mock.rs b/xpallets/assets/src/mock.rs index d04e1d95..1f66f4ae 100644 --- a/xpallets/assets/src/mock.rs +++ b/xpallets/assets/src/mock.rs @@ -1,13 +1,13 @@ // This file is part of Substrate. -// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) 2019-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 +// 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, @@ -20,7 +20,10 @@ use super::*; use crate as pallet_assets; -use frame_support::{construct_runtime, parameter_types}; +use frame_support::{ + construct_runtime, + traits::{ConstU32, ConstU64, GenesisBuild}, +}; use sp_core::H256; use sp_runtime::{ testing::Header, @@ -42,9 +45,6 @@ construct_runtime!( } ); -parameter_types! { - pub const BlockHashCount: u64 = 250; -} impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); @@ -59,7 +59,7 @@ impl frame_system::Config for Test { type Lookup = IdentityLookup; type Header = Header; type Event = Event; - type BlockHashCount = BlockHashCount; + type BlockHashCount = ConstU64<250>; type DbWeight = (); type Version = (); type PalletInfo = PalletInfo; @@ -69,17 +69,14 @@ impl frame_system::Config for Test { type SystemWeightInfo = (); type SS58Prefix = (); type OnSetCode = (); -} - -parameter_types! { - pub const ExistentialDeposit: u64 = 1; + type MaxConsumers = ConstU32<2>; } impl pallet_balances::Config for Test { type Balance = u64; type DustRemoval = (); type Event = Event; - type ExistentialDeposit = ExistentialDeposit; + type ExistentialDeposit = ConstU64<1>; type AccountStore = System; type WeightInfo = (); type MaxLocks = (); @@ -87,25 +84,18 @@ impl pallet_balances::Config for Test { type ReserveIdentifier = [u8; 8]; } -parameter_types! { - pub const AssetDeposit: u64 = 1; - pub const ApprovalDeposit: u64 = 1; - pub const StringLimit: u32 = 50; - pub const MetadataDepositBase: u64 = 1; - pub const MetadataDepositPerByte: u64 = 1; -} - impl Config for Test { type Event = Event; type Balance = u64; type AssetId = u32; type Currency = Balances; type ForceOrigin = frame_system::EnsureRoot; - type AssetDeposit = AssetDeposit; - type MetadataDepositBase = MetadataDepositBase; - type MetadataDepositPerByte = MetadataDepositPerByte; - type ApprovalDeposit = ApprovalDeposit; - type StringLimit = StringLimit; + type AssetDeposit = ConstU64<1>; + type AssetAccountDeposit = ConstU64<10>; + type MetadataDepositBase = ConstU64<1>; + type MetadataDepositPerByte = ConstU64<1>; + type ApprovalDeposit = ConstU64<1>; + type StringLimit = ConstU32<50>; type Freezer = TestFreezer; type WeightInfo = (); type Extra = (); @@ -130,19 +120,27 @@ impl FrozenBalance for TestFreezer { fn died(asset: u32, who: &u64) { HOOKS.with(|h| h.borrow_mut().push(Hook::Died(asset, who.clone()))); + // Sanity check: dead accounts have no balance. + assert!(Assets::balance(asset, *who).is_zero()); } } pub(crate) fn set_frozen_balance(asset: u32, who: u64, amount: u64) { FROZEN.with(|f| f.borrow_mut().insert((asset, who), amount)); } + pub(crate) fn clear_frozen_balance(asset: u32, who: u64) { FROZEN.with(|f| f.borrow_mut().remove(&(asset, who))); } + pub(crate) fn hooks() -> Vec { HOOKS.with(|h| h.borrow().clone()) } +pub(crate) fn take_hooks() -> Vec { + HOOKS.with(|h| h.take()) +} + pub(crate) fn new_test_ext() -> sp_io::TestExternalities { let mut storage = frame_system::GenesisConfig::default() .build_storage::() @@ -166,6 +164,8 @@ pub(crate) fn new_test_ext() -> sp_io::TestExternalities { config.assimilate_storage(&mut storage).unwrap(); let mut ext: sp_io::TestExternalities = storage.into(); + // Clear thread local vars for https://github.com/paritytech/substrate/issues/10479. + ext.execute_with(|| take_hooks()); ext.execute_with(|| System::set_block_number(1)); ext } diff --git a/xpallets/assets/src/tests.rs b/xpallets/assets/src/tests.rs index 40406724..9996d076 100644 --- a/xpallets/assets/src/tests.rs +++ b/xpallets/assets/src/tests.rs @@ -1,13 +1,13 @@ // This file is part of Substrate. -// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. +// Copyright (C) 2019-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 +// 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, @@ -34,6 +34,127 @@ fn basic_minting_should_work() { }); } +#[test] +fn minting_too_many_insufficient_assets_fails() { + new_test_ext().execute_with(|| { + assert_ok!(Assets::force_create(Origin::root(), 0, 1, false, 1)); + assert_ok!(Assets::force_create(Origin::root(), 1, 1, false, 1)); + assert_ok!(Assets::force_create(Origin::root(), 2, 1, false, 1)); + Balances::make_free_balance_be(&1, 100); + assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); + assert_ok!(Assets::mint(Origin::signed(1), 1, 1, 100)); + assert_noop!( + Assets::mint(Origin::signed(1), 2, 1, 100), + TokenError::CannotCreate + ); + + Balances::make_free_balance_be(&2, 1); + assert_ok!(Assets::transfer(Origin::signed(1), 0, 2, 100)); + assert_ok!(Assets::mint(Origin::signed(1), 2, 1, 100)); + }); +} + +#[test] +fn minting_insufficient_asset_with_deposit_should_work_when_consumers_exhausted() { + new_test_ext().execute_with(|| { + assert_ok!(Assets::force_create(Origin::root(), 0, 1, false, 1)); + assert_ok!(Assets::force_create(Origin::root(), 1, 1, false, 1)); + assert_ok!(Assets::force_create(Origin::root(), 2, 1, false, 1)); + Balances::make_free_balance_be(&1, 100); + assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); + assert_ok!(Assets::mint(Origin::signed(1), 1, 1, 100)); + assert_noop!( + Assets::mint(Origin::signed(1), 2, 1, 100), + TokenError::CannotCreate + ); + + assert_ok!(Assets::touch(Origin::signed(1), 2)); + assert_eq!(Balances::reserved_balance(&1), 10); + + assert_ok!(Assets::mint(Origin::signed(1), 2, 1, 100)); + }); +} + +#[test] +fn minting_insufficient_assets_with_deposit_without_consumer_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Assets::force_create(Origin::root(), 0, 1, false, 1)); + assert_noop!( + Assets::mint(Origin::signed(1), 0, 1, 100), + TokenError::CannotCreate + ); + Balances::make_free_balance_be(&1, 100); + assert_ok!(Assets::touch(Origin::signed(1), 0)); + assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); + assert_eq!(Balances::reserved_balance(&1), 10); + assert_eq!(System::consumers(&1), 0); + }); +} + +#[test] +fn refunding_asset_deposit_with_burn_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Assets::force_create(Origin::root(), 0, 1, false, 1)); + Balances::make_free_balance_be(&1, 100); + assert_ok!(Assets::touch(Origin::signed(1), 0)); + assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); + assert_ok!(Assets::refund(Origin::signed(1), 0, true)); + assert_eq!(Balances::reserved_balance(&1), 0); + assert_eq!(Assets::balance(1, 0), 0); + }); +} + +#[test] +fn refunding_asset_deposit_with_burn_disallowed_should_fail() { + new_test_ext().execute_with(|| { + assert_ok!(Assets::force_create(Origin::root(), 0, 1, false, 1)); + Balances::make_free_balance_be(&1, 100); + assert_ok!(Assets::touch(Origin::signed(1), 0)); + assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); + assert_noop!( + Assets::refund(Origin::signed(1), 0, false), + Error::::WouldBurn + ); + }); +} + +#[test] +fn refunding_asset_deposit_without_burn_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Assets::force_create(Origin::root(), 0, 1, false, 1)); + assert_noop!( + Assets::mint(Origin::signed(1), 0, 1, 100), + TokenError::CannotCreate + ); + Balances::make_free_balance_be(&1, 100); + assert_ok!(Assets::touch(Origin::signed(1), 0)); + assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); + Balances::make_free_balance_be(&2, 100); + assert_ok!(Assets::transfer(Origin::signed(1), 0, 2, 100)); + assert_eq!(Assets::balance(0, 2), 100); + assert_eq!(Assets::balance(0, 1), 0); + assert_eq!(Balances::reserved_balance(&1), 10); + assert_ok!(Assets::refund(Origin::signed(1), 0, false)); + assert_eq!(Balances::reserved_balance(&1), 0); + assert_eq!(Assets::balance(1, 0), 0); + }); +} + +/// Refunding reaps an account and calls the `FrozenBalance::died` hook. +#[test] +fn refunding_calls_died_hook() { + new_test_ext().execute_with(|| { + assert_ok!(Assets::force_create(Origin::root(), 0, 1, false, 1)); + Balances::make_free_balance_be(&1, 100); + assert_ok!(Assets::touch(Origin::signed(1), 0)); + assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); + assert_ok!(Assets::refund(Origin::signed(1), 0, true)); + + assert_eq!(Asset::::get(0).unwrap().accounts, 0); + assert_eq!(hooks(), vec![Hook::Died(0, 1)]); + }); +} + #[test] fn approval_lifecycle_works() { new_test_ext().execute_with(|| { @@ -346,19 +467,32 @@ fn min_balance_should_work() { ); // When deducting from an account to below minimum, it should be reaped. + // Death by `transfer`. assert_ok!(Assets::transfer(Origin::signed(1), 0, 2, 91)); - assert!(Assets::balance(0, 1).is_zero()); + assert!(Assets::maybe_balance(0, 1).is_none()); assert_eq!(Assets::balance(0, 2), 100); assert_eq!(Asset::::get(0).unwrap().accounts, 1); + assert_eq!(take_hooks(), vec![Hook::Died(0, 1)]); + // Death by `force_transfer`. assert_ok!(Assets::force_transfer(Origin::signed(1), 0, 2, 1, 91)); - assert!(Assets::balance(0, 2).is_zero()); + assert!(Assets::maybe_balance(0, 2).is_none()); assert_eq!(Assets::balance(0, 1), 100); assert_eq!(Asset::::get(0).unwrap().accounts, 1); + assert_eq!(take_hooks(), vec![Hook::Died(0, 2)]); + // Death by `burn`. assert_ok!(Assets::burn(Origin::signed(1), 0, 1, 91)); - assert!(Assets::balance(0, 1).is_zero()); + assert!(Assets::maybe_balance(0, 1).is_none()); assert_eq!(Asset::::get(0).unwrap().accounts, 0); + assert_eq!(take_hooks(), vec![Hook::Died(0, 1)]); + + // Death by `transfer_approved`. + assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); + Balances::make_free_balance_be(&1, 1); + assert_ok!(Assets::approve_transfer(Origin::signed(1), 0, 2, 100)); + assert_ok!(Assets::transfer_approved(Origin::signed(2), 0, 1, 3, 91)); + assert_eq!(take_hooks(), vec![Hook::Died(0, 1)]); }); } @@ -405,6 +539,7 @@ fn transferring_enough_to_kill_source_when_keep_alive_should_fail() { assert_ok!(Assets::transfer_keep_alive(Origin::signed(1), 0, 2, 90)); assert_eq!(Assets::balance(0, 1), 10); assert_eq!(Assets::balance(0, 2), 90); + assert!(hooks().is_empty()); }); } @@ -571,7 +706,7 @@ fn transferring_amount_more_than_available_balance_should_not_work() { assert_eq!(Assets::balance(0, 1), 0); assert_noop!( Assets::transfer(Origin::signed(1), 0, 1, 50), - Error::::BalanceLow + Error::::NoAccount ); assert_noop!( Assets::transfer(Origin::signed(2), 0, 1, 51), @@ -587,7 +722,12 @@ fn transferring_less_than_one_unit_is_fine() { assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); assert_eq!(Assets::balance(0, 1), 100); assert_ok!(Assets::transfer(Origin::signed(1), 0, 2, 0)); - System::assert_last_event(mock::Event::Assets(crate::Event::Transferred(0, 1, 2, 0))); + System::assert_last_event(mock::Event::Assets(crate::Event::Transferred { + asset_id: 0, + from: 1, + to: 2, + amount: 0, + })); }); } @@ -621,7 +761,10 @@ fn burning_asset_balance_with_zero_balance_does_nothing() { assert_ok!(Assets::force_create(Origin::root(), 0, 1, true, 1)); assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); assert_eq!(Assets::balance(0, 2), 0); - assert_ok!(Assets::burn(Origin::signed(1), 0, 2, u64::MAX)); + assert_noop!( + Assets::burn(Origin::signed(1), 0, 2, u64::MAX), + Error::::NoAccount + ); assert_eq!(Assets::balance(0, 2), 0); assert_eq!(Assets::total_supply(0), 100); }); @@ -702,6 +845,24 @@ fn set_metadata_should_work() { }); } +/// Destroying an asset calls the `FrozenBalance::died` hooks of all accounts. +#[test] +fn destroy_calls_died_hooks() { + new_test_ext().execute_with(|| { + assert_ok!(Assets::force_create(Origin::root(), 0, 1, true, 50)); + // Create account 1 and 2. + assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); + assert_ok!(Assets::mint(Origin::signed(1), 0, 2, 100)); + // Destroy the asset. + let w = Asset::::get(0).unwrap().destroy_witness(); + assert_ok!(Assets::destroy(Origin::signed(1), 0, w)); + + // Asset is gone and accounts 1 and 2 died. + assert!(Asset::::get(0).is_none()); + assert_eq!(hooks(), vec![Hook::Died(0, 1), Hook::Died(0, 2)]); + }) +} + #[test] fn freezer_should_work() { new_test_ext().execute_with(|| { @@ -800,7 +961,7 @@ fn force_metadata_should_work() { ); // string length limit check - let limit = StringLimit::get() as usize; + let limit = 50usize; assert_noop!( Assets::force_set_metadata( Origin::root(), @@ -943,3 +1104,37 @@ fn assets_from_genesis_should_exist() { assert_eq!(Assets::total_supply(999), 100); }); } + +#[test] +fn querying_name_symbol_and_decimals_should_work() { + new_test_ext().execute_with(|| { + use frame_support::traits::tokens::fungibles::metadata::Inspect; + assert_ok!(Assets::force_create(Origin::root(), 0, 1, true, 1)); + assert_ok!(Assets::force_set_metadata( + Origin::root(), + 0, + vec![0u8; 10], + vec![1u8; 10], + 12, + false + )); + assert_eq!(Assets::name(0), vec![0u8; 10]); + assert_eq!(Assets::symbol(0), vec![1u8; 10]); + assert_eq!(Assets::decimals(0), 12); + }); +} + +#[test] +fn querying_allowance_should_work() { + new_test_ext().execute_with(|| { + use frame_support::traits::tokens::fungibles::approvals::{Inspect, Mutate}; + assert_ok!(Assets::force_create(Origin::root(), 0, 1, true, 1)); + assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); + Balances::make_free_balance_be(&1, 1); + assert_ok!(Assets::approve(0, &1, &2, 50)); + assert_eq!(Assets::allowance(0, &1, &2), 50); + // Transfer asset 0, from owner 1 and delegate 2 to destination 3 + assert_ok!(Assets::transfer_from(0, &1, &2, &3, 50)); + assert_eq!(Assets::allowance(0, &1, &2), 0); + }); +} diff --git a/xpallets/assets/src/types.rs b/xpallets/assets/src/types.rs index 3394e718..52d5cd2d 100644 --- a/xpallets/assets/src/types.rs +++ b/xpallets/assets/src/types.rs @@ -1,13 +1,13 @@ // This file is part of Substrate. -// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd. +// Copyright (C) 2017-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 +// 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, @@ -18,14 +18,16 @@ //! Various basic types for use in the assets pallet. use super::*; -use frame_support::pallet_prelude::*; -use scale_info::TypeInfo; - -use frame_support::traits::{fungible, tokens::BalanceConversion}; +use frame_support::{ + pallet_prelude::*, + traits::{fungible, tokens::BalanceConversion}, +}; use sp_runtime::{traits::Convert, FixedPointNumber, FixedPointOperand, FixedU128}; pub(super) type DepositBalanceOf = <>::Currency as Currency<::AccountId>>::Balance; +pub(super) type AssetAccountOf = + AssetAccount<>::Balance, DepositBalanceOf, >::Extra>; #[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, MaxEncodedLen, TypeInfo)] pub struct AssetDetails { @@ -76,14 +78,47 @@ pub struct Approval { pub(super) deposit: DepositBalance, } -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default, MaxEncodedLen, TypeInfo)] -pub struct AssetBalance { +#[test] +fn ensure_bool_decodes_to_consumer_or_sufficient() { + assert_eq!(false.encode(), ExistenceReason::<()>::Consumer.encode()); + assert_eq!(true.encode(), ExistenceReason::<()>::Sufficient.encode()); +} + +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, MaxEncodedLen, TypeInfo)] +pub enum ExistenceReason { + #[codec(index = 0)] + Consumer, + #[codec(index = 1)] + Sufficient, + #[codec(index = 2)] + DepositHeld(Balance), + #[codec(index = 3)] + DepositRefunded, +} + +impl ExistenceReason { + pub(crate) fn take_deposit(&mut self) -> Option { + if !matches!(self, ExistenceReason::DepositHeld(_)) { + return None; + } + if let ExistenceReason::DepositHeld(deposit) = + sp_std::mem::replace(self, ExistenceReason::DepositRefunded) + { + return Some(deposit); + } else { + return None; + } + } +} + +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, MaxEncodedLen, TypeInfo)] +pub struct AssetAccount { /// The balance. pub(super) balance: Balance, /// Whether the account is frozen. pub(super) is_frozen: bool, - /// `true` if this balance gave the account a self-sufficient reference. - pub(super) sufficient: bool, + /// The reason for the existence of the account. + pub(super) reason: ExistenceReason, /// Additional "sidecar" data, in case some other pallet wants to use this storage item. pub(super) extra: Extra, } @@ -122,20 +157,24 @@ pub struct DestroyWitness { /// `minimum_balance` of the asset. This is additive - the `minimum_balance` of the asset must be /// met *and then* anything here in addition. pub trait FrozenBalance { - /// Return the frozen balance. Under normal behaviour, this amount should always be - /// withdrawable. + /// Return the frozen balance. /// - /// In reality, the balance of every account must be at least the sum of this (if `Some`) and - /// the asset's minimum_balance, since there may be complications to destroying an asset's - /// account completely. + /// Generally, the balance of every account must be at least the sum of this (if `Some`) and + /// the asset's `minimum_balance` (the latter since there may be complications to destroying an + /// asset's account completely). /// - /// If `None` is returned, then nothing special is enforced. + /// Under normal behaviour, the account balance should not go below the sum of this (if `Some`) + /// and the asset's minimum balance. However, the account balance may reasonably begin below + /// this sum (e.g. if less than the sum had ever been transfered into the account). + /// + /// In special cases (privileged intervention) the account balance may also go below the sum. /// - /// If any operation ever breaks this requirement (which will only happen through some sort of - /// privileged intervention), then `melted` is called to do any cleanup. + /// If `None` is returned, then nothing special is enforced. fn frozen_balance(asset: AssetId, who: &AccountId) -> Option; - /// Called when an account has been removed. + /// Called after an account has been removed. + /// + /// NOTE: It is possible that the asset does no longer exist when this hook is called. fn died(asset: AssetId, who: &AccountId); } diff --git a/xpallets/assets/src/weights.rs b/xpallets/assets/src/weights.rs index 912ebcf7..f45293fa 100644 --- a/xpallets/assets/src/weights.rs +++ b/xpallets/assets/src/weights.rs @@ -1,6 +1,6 @@ // This file is part of Substrate. -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// Copyright (C) 2022 Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,11 +18,11 @@ //! Autogenerated weights for pallet_assets //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2021-08-07, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 +//! DATE: 2022-01-30, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// target/release/substrate +// ./target/production/substrate // benchmark // --chain=dev // --steps=50 @@ -33,8 +33,9 @@ // --wasm-execution=compiled // --heap-pages=4096 // --output=./frame/assets/src/weights.rs -// --template=./.maintain/frame-weight-template.hbs - +// --template=.maintain/frame-weight-template.hbs +// --header=HEADER-APACHE2 +// --raw #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -45,398 +46,402 @@ use sp_std::marker::PhantomData; /// Weight functions needed for pallet_assets. pub trait WeightInfo { - fn create() -> Weight; - fn force_create() -> Weight; - fn destroy(c: u32, s: u32, a: u32, ) -> Weight; - fn mint() -> Weight; - fn burn() -> Weight; - fn transfer() -> Weight; - fn transfer_keep_alive() -> Weight; - fn force_transfer() -> Weight; - fn freeze() -> Weight; - fn thaw() -> Weight; - fn freeze_asset() -> Weight; - fn thaw_asset() -> Weight; - fn transfer_ownership() -> Weight; - fn set_team() -> Weight; - fn set_metadata(n: u32, s: u32, ) -> Weight; - fn clear_metadata() -> Weight; - fn force_set_metadata(n: u32, s: u32, ) -> Weight; - fn force_clear_metadata() -> Weight; - fn force_asset_status() -> Weight; - fn approve_transfer() -> Weight; - fn transfer_approved() -> Weight; - fn cancel_approval() -> Weight; - fn force_cancel_approval() -> Weight; + fn create() -> Weight; + fn force_create() -> Weight; + fn destroy(c: u32, s: u32, a: u32, ) -> Weight; + fn mint() -> Weight; + fn burn() -> Weight; + fn transfer() -> Weight; + fn transfer_keep_alive() -> Weight; + fn force_transfer() -> Weight; + fn freeze() -> Weight; + fn thaw() -> Weight; + fn freeze_asset() -> Weight; + fn thaw_asset() -> Weight; + fn transfer_ownership() -> Weight; + fn set_team() -> Weight; + fn set_metadata(n: u32, s: u32, ) -> Weight; + fn clear_metadata() -> Weight; + fn force_set_metadata(n: u32, s: u32, ) -> Weight; + fn force_clear_metadata() -> Weight; + fn force_asset_status() -> Weight; + fn approve_transfer() -> Weight; + fn transfer_approved() -> Weight; + fn cancel_approval() -> Weight; + fn force_cancel_approval() -> Weight; } /// Weights for pallet_assets using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { - // Storage: Assets Asset (r:1 w:1) - fn create() -> Weight { - (41_651_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - fn force_create() -> Weight { - (21_378_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Account (r:5002 w:5001) - // Storage: System Account (r:5000 w:5000) - // Storage: Assets Metadata (r:1 w:0) - // Storage: Assets Approvals (r:501 w:500) - fn destroy(c: u32, s: u32, a: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 32_000 - .saturating_add((21_163_000 as Weight).saturating_mul(c as Weight)) - // Standard Error: 32_000 - .saturating_add((26_932_000 as Weight).saturating_mul(s as Weight)) - // Standard Error: 329_000 - .saturating_add((29_714_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(c as Weight))) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(c as Weight))) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(a as Weight))) - } - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Account (r:1 w:1) - fn mint() -> Weight { - (47_913_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Account (r:1 w:1) - fn burn() -> Weight { - (55_759_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Account (r:2 w:2) - // Storage: System Account (r:1 w:1) - fn transfer() -> Weight { - (83_205_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Account (r:2 w:2) - // Storage: System Account (r:1 w:1) - fn transfer_keep_alive() -> Weight { - (70_665_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Account (r:2 w:2) - // Storage: System Account (r:1 w:1) - fn force_transfer() -> Weight { - (81_458_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - // Storage: Assets Asset (r:1 w:0) - // Storage: Assets Account (r:1 w:1) - fn freeze() -> Weight { - (32_845_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:0) - // Storage: Assets Account (r:1 w:1) - fn thaw() -> Weight { - (33_303_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - fn freeze_asset() -> Weight { - (23_434_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - fn thaw_asset() -> Weight { - (24_173_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Metadata (r:1 w:0) - fn transfer_ownership() -> Weight { - (27_466_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - fn set_team() -> Weight { - (24_608_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:0) - // Storage: Assets Metadata (r:1 w:1) - fn set_metadata(n: u32, s: u32, ) -> Weight { - (49_515_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_000 as Weight).saturating_mul(n as Weight)) - // Standard Error: 1_000 - .saturating_add((6_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:0) - // Storage: Assets Metadata (r:1 w:1) - fn clear_metadata() -> Weight { - (48_163_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:0) - // Storage: Assets Metadata (r:1 w:1) - fn force_set_metadata(_n: u32, s: u32, ) -> Weight { - (26_722_000 as Weight) - // Standard Error: 0 - .saturating_add((5_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:0) - // Storage: Assets Metadata (r:1 w:1) - fn force_clear_metadata() -> Weight { - (47_923_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - fn force_asset_status() -> Weight { - (23_081_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Approvals (r:1 w:1) - fn approve_transfer() -> Weight { - (56_998_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - // Storage: Assets Approvals (r:1 w:1) - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Account (r:2 w:2) - // Storage: System Account (r:1 w:1) - fn transfer_approved() -> Weight { - (107_171_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Approvals (r:1 w:1) - fn cancel_approval() -> Weight { - (57_358_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Approvals (r:1 w:1) - fn force_cancel_approval() -> Weight { - (58_330_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } + // Storage: Assets Asset (r:1 w:1) + fn create() -> Weight { + (22_102_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + fn force_create() -> Weight { + (12_124_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Account (r:5002 w:5001) + // Storage: System Account (r:5000 w:5000) + // Storage: Assets Metadata (r:1 w:0) + // Storage: Assets Approvals (r:501 w:500) + fn destroy(c: u32, s: u32, a: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 34_000 + .saturating_add((14_683_000 as Weight).saturating_mul(c as Weight)) + // Standard Error: 34_000 + .saturating_add((17_080_000 as Weight).saturating_mul(s as Weight)) + // Standard Error: 342_000 + .saturating_add((16_533_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(c as Weight))) + .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight))) + .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(a as Weight))) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(c as Weight))) + .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight))) + .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(a as Weight))) + } + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Account (r:1 w:1) + fn mint() -> Weight { + (26_632_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Account (r:1 w:1) + fn burn() -> Weight { + (30_048_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Account (r:2 w:2) + // Storage: System Account (r:1 w:1) + fn transfer() -> Weight { + (44_000_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Account (r:2 w:2) + // Storage: System Account (r:1 w:1) + fn transfer_keep_alive() -> Weight { + (37_286_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Account (r:2 w:2) + // Storage: System Account (r:1 w:1) + fn force_transfer() -> Weight { + (44_120_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + // Storage: Assets Asset (r:1 w:0) + // Storage: Assets Account (r:1 w:1) + fn freeze() -> Weight { + (18_309_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:0) + // Storage: Assets Account (r:1 w:1) + fn thaw() -> Weight { + (18_290_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + fn freeze_asset() -> Weight { + (14_744_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + fn thaw_asset() -> Weight { + (14_833_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Metadata (r:1 w:0) + fn transfer_ownership() -> Weight { + (16_654_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + fn set_team() -> Weight { + (15_351_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:0) + // Storage: Assets Metadata (r:1 w:1) + fn set_metadata(n: u32, s: u32, ) -> Weight { + (27_588_000 as Weight) + // Standard Error: 0 + .saturating_add((6_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 0 + .saturating_add((3_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:0) + // Storage: Assets Metadata (r:1 w:1) + fn clear_metadata() -> Weight { + (27_710_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:0) + // Storage: Assets Metadata (r:1 w:1) + fn force_set_metadata(n: u32, s: u32, ) -> Weight { + (15_345_000 as Weight) + // Standard Error: 0 + .saturating_add((2_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 0 + .saturating_add((2_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:0) + // Storage: Assets Metadata (r:1 w:1) + fn force_clear_metadata() -> Weight { + (27_552_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + fn force_asset_status() -> Weight { + (13_755_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Approvals (r:1 w:1) + fn approve_transfer() -> Weight { + (30_831_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + // Storage: Assets Approvals (r:1 w:1) + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Account (r:2 w:2) + // Storage: System Account (r:1 w:1) + fn transfer_approved() -> Weight { + (56_267_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(5 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Approvals (r:1 w:1) + fn cancel_approval() -> Weight { + (31_964_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Approvals (r:1 w:1) + fn force_cancel_approval() -> Weight { + (31_806_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } } // For backwards compatibility and tests impl WeightInfo for () { - // Storage: Assets Asset (r:1 w:1) - fn create() -> Weight { - (41_651_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - fn force_create() -> Weight { - (21_378_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Account (r:5002 w:5001) - // Storage: System Account (r:5000 w:5000) - // Storage: Assets Metadata (r:1 w:0) - // Storage: Assets Approvals (r:501 w:500) - fn destroy(c: u32, s: u32, a: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 32_000 - .saturating_add((21_163_000 as Weight).saturating_mul(c as Weight)) - // Standard Error: 32_000 - .saturating_add((26_932_000 as Weight).saturating_mul(s as Weight)) - // Standard Error: 329_000 - .saturating_add((29_714_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(c as Weight))) - .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(s as Weight))) - .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(a as Weight))) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(c as Weight))) - .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(s as Weight))) - .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(a as Weight))) - } - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Account (r:1 w:1) - fn mint() -> Weight { - (47_913_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Account (r:1 w:1) - fn burn() -> Weight { - (55_759_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Account (r:2 w:2) - // Storage: System Account (r:1 w:1) - fn transfer() -> Weight { - (83_205_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Account (r:2 w:2) - // Storage: System Account (r:1 w:1) - fn transfer_keep_alive() -> Weight { - (70_665_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Account (r:2 w:2) - // Storage: System Account (r:1 w:1) - fn force_transfer() -> Weight { - (81_458_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) - } - // Storage: Assets Asset (r:1 w:0) - // Storage: Assets Account (r:1 w:1) - fn freeze() -> Weight { - (32_845_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:0) - // Storage: Assets Account (r:1 w:1) - fn thaw() -> Weight { - (33_303_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - fn freeze_asset() -> Weight { - (23_434_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - fn thaw_asset() -> Weight { - (24_173_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Metadata (r:1 w:0) - fn transfer_ownership() -> Weight { - (27_466_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - fn set_team() -> Weight { - (24_608_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:0) - // Storage: Assets Metadata (r:1 w:1) - fn set_metadata(n: u32, s: u32, ) -> Weight { - (49_515_000 as Weight) - // Standard Error: 1_000 - .saturating_add((1_000 as Weight).saturating_mul(n as Weight)) - // Standard Error: 1_000 - .saturating_add((6_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:0) - // Storage: Assets Metadata (r:1 w:1) - fn clear_metadata() -> Weight { - (48_163_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:0) - // Storage: Assets Metadata (r:1 w:1) - fn force_set_metadata(_n: u32, s: u32, ) -> Weight { - (26_722_000 as Weight) - // Standard Error: 0 - .saturating_add((5_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:0) - // Storage: Assets Metadata (r:1 w:1) - fn force_clear_metadata() -> Weight { - (47_923_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - fn force_asset_status() -> Weight { - (23_081_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Approvals (r:1 w:1) - fn approve_transfer() -> Weight { - (56_998_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - } - // Storage: Assets Approvals (r:1 w:1) - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Account (r:2 w:2) - // Storage: System Account (r:1 w:1) - fn transfer_approved() -> Weight { - (107_171_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes(5 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Approvals (r:1 w:1) - fn cancel_approval() -> Weight { - (57_358_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - } - // Storage: Assets Asset (r:1 w:1) - // Storage: Assets Approvals (r:1 w:1) - fn force_cancel_approval() -> Weight { - (58_330_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - } + // Storage: Assets Asset (r:1 w:1) + fn create() -> Weight { + (22_102_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + fn force_create() -> Weight { + (12_124_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Account (r:5002 w:5001) + // Storage: System Account (r:5000 w:5000) + // Storage: Assets Metadata (r:1 w:0) + // Storage: Assets Approvals (r:501 w:500) + fn destroy(c: u32, s: u32, a: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 34_000 + .saturating_add((14_683_000 as Weight).saturating_mul(c as Weight)) + // Standard Error: 34_000 + .saturating_add((17_080_000 as Weight).saturating_mul(s as Weight)) + // Standard Error: 342_000 + .saturating_add((16_533_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(RocksDbWeight::get().reads(5 as Weight)) + .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(c as Weight))) + .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(s as Weight))) + .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(a as Weight))) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(c as Weight))) + .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(s as Weight))) + .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(a as Weight))) + } + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Account (r:1 w:1) + fn mint() -> Weight { + (26_632_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Account (r:1 w:1) + fn burn() -> Weight { + (30_048_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Account (r:2 w:2) + // Storage: System Account (r:1 w:1) + fn transfer() -> Weight { + (44_000_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Account (r:2 w:2) + // Storage: System Account (r:1 w:1) + fn transfer_keep_alive() -> Weight { + (37_286_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Account (r:2 w:2) + // Storage: System Account (r:1 w:1) + fn force_transfer() -> Weight { + (44_120_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } + // Storage: Assets Asset (r:1 w:0) + // Storage: Assets Account (r:1 w:1) + fn freeze() -> Weight { + (18_309_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:0) + // Storage: Assets Account (r:1 w:1) + fn thaw() -> Weight { + (18_290_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + fn freeze_asset() -> Weight { + (14_744_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + fn thaw_asset() -> Weight { + (14_833_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Metadata (r:1 w:0) + fn transfer_ownership() -> Weight { + (16_654_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + fn set_team() -> Weight { + (15_351_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:0) + // Storage: Assets Metadata (r:1 w:1) + fn set_metadata(n: u32, s: u32, ) -> Weight { + (27_588_000 as Weight) + // Standard Error: 0 + .saturating_add((6_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 0 + .saturating_add((3_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:0) + // Storage: Assets Metadata (r:1 w:1) + fn clear_metadata() -> Weight { + (27_710_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:0) + // Storage: Assets Metadata (r:1 w:1) + fn force_set_metadata(n: u32, s: u32, ) -> Weight { + (15_345_000 as Weight) + // Standard Error: 0 + .saturating_add((2_000 as Weight).saturating_mul(n as Weight)) + // Standard Error: 0 + .saturating_add((2_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:0) + // Storage: Assets Metadata (r:1 w:1) + fn force_clear_metadata() -> Weight { + (27_552_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + fn force_asset_status() -> Weight { + (13_755_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Approvals (r:1 w:1) + fn approve_transfer() -> Weight { + (30_831_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + } + // Storage: Assets Approvals (r:1 w:1) + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Account (r:2 w:2) + // Storage: System Account (r:1 w:1) + fn transfer_approved() -> Weight { + (56_267_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(5 as Weight)) + .saturating_add(RocksDbWeight::get().writes(5 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Approvals (r:1 w:1) + fn cancel_approval() -> Weight { + (31_964_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + } + // Storage: Assets Asset (r:1 w:1) + // Storage: Assets Approvals (r:1 w:1) + fn force_cancel_approval() -> Weight { + (31_806_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + } } diff --git a/xpallets/ethereum-chain-id/Cargo.toml b/xpallets/ethereum-chain-id/Cargo.toml index 9df33ac3..0342acf5 100644 --- a/xpallets/ethereum-chain-id/Cargo.toml +++ b/xpallets/ethereum-chain-id/Cargo.toml @@ -1,16 +1,16 @@ [package] authors = ['ChainX Developers'] -edition = "2018" +edition = "2021" name = "pallet-ethereum-chain-id" -version = "1.1.0" +version = "1.3.0" [dependencies] -codec = { package = "parity-scale-codec", version = "2.3.1", default-features = false, features = ["derive"] } -serde = { version = "1.0.119", optional = true } -scale-info = { version = "1.0.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } +serde = { version = "1.0.136", optional = true } +scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.11" } -frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.11" } +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.18" } +frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.18" } [features] default = ["std"] diff --git a/xpallets/gateway/bitcoin/Cargo.toml b/xpallets/gateway/bitcoin/Cargo.toml index c48020f7..89f9a883 100644 --- a/xpallets/gateway/bitcoin/Cargo.toml +++ b/xpallets/gateway/bitcoin/Cargo.toml @@ -2,32 +2,29 @@ name = "xpallet-gateway-bitcoin" version = "3.0.0" authors = ["The ChainX Authors"] -edition = "2018" +edition = "2021" [dependencies] bs58 = { version = "0.3", default-features = false, features = ["alloc"] } -codec = { package = "parity-scale-codec", version = "2.3.1", features = ["derive"], default-features = false } +codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive"], default-features = false } hex = { version = "0.4", default-features = false } -serde = { version = "1.0", optional = true } -scale-info = { version = "1.0", default-features = false, features = ["derive"] } +serde = { version = "1.0.136", optional = true } +scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } # Substrate primitives -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } # Substrate pallets -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false, optional = true } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } pallet-assets = { path = "../../assets", default-features = false } -# Orml -orml-utilities = { git = "https://github.com/chainx-org/ormls", branch = "main", default-features = false } - # ChainX primitives sherpax-primitives = { path = "../../../primitives", default-features = false } xp-assets-registrar = { path = "../../../primitives/assets-registrar", default-features = false } @@ -41,19 +38,19 @@ xpallet-gateway-records = { path = "../records", default-features = false } xpallet-support = { path = "../../support", default-features = false } # light-bitcoin -light-bitcoin = { git = "https://github.com/chainx-org/light-bitcoin", branch = "taproot", default-features = false } -musig2 = { git = "https://github.com/chainx-org/Musig2", branch = "lib", default-features = false } +light-bitcoin = { git = "https://github.com/chainx-org/light-bitcoin", branch = "upgrade-2021", default-features = false } +musig2 = { git = "https://github.com/chainx-org/Musig2", branch = "upgrade-2021", default-features = false } [dev-dependencies] hex = "0.4" hex-literal = "0.3" lazy_static = "1.4" -serde_json = "1.0" -sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } -pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } -pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } +serde_json = "1.0.79" +sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } +pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } +pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } xp-assets-registrar = { path = "../../../primitives/assets-registrar" } [features] @@ -73,8 +70,6 @@ std = [ "frame-support/std", "frame-system/std", "pallet-timestamp/std", - # Orml - "orml-utilities/std", # ChainX primitives "sherpax-primitives/std", "xp-assets-registrar/std", @@ -91,3 +86,4 @@ std = [ ] runtime-benchmarks = ["frame-benchmarking"] ss58check = ["xp-gateway-common/ss58check"] +try-runtime = ["frame-support/try-runtime"] diff --git a/xpallets/gateway/bitcoin/rpc/Cargo.toml b/xpallets/gateway/bitcoin/rpc/Cargo.toml index fb7d4dd0..96662a04 100644 --- a/xpallets/gateway/bitcoin/rpc/Cargo.toml +++ b/xpallets/gateway/bitcoin/rpc/Cargo.toml @@ -2,23 +2,23 @@ name = "xpallet-gateway-bitcoin-rpc" version = "3.0.0" authors = ["The ChainX Authors"] -edition = "2018" +edition = "2021" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", version = "2.3.1" } -serde = { version = "1.0.101", features = ["derive"] } +codec = { package = "parity-scale-codec", version = "3.0.0" } +serde = { version = "1.0.136", features = ["derive"] } hex = "0.4" jsonrpc-core = "18.0.0" jsonrpc-core-client = "18.0.0" jsonrpc-derive = "18.0.0" # Substrate primitives -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } # ChainX primitives xp-rpc = { path = "../../../../primitives/rpc" } diff --git a/xpallets/gateway/bitcoin/rpc/runtime-api/Cargo.toml b/xpallets/gateway/bitcoin/rpc/runtime-api/Cargo.toml index 3972c4a7..493b62bb 100644 --- a/xpallets/gateway/bitcoin/rpc/runtime-api/Cargo.toml +++ b/xpallets/gateway/bitcoin/rpc/runtime-api/Cargo.toml @@ -2,18 +2,18 @@ name = "xpallet-gateway-bitcoin-rpc-runtime-api" version = "3.0.0" authors = ["The ChainX Authors"] -edition = "2018" +edition = "2021" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", version = "2.3.1", default-features = false } +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false } # Substrate primitives -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } # ChainX primitives sherpax-primitives = { path = "../../../../../primitives", default-features = false } diff --git a/xpallets/gateway/bitcoin/src/lib.rs b/xpallets/gateway/bitcoin/src/lib.rs index d4592f63..07d777ef 100644 --- a/xpallets/gateway/bitcoin/src/lib.rs +++ b/xpallets/gateway/bitcoin/src/lib.rs @@ -20,8 +20,6 @@ mod tests; use sp_runtime::SaturatedConversion; use sp_std::{marker::PhantomData, prelude::*, str::FromStr}; -use orml_utilities::with_transaction_result; - #[cfg(feature = "std")] pub use light_bitcoin::primitives::h256_rev; pub use light_bitcoin::{ @@ -81,6 +79,7 @@ pub mod pallet { #[pallet::pallet] #[pallet::generate_store(pub(crate) trait Store)] + #[pallet::without_storage_info] pub struct Pallet(PhantomData); #[pallet::config] @@ -753,6 +752,7 @@ pub mod pallet { Ok(()) } + #[transactional] pub(crate) fn apply_push_header(header: BtcHeader) -> DispatchResult { // current should not exist if Self::headers(&header.hash()).is_some() { @@ -782,57 +782,55 @@ pub mod pallet { let header_verifier = header::HeaderVerifier::new::(&header_info); header_verifier.check::()?; - with_transaction_result(|| { - // insert into storage - let hash = header_info.header.hash(); - // insert valid header into storage - Headers::::insert(&hash, header_info.clone()); - // storage height => block list (contains forked header hash) - BlockHashFor::::mutate(header_info.height, |v| { - if !v.contains(&hash) { - v.push(hash); - } - }); + // insert into storage + let hash = header_info.header.hash(); + // insert valid header into storage + Headers::::insert(&hash, header_info.clone()); + // storage height => block list (contains forked header hash) + BlockHashFor::::mutate(header_info.height, |v| { + if !v.contains(&hash) { + v.push(hash); + } + }); - log!(debug, + log!(debug, "[apply_push_header] Verify successfully, insert header to storage [height:{}, hash:{:?}, all hashes of the height:{:?}]", header_info.height, hash, Self::block_hash_for(header_info.height) ); - let best_index = Self::best_index(); - - if header_info.height > best_index.height { - // note update_confirmed_header would mutate other storage depend on BlockHashFor - let confirmed_index = header::update_confirmed_header::(&header_info); - log!( - info, - "[apply_push_header] Update new height:{}, hash:{:?}, confirm:{:?}", - header_info.height, - hash, - confirmed_index - ); + let best_index = Self::best_index(); - // new best index - let new_best_index = BtcHeaderIndex { - hash, - height: header_info.height, - }; - BestIndex::::put(new_best_index); - } else { - // forked chain - log!( - info, - "[apply_push_header] Best index {} larger than this height {}", - best_index.height, - header_info.height - ); - header::check_confirmed_header::(&header_info)?; + if header_info.height > best_index.height { + // note update_confirmed_header would mutate other storage depend on BlockHashFor + let confirmed_index = header::update_confirmed_header::(&header_info); + log!( + info, + "[apply_push_header] Update new height:{}, hash:{:?}, confirm:{:?}", + header_info.height, + hash, + confirmed_index + ); + + // new best index + let new_best_index = BtcHeaderIndex { + hash, + height: header_info.height, }; - Self::deposit_event(Event::::HeaderInserted(hash)); - Ok(()) - }) + BestIndex::::put(new_best_index); + } else { + // forked chain + log!( + info, + "[apply_push_header] Best index {} larger than this height {}", + best_index.height, + header_info.height + ); + header::check_confirmed_header::(&header_info)?; + }; + Self::deposit_event(Event::::HeaderInserted(hash)); + Ok(()) } pub(crate) fn apply_push_transaction( diff --git a/xpallets/gateway/bitcoin/src/mock.rs b/xpallets/gateway/bitcoin/src/mock.rs index ef6ae4d6..b2606d87 100644 --- a/xpallets/gateway/bitcoin/src/mock.rs +++ b/xpallets/gateway/bitcoin/src/mock.rs @@ -1,6 +1,7 @@ // Copyright 2019-2020 ChainX Project Authors. Licensed under GPL-3.0. #![allow(clippy::type_complexity)] +use codec::{Decode, Encode}; use std::{cell::RefCell, collections::BTreeMap, time::Duration}; use hex_literal::hex; @@ -13,7 +14,7 @@ use frame_support::{ weights::Weight, }; use frame_system::{EnsureRoot, EnsureSigned}; -use sp_core::H256; +use sp_core::{blake2_256, H256}; use sp_keyring::sr25519; use sp_runtime::{ testing::Header, @@ -32,6 +33,7 @@ use light_bitcoin::{ primitives::{h256_rev, Compact}, serialization::{self, Reader}, }; +use xpallet_support::traits::MultisigAddressFor; use crate::{ self as xpallet_gateway_bitcoin, @@ -95,6 +97,7 @@ impl frame_system::Config for Test { type SystemWeightInfo = (); type SS58Prefix = SS58Prefix; type OnSetCode = (); + type MaxConsumers = frame_support::traits::ConstU32<16>; } parameter_types! { @@ -160,6 +163,7 @@ impl pallet_assets::Config for Test { type Currency = Balances; type ForceOrigin = EnsureRoot; type AssetDeposit = AssetDeposit; + type AssetAccountDeposit = (); type MetadataDepositBase = MetadataDepositBase; type MetadataDepositPerByte = MetadataDepositPerByte; type ApprovalDeposit = ApprovalDeposit; @@ -181,10 +185,18 @@ impl xpallet_gateway_records::Config for Test { type WeightInfo = (); } +pub struct MultisigAddr; +impl MultisigAddressFor for MultisigAddr { + fn calc_multisig(who: &[AccountId], threshold: u16) -> AccountId { + let entropy = (b"modlpy/utilisuba", who, threshold).using_encoded(blake2_256); + AccountId::decode(&mut &entropy[..]).unwrap() + } +} + impl xpallet_gateway_common::Config for Test { type Event = (); type Validator = (); - type DetermineMultisigAddress = (); + type DetermineMultisigAddress = MultisigAddr; type CouncilOrigin = EnsureSigned; type Bitcoin = XGatewayBitcoin; type BitcoinTrustee = XGatewayBitcoin; diff --git a/xpallets/gateway/bitcoin/src/tests/header.rs b/xpallets/gateway/bitcoin/src/tests/header.rs index 33099446..3e25b5ab 100644 --- a/xpallets/gateway/bitcoin/src/tests/header.rs +++ b/xpallets/gateway/bitcoin/src/tests/header.rs @@ -8,6 +8,7 @@ use light_bitcoin::{ serialization, }; +use crate::mock::alice; use crate::{ mock::{ generate_blocks_478557_478563, generate_blocks_63290_63310, ExtBuilder, XGatewayBitcoin, @@ -212,7 +213,7 @@ fn test_change_difficulty() { fn test_call() { ExtBuilder::default().build_and_execute(|| { let headers = generate_blocks_63290_63310(); - let origin = frame_system::RawOrigin::Signed(Default::default()).into(); + let origin = frame_system::RawOrigin::Signed(alice()).into(); let v = serialization::serialize(&headers[&(63290 + 1)]); let v = v.take(); assert_ok!(XGatewayBitcoin::push_header(origin, v)); diff --git a/xpallets/gateway/bitcoin/src/tests/mod.rs b/xpallets/gateway/bitcoin/src/tests/mod.rs index 63dff922..dcf2443f 100644 --- a/xpallets/gateway/bitcoin/src/tests/mod.rs +++ b/xpallets/gateway/bitcoin/src/tests/mod.rs @@ -4,7 +4,7 @@ mod header; mod trustee; mod tx; -use sp_core::crypto::{set_default_ss58_version, Ss58AddressFormat}; +use sp_core::crypto::{set_default_ss58_version, Ss58AddressFormatRegistry}; use xp_gateway_common::AccountExtractor; @@ -23,7 +23,7 @@ pub fn test_verify_btc_address() { #[test] fn test_account_ss58_version() { - set_default_ss58_version(Ss58AddressFormat::ChainXAccount); + set_default_ss58_version(Ss58AddressFormatRegistry::ChainxAccount.into()); let script = Script::from( "5Uj3ehamDZWPfgA8iAZenhcAmPDakjf4aMbkBB4dXVvjoW6x@33" .as_bytes() diff --git a/xpallets/gateway/bitcoin/src/tests/tx.rs b/xpallets/gateway/bitcoin/src/tests/tx.rs index 90f1fbcd..9a715a8b 100644 --- a/xpallets/gateway/bitcoin/src/tests/tx.rs +++ b/xpallets/gateway/bitcoin/src/tests/tx.rs @@ -4,7 +4,7 @@ use codec::Encode; use frame_support::{assert_noop, assert_ok}; -use sp_core::crypto::{set_default_ss58_version, Ss58AddressFormat}; +use sp_core::crypto::{set_default_ss58_version, Ss58AddressFormatRegistry}; use light_bitcoin::{ chain::Transaction, @@ -81,7 +81,7 @@ fn mock_detect_transaction_type( #[test] fn test_detect_tx_type() { - set_default_ss58_version(Ss58AddressFormat::ChainXAccount); + set_default_ss58_version(Ss58AddressFormatRegistry::ChainxAccount.into()); match mock_detect_transaction_type::(&deposit_taproot1, None) { BtcTxMetaType::Deposit(info) => { assert!(info.input_addr.is_none() && info.op_return.is_none()) @@ -170,7 +170,7 @@ fn mock_process_tx(tx: Transaction, prev_tx: Option) -> #[test] fn test_process_tx() { - set_default_ss58_version(Ss58AddressFormat::ChainXAccount); + set_default_ss58_version(Ss58AddressFormatRegistry::ChainxAccount.into()); ExtBuilder::default().build_and_execute(|| { // without op return and input address let r = mock_process_tx::(deposit_taproot1.clone(), None); @@ -245,7 +245,7 @@ fn test_process_tx() { #[test] fn test_push_tx_call() { - set_default_ss58_version(Ss58AddressFormat::ChainXAccount); + set_default_ss58_version(Ss58AddressFormatRegistry::ChainxAccount.into()); // https://blockchain.info/rawtx/f1a9161a045a01db7ae02b8c0531e2fe2e9740efe30afe6d84a12e3cac251344?format=hex let normal_deposit: Transaction = "02000000000101aeee49e0bbf7a36f78ea4321b5c8bae0b8c72bdf2c024d2484b137fa7d0f8e1f01000000000000000003a0860100000000002251209a9ea267884f5549c206b2aec2bd56d98730f90532ea7f7154d4d4f923b7e3bb0000000000000000326a3035516a706f3772516e7751657479736167477a6334526a376f737758534c6d4d7141754332416255364c464646476a38801a060000000000225120c9929543dfa1e0bb84891acd47bfa6546b05e26b7a04af8eb6765fcc969d565f01409e325889515ed47099fdd7098e6fafdc880b21456d3f368457de923f4229286e34cef68816348a0581ae5885ede248a35ac4b09da61a7b9b90f34c200872d2e300000000".parse().unwrap(); let tx = serialization::serialize(&normal_deposit); @@ -268,7 +268,7 @@ fn test_push_tx_call() { .encode(); assert_ok!(XGatewayBitcoin::push_transaction( - frame_system::RawOrigin::Signed(Default::default()).into(), + frame_system::RawOrigin::Signed(alice()).into(), tx.clone().into(), info.clone(), None, @@ -277,7 +277,7 @@ fn test_push_tx_call() { // reject replay assert_noop!( XGatewayBitcoin::push_transaction( - frame_system::RawOrigin::Signed(Default::default()).into(), + frame_system::RawOrigin::Signed(alice()).into(), tx.clone().into(), info, None, diff --git a/xpallets/gateway/bitcoin/src/weights.rs b/xpallets/gateway/bitcoin/src/weights.rs index 606d61fb..7d4e26d2 100644 --- a/xpallets/gateway/bitcoin/src/weights.rs +++ b/xpallets/gateway/bitcoin/src/weights.rs @@ -2,8 +2,8 @@ //! Weights for xpallet_gateway_bitcoin //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-03-24, STEPS: 50, REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("benchmarks"), DB CACHE: 128 +//! DATE: 2022-04-28, STEPS: 50, REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("benchmarks"), DB CACHE: 1024 // Executed Command: // ./target/release/sherpax @@ -47,87 +47,87 @@ pub trait WeightInfo { pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { fn push_header() -> Weight { - (102_168_000 as Weight) + (98_514_000 as Weight) .saturating_add(T::DbWeight::get().reads(10 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } fn push_transaction() -> Weight { - (236_659_000 as Weight) + (232_229_000 as Weight) .saturating_add(T::DbWeight::get().reads(20 as Weight)) .saturating_add(T::DbWeight::get().writes(9 as Weight)) } fn create_taproot_withdraw_tx() -> Weight { - (138_827_000 as Weight) + (105_581_000 as Weight) .saturating_add(T::DbWeight::get().reads(14 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } fn set_best_index() -> Weight { - (3_163_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + (2_153_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn set_confirmed_index() -> Weight { - (2_963_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + (2_278_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn remove_pending() -> Weight { - (159_303_000 as Weight) + (109_323_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } fn remove_proposal() -> Weight { - (46_838_000 as Weight) + (40_905_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } fn set_btc_withdrawal_fee() -> Weight { - (2_308_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + (1_841_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn set_btc_deposit_limit() -> Weight { - (2_285_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + (1_806_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn set_coming_bot() -> Weight { - (2_585_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + (1_979_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) } } // For backwards compatibility and tests impl WeightInfo for () { fn push_header() -> Weight { - (102_168_000 as Weight) + (98_514_000 as Weight) .saturating_add(RocksDbWeight::get().reads(10 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } fn push_transaction() -> Weight { - (236_659_000 as Weight) + (232_229_000 as Weight) .saturating_add(RocksDbWeight::get().reads(20 as Weight)) .saturating_add(RocksDbWeight::get().writes(9 as Weight)) } fn create_taproot_withdraw_tx() -> Weight { - (138_827_000 as Weight) + (105_581_000 as Weight) .saturating_add(RocksDbWeight::get().reads(14 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } fn set_best_index() -> Weight { - (3_163_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) + (2_153_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn set_confirmed_index() -> Weight { - (2_963_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) + (2_278_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn remove_pending() -> Weight { - (159_303_000 as Weight) + (109_323_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } fn remove_proposal() -> Weight { - (46_838_000 as Weight) + (40_905_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } fn set_btc_withdrawal_fee() -> Weight { - (2_308_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) + (1_841_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn set_btc_deposit_limit() -> Weight { - (2_285_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) + (1_806_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn set_coming_bot() -> Weight { - (2_585_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) + (1_979_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) } } diff --git a/xpallets/gateway/common/Cargo.toml b/xpallets/gateway/common/Cargo.toml index dc2a7bf0..6f31aef9 100644 --- a/xpallets/gateway/common/Cargo.toml +++ b/xpallets/gateway/common/Cargo.toml @@ -2,25 +2,25 @@ name = "xpallet-gateway-common" version = "3.0.0" authors = ["The ChainX Authors"] -edition = "2018" +edition = "2021" [dependencies] -codec = { package = "parity-scale-codec", version = "2.3.1", features = ["derive"], default-features = false } +codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive"], default-features = false } hex = { version = "0.4", default-features = false, optional = true } -serde = { version = "1.0", optional = true } -scale-info = { version = "1.0", default-features = false, features = ["derive"] } +serde = { version = "1.0.136", optional = true } +scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } # Substrate primitives -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false, optional = true } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false, optional = true } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } # Substrate pallets -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false, optional = true } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } -pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } pallet-assets = { path = "../../assets", default-features = false } # ChainX primitives @@ -35,18 +35,18 @@ xpallet-gateway-records = { path = "../records", default-features = false } xpallet-support = { path = "../../support", default-features = false } # light-bitcoin -light-bitcoin = { git = "https://github.com/chainx-org/light-bitcoin", branch = "taproot", default-features = false } -musig2 = { git = "https://github.com/chainx-org/Musig2", branch = "lib", default-features = false } +light-bitcoin = { git = "https://github.com/chainx-org/light-bitcoin", branch = "upgrade-2021", default-features = false } +musig2 = { git = "https://github.com/chainx-org/Musig2", branch = "upgrade-2021", default-features = false } [dev-dependencies] lazy_static = "1.4" -serde_json = "1.0" -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } +serde_json = "1.0.79" +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } xp-gateway-bitcoin = { path = "../../../primitives/gateway/bitcoin" } xpallet-gateway-bitcoin = { path = "../bitcoin" } -sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } +sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } [features] @@ -78,3 +78,4 @@ std = [ "pallet-elections-phragmen/std" ] runtime-benchmarks = ["hex", "sp-core", "frame-benchmarking"] +try-runtime = ["frame-support/try-runtime"] diff --git a/xpallets/gateway/common/rpc/Cargo.toml b/xpallets/gateway/common/rpc/Cargo.toml index bde4a4ff..ff5b1cbe 100644 --- a/xpallets/gateway/common/rpc/Cargo.toml +++ b/xpallets/gateway/common/rpc/Cargo.toml @@ -2,23 +2,23 @@ name = "xpallet-gateway-common-rpc" version = "3.0.0" authors = ["The ChainX Authors"] -edition = "2018" +edition = "2021" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", version = "2.3.1" } -serde = { version = "1.0.101", features = ["derive"] } +codec = { package = "parity-scale-codec", version = "3.0.0" } +serde = { version = "1.0.136", features = ["derive"] } hex = "0.4" jsonrpc-core = "18.0.0" jsonrpc-core-client = "18.0.0" jsonrpc-derive = "18.0.0" # Substrate primitives -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } # ChainX primitives xp-rpc = { path = "../../../../primitives/rpc" } diff --git a/xpallets/gateway/common/rpc/runtime-api/Cargo.toml b/xpallets/gateway/common/rpc/runtime-api/Cargo.toml index 08001acb..84821526 100644 --- a/xpallets/gateway/common/rpc/runtime-api/Cargo.toml +++ b/xpallets/gateway/common/rpc/runtime-api/Cargo.toml @@ -2,18 +2,18 @@ name = "xpallet-gateway-common-rpc-runtime-api" version = "3.0.0" authors = ["The ChainX Authors"] -edition = "2018" +edition = "2021" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", version = "2.3.1", default-features = false } +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false } # Substrate primitives -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } # ChainX primitives sherpax-primitives = { path = "../../../../../primitives", default-features = false } diff --git a/xpallets/gateway/common/src/benchmarking.rs b/xpallets/gateway/common/src/benchmarking.rs index 7145aa44..7ff0a971 100644 --- a/xpallets/gateway/common/src/benchmarking.rs +++ b/xpallets/gateway/common/src/benchmarking.rs @@ -206,7 +206,7 @@ benchmarks! { } }: _(RawOrigin::Root, who.clone()) verify { - assert_eq!(Pallet::::trustee_admin(), who); + assert_eq!(Pallet::::trustee_admin().unwrap(), who); } set_trustee_admin_multiply { diff --git a/xpallets/gateway/common/src/lib.rs b/xpallets/gateway/common/src/lib.rs index 1c4ee2e5..a3b74df7 100644 --- a/xpallets/gateway/common/src/lib.rs +++ b/xpallets/gateway/common/src/lib.rs @@ -108,6 +108,7 @@ pub mod pallet { #[pallet::pallet] #[pallet::generate_store(pub (super) trait Store)] + #[pallet::without_storage_info] pub struct Pallet(PhantomData); #[pallet::call] @@ -546,11 +547,11 @@ pub mod pallet { #[pallet::storage] #[pallet::getter(fn trustee_multisig_addr)] pub(crate) type TrusteeMultiSigAddr = - StorageMap<_, Twox64Concat, Chain, T::AccountId, ValueQuery>; + StorageMap<_, Twox64Concat, Chain, T::AccountId, OptionQuery>; #[pallet::storage] #[pallet::getter(fn trustee_admin)] - pub(crate) type TrusteeAdmin = StorageValue<_, T::AccountId, ValueQuery>; + pub(crate) type TrusteeAdmin = StorageValue<_, T::AccountId, OptionQuery>; #[pallet::storage] #[pallet::getter(fn trustee_admin_multiply)] @@ -1217,7 +1218,7 @@ impl Pallet { fn try_ensure_trustee_admin(origin: OriginFor) -> Result<(), OriginFor> { match ensure_signed(origin.clone()) { Ok(who) => { - if who != Self::trustee_admin() { + if Some(who) != Self::trustee_admin() { return Err(origin); } } diff --git a/xpallets/gateway/common/src/mock.rs b/xpallets/gateway/common/src/mock.rs index 859b47b3..be0ecf05 100644 --- a/xpallets/gateway/common/src/mock.rs +++ b/xpallets/gateway/common/src/mock.rs @@ -93,6 +93,7 @@ impl frame_system::Config for Test { type SystemWeightInfo = (); type SS58Prefix = SS58Prefix; type OnSetCode = (); + type MaxConsumers = frame_support::traits::ConstU32<16>; } parameter_types! { @@ -206,6 +207,7 @@ impl pallet_assets::Config for Test { type Currency = Balances; type ForceOrigin = EnsureRoot; type AssetDeposit = AssetDeposit; + type AssetAccountDeposit = (); type MetadataDepositBase = MetadataDepositBase; type MetadataDepositPerByte = MetadataDepositPerByte; type ApprovalDeposit = ApprovalDeposit; @@ -261,7 +263,7 @@ pub struct MultisigAddr; impl MultisigAddressFor for MultisigAddr { fn calc_multisig(who: &[AccountId], threshold: u16) -> AccountId { let entropy = (b"modlpy/utilisuba", who, threshold).using_encoded(blake2_256); - AccountId::decode(&mut &entropy[..]).unwrap_or_default() + AccountId::decode(&mut &entropy[..]).unwrap() } } pub struct AlwaysValidator; @@ -441,7 +443,7 @@ impl .into_iter() .zip(vec![1u64; trustee_num]) .collect::>(), - multi_account: Some(T::AccountId::default()), + multi_account: None, start_height: Some(start_height), threshold: sig_num as u16, hot_address: hot_trustee_addr_info, @@ -506,7 +508,7 @@ impl ExtBuilder { .assimilate_storage(&mut storage); let _ = pallet_assets::GenesisConfig:: { - assets: vec![(X_BTC, Default::default(), true, 1)], + assets: vec![(X_BTC, alice(), true, 1)], metadata: vec![( X_BTC, "XBTC".to_string().into_bytes(), diff --git a/xpallets/gateway/common/src/tests.rs b/xpallets/gateway/common/src/tests.rs index b8c6a617..d3f0a361 100644 --- a/xpallets/gateway/common/src/tests.rs +++ b/xpallets/gateway/common/src/tests.rs @@ -31,7 +31,7 @@ fn test_claim_not_native_asset_reward() { assert_eq!(XGatewayCommon::trustee_sig_record(charlie()), 1); assert_eq!(XGatewayCommon::trustee_sig_record(dave()), 0); - let multi_address = XGatewayCommon::trustee_multisig_addr(Chain::Bitcoin); + let multi_address = XGatewayCommon::trustee_multisig_addr(Chain::Bitcoin).unwrap(); assert_ok!(XGatewayRecords::deposit(&multi_address, X_BTC, 10)); diff --git a/xpallets/gateway/common/src/trustees/mod.rs b/xpallets/gateway/common/src/trustees/mod.rs index fa54adf9..f97e248f 100644 --- a/xpallets/gateway/common/src/trustees/mod.rs +++ b/xpallets/gateway/common/src/trustees/mod.rs @@ -110,14 +110,18 @@ impl TrusteeMultisigProvider { } impl MultiSig for TrusteeMultisigProvider { - fn multisig() -> T::AccountId { + fn multisig() -> Option { Pallet::::trustee_multisig_addr(C::chain()) } } impl SortedMembers for TrusteeMultisigProvider { fn sorted_members() -> Vec { - vec![Self::multisig()] + if let Some(n) = Self::multisig() { + vec![n] + } else { + vec![] + } } } @@ -194,7 +198,7 @@ impl TrusteeInfoUpdate for Pallet { fn update_trustee_sig_record(script: &[u8], withdraw_amount: u64) { let signed_trustees = Self::agg_pubkey_info(script); signed_trustees.into_iter().for_each(|trustee| { - let amount = if trustee == Self::trustee_admin() { + let amount = if Some(trustee.clone()) == Self::trustee_admin() { withdraw_amount .saturating_mul(Self::trustee_admin_multiply()) .saturating_div(10) diff --git a/xpallets/gateway/common/src/weights.rs b/xpallets/gateway/common/src/weights.rs index 554547c4..b4b1d868 100644 --- a/xpallets/gateway/common/src/weights.rs +++ b/xpallets/gateway/common/src/weights.rs @@ -2,8 +2,8 @@ //! Weights for xpallet_gateway_common //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-04-15, STEPS: 50, REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("benchmarks"), DB CACHE: 128 +//! DATE: 2022-04-28, STEPS: 50, REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("benchmarks"), DB CACHE: 1024 // Executed Command: // ./target/release/sherpax @@ -46,39 +46,39 @@ pub trait WeightInfo { pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { fn withdraw() -> Weight { - (100_827_000 as Weight) + (102_426_000 as Weight) .saturating_add(T::DbWeight::get().reads(8 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } fn cancel_withdrawal() -> Weight { - (35_281_000 as Weight) + (38_160_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } fn setup_trustee() -> Weight { - (81_660_000 as Weight) + (88_827_000 as Weight) .saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn set_trustee_proxy() -> Weight { - (25_285_000 as Weight) + (26_447_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn set_trustee_info_config() -> Weight { - (3_454_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + (3_407_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn change_trustee_transition_duration() -> Weight { - (2_245_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + (2_076_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn set_trustee_admin() -> Weight { - (3_477_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + (3_525_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn set_trustee_admin_multiply() -> Weight { - (2_291_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + (2_299_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn claim_trustee_reward() -> Weight { - (157_754_000 as Weight) + (124_737_000 as Weight) .saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -87,39 +87,39 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests impl WeightInfo for () { fn withdraw() -> Weight { - (100_827_000 as Weight) + (102_426_000 as Weight) .saturating_add(RocksDbWeight::get().reads(8 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } fn cancel_withdrawal() -> Weight { - (35_281_000 as Weight) + (38_160_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } fn setup_trustee() -> Weight { - (81_660_000 as Weight) + (88_827_000 as Weight) .saturating_add(RocksDbWeight::get().reads(7 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn set_trustee_proxy() -> Weight { - (25_285_000 as Weight) + (26_447_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn set_trustee_info_config() -> Weight { - (3_454_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) + (3_407_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn change_trustee_transition_duration() -> Weight { - (2_245_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) + (2_076_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn set_trustee_admin() -> Weight { - (3_477_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) + (3_525_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn set_trustee_admin_multiply() -> Weight { - (2_291_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) + (2_299_000 as Weight).saturating_add(RocksDbWeight::get().writes(1 as Weight)) } fn claim_trustee_reward() -> Weight { - (157_754_000 as Weight) + (124_737_000 as Weight) .saturating_add(RocksDbWeight::get().reads(7 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } diff --git a/xpallets/gateway/records/Cargo.toml b/xpallets/gateway/records/Cargo.toml index c13b4318..bdb123e6 100644 --- a/xpallets/gateway/records/Cargo.toml +++ b/xpallets/gateway/records/Cargo.toml @@ -2,25 +2,23 @@ name = "xpallet-gateway-records" version = "3.0.0" authors = ["The ChainX Authors"] -edition = "2018" +edition = "2021" [dependencies] -codec = { package = "parity-scale-codec", version = "2.3.1", features = ["derive"], default-features = false } -serde = { version = "1.0", optional = true } -scale-info = { version = "1.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive"], default-features = false } +serde = { version = "1.0.136", optional = true } +scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } # Substrate primitives -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } # Substrate pallets -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false, optional = true } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } pallet-assets = { path = "../../assets", default-features = false } -# Orml -orml-utilities = { git = "https://github.com/chainx-org/ormls", branch = "main", default-features = false } # ChainX primitives sherpax-primitives = { path = "../../../primitives", default-features = false } @@ -32,9 +30,9 @@ xp-runtime = { path = "../../../primitives/runtime", default-features = false } xpallet-support = { path = "../../support", default-features = false } [dev-dependencies] -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } [features] default = ["std"] @@ -49,8 +47,6 @@ std = [ "frame-support/std", "frame-system/std", "pallet-assets/std", - # Orml - "orml-utilities/std", # ChainX primitives "sherpax-primitives/std", "xp-assets-registrar/std", @@ -62,3 +58,4 @@ std = [ runtime-benchmarks = [ "frame-benchmarking", ] +try-runtime = ["frame-support/try-runtime"] diff --git a/xpallets/gateway/records/rpc/Cargo.toml b/xpallets/gateway/records/rpc/Cargo.toml index bddd2433..9467a124 100644 --- a/xpallets/gateway/records/rpc/Cargo.toml +++ b/xpallets/gateway/records/rpc/Cargo.toml @@ -2,22 +2,22 @@ name = "xpallet-gateway-records-rpc" version = "3.0.0" authors = ["The ChainX Authors"] -edition = "2018" +edition = "2021" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", version = "2.3.1" } -serde = { version = "1.0.101", features = ["derive"] } +codec = { package = "parity-scale-codec", version = "3.0.0" } +serde = { version = "1.0.136", features = ["derive"] } jsonrpc-core = "18.0.0" jsonrpc-core-client = "18.0.0" jsonrpc-derive = "18.0.0" # Substrate primitives -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11" } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } # ChainX primitives xp-rpc = { path = "../../../../primitives/rpc" } diff --git a/xpallets/gateway/records/rpc/runtime-api/Cargo.toml b/xpallets/gateway/records/rpc/runtime-api/Cargo.toml index 2edcdaca..287294d5 100644 --- a/xpallets/gateway/records/rpc/runtime-api/Cargo.toml +++ b/xpallets/gateway/records/rpc/runtime-api/Cargo.toml @@ -2,17 +2,17 @@ name = "xpallet-gateway-records-rpc-runtime-api" version = "3.0.0" authors = ["The ChainX Authors"] -edition = "2018" +edition = "2021" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", version = "2.3.1", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } # Substrate primitives -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } # ChainX primitives sherpax-primitives = { path = "../../../../../primitives", default-features = false } diff --git a/xpallets/gateway/records/src/lib.rs b/xpallets/gateway/records/src/lib.rs index 3ecd9d84..ef113e92 100644 --- a/xpallets/gateway/records/src/lib.rs +++ b/xpallets/gateway/records/src/lib.rs @@ -18,14 +18,13 @@ use frame_support::{ ensure, log::{error, info}, traits::fungibles::{Inspect, Mutate}, + transactional, }; use frame_system::ensure_root; use sp_runtime::traits::{CheckedSub, StaticLookup}; use sp_std::{cmp::Ordering, collections::btree_map::BTreeMap, prelude::*}; -use orml_utilities::with_transaction_result; - use sherpax_primitives::AddrStr; use xp_assets_registrar::Chain; use xp_runtime::Memo; @@ -54,7 +53,6 @@ pub mod pallet { use frame_support::{ pallet_prelude::*, traits::{LockableCurrency, ReservableCurrency}, - transactional, }; use frame_system::pallet_prelude::*; @@ -77,6 +75,7 @@ pub mod pallet { #[pallet::pallet] #[pallet::generate_store(pub(crate) trait Store)] + #[pallet::without_storage_info] pub struct Pallet(PhantomData); #[pallet::call] @@ -385,13 +384,12 @@ impl Pallet { } /// Process withdrawal in batches. + #[transactional] pub fn process_withdrawals(ids: &[WithdrawalRecordId], chain: Chain) -> DispatchResult { - with_transaction_result(|| { - for id in ids { - Self::process_withdrawal(*id, chain)?; - } - Ok(()) - }) + for id in ids { + Self::process_withdrawal(*id, chain)?; + } + Ok(()) } /// Recover withdrawal. @@ -516,16 +514,15 @@ impl Pallet { } /// Finish withdrawal in batches. + #[transactional] pub fn finish_withdrawals( ids: &[WithdrawalRecordId], expected_chain: Option, ) -> DispatchResult { - with_transaction_result(|| { - for id in ids { - Self::finish_withdrawal(*id, expected_chain)?; - } - Ok(()) - }) + for id in ids { + Self::finish_withdrawal(*id, expected_chain)?; + } + Ok(()) } pub fn set_withdrawal_state_by_root( diff --git a/xpallets/gateway/records/src/mock.rs b/xpallets/gateway/records/src/mock.rs index 83747243..d97ad910 100644 --- a/xpallets/gateway/records/src/mock.rs +++ b/xpallets/gateway/records/src/mock.rs @@ -64,6 +64,7 @@ impl frame_system::Config for Test { type SystemWeightInfo = (); type SS58Prefix = SS58Prefix; type OnSetCode = (); + type MaxConsumers = frame_support::traits::ConstU32<16>; } parameter_types! { @@ -97,6 +98,7 @@ impl pallet_assets::Config for Test { type Currency = Balances; type ForceOrigin = EnsureRoot; type AssetDeposit = AssetDeposit; + type AssetAccountDeposit = (); type MetadataDepositBase = MetadataDepositBase; type MetadataDepositPerByte = MetadataDepositPerByte; type ApprovalDeposit = ApprovalDeposit; diff --git a/xpallets/gateway/records/src/weights.rs b/xpallets/gateway/records/src/weights.rs index 1100cca1..bf335a5e 100644 --- a/xpallets/gateway/records/src/weights.rs +++ b/xpallets/gateway/records/src/weights.rs @@ -2,8 +2,8 @@ //! Weights for xpallet_gateway_records //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-03-21, STEPS: 50, REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("benchmarks"), DB CACHE: 128 +//! DATE: 2022-04-28, STEPS: 50, REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("benchmarks"), DB CACHE: 1024 // Executed Command: // ./target/release/sherpax @@ -42,28 +42,27 @@ pub trait WeightInfo { pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { fn root_deposit() -> Weight { - (60_676_000 as Weight) + (58_051_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } fn root_withdraw() -> Weight { - (66_034_000 as Weight) + (61_313_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } fn set_withdrawal_state() -> Weight { - (83_026_000 as Weight) + (75_617_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } - fn set_withdrawal_state_list(u: u32) -> Weight { - (82_644_000 as Weight) - .saturating_add((23_000 as Weight).saturating_mul(u as Weight)) + fn set_withdrawal_state_list(_u: u32) -> Weight { + (70_483_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } fn set_locked_assets() -> Weight { - (8_767_000 as Weight) + (6_333_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -72,28 +71,27 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests impl WeightInfo for () { fn root_deposit() -> Weight { - (60_676_000 as Weight) + (58_051_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } fn root_withdraw() -> Weight { - (66_034_000 as Weight) + (61_313_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } fn set_withdrawal_state() -> Weight { - (83_026_000 as Weight) + (75_617_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } - fn set_withdrawal_state_list(u: u32) -> Weight { - (82_644_000 as Weight) - .saturating_add((23_000 as Weight).saturating_mul(u as Weight)) + fn set_withdrawal_state_list(_u: u32) -> Weight { + (70_483_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } fn set_locked_assets() -> Weight { - (8_767_000 as Weight) + (6_333_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } diff --git a/xpallets/support/Cargo.toml b/xpallets/support/Cargo.toml index e75873a4..e5aa65de 100644 --- a/xpallets/support/Cargo.toml +++ b/xpallets/support/Cargo.toml @@ -2,13 +2,13 @@ name = "xpallet-support" version = "3.0.0" authors = ["The ChainX Authors"] -edition = "2018" +edition = "2021" [dependencies] hex = { version = "0.4", default-features = false, features = ["alloc"] } # Substrate primitives -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.11", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } [features] default = ["std"] diff --git a/xpallets/support/src/traits.rs b/xpallets/support/src/traits.rs index 091f410c..5b2a3884 100644 --- a/xpallets/support/src/traits.rs +++ b/xpallets/support/src/traits.rs @@ -11,7 +11,7 @@ impl MultisigAddressFor for () { } pub trait MultiSig { - fn multisig() -> AccountId; + fn multisig() -> Option; } pub trait Validator {