diff --git a/benchmarking/frame-weight-template.hbs b/.maintain/frame-weight-template.hbs similarity index 53% rename from benchmarking/frame-weight-template.hbs rename to .maintain/frame-weight-template.hbs index d2ffc2258d..38bb4de263 100644 --- a/benchmarking/frame-weight-template.hbs +++ b/.maintain/frame-weight-template.hbs @@ -1,24 +1,9 @@ -// SPDX-License-Identifier: Apache-2.0 -// This file is part of Frontier. -// -// Copyright (c) 2020-2022 Parity Technologies (UK) Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - +{{header}} //! Autogenerated weights for {{pallet}} //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}} -//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: {{cmd.repeat}}, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}` +//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: `{{cmd.repeat}}`, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}` +//! WORST CASE MAP SIZE: `{{cmd.worst_case_map_values}}` //! HOSTNAME: `{{hostname}}`, CPU: `{{cpuname}}` //! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}} @@ -30,9 +15,10 @@ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] +#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; +use core::marker::PhantomData; /// Weight functions needed for {{pallet}}. pub trait WeightInfo { @@ -54,7 +40,7 @@ impl WeightInfo for SubstrateWeight { {{/if}} {{#each benchmarks as |benchmark|}} {{#each benchmark.comments as |comment|}} - // {{comment}} + /// {{comment}} {{/each}} {{#each benchmark.component_ranges as |range|}} /// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`. @@ -64,22 +50,29 @@ impl WeightInfo for SubstrateWeight { {{~#each benchmark.components as |c| ~}} {{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}} ) -> Weight { - Weight::from_ref_time({{underscore benchmark.base_weight}} as u64) + // Proof Size summary in bytes: + // Measured: `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` + // Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` + // Minimum execution time: {{underscore benchmark.min_execution_time}}_000 picoseconds. + Weight::from_parts({{underscore benchmark.base_weight}}, {{benchmark.base_calculated_proof_size}}) {{#each benchmark.component_weight as |cw|}} // Standard Error: {{underscore cw.error}} - .saturating_add(Weight::from_ref_time({{underscore cw.slope}} as u64).saturating_mul({{cw.name}} as u64)) + .saturating_add(Weight::from_parts({{underscore cw.slope}}, 0).saturating_mul({{cw.name}}.into())) {{/each}} {{#if (ne benchmark.base_reads "0")}} - .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as u64)) + .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}}_u64)) {{/if}} {{#each benchmark.component_reads as |cr|}} - .saturating_add(T::DbWeight::get().reads(({{cr.slope}} as u64).saturating_mul({{cr.name}} as u64))) + .saturating_add(T::DbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into()))) {{/each}} {{#if (ne benchmark.base_writes "0")}} - .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as u64)) + .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}}_u64)) {{/if}} {{#each benchmark.component_writes as |cw|}} - .saturating_add(T::DbWeight::get().writes(({{cw.slope}} as u64).saturating_mul({{cw.name}} as u64))) + .saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into()))) + {{/each}} + {{#each benchmark.component_calculated_proof_size as |cp|}} + .saturating_add(Weight::from_parts(0, {{cp.slope}}).saturating_mul({{cp.name}}.into())) {{/each}} } {{/each}} @@ -89,7 +82,7 @@ impl WeightInfo for SubstrateWeight { impl WeightInfo for () { {{#each benchmarks as |benchmark|}} {{#each benchmark.comments as |comment|}} - // {{comment}} + /// {{comment}} {{/each}} {{#each benchmark.component_ranges as |range|}} /// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`. @@ -99,22 +92,29 @@ impl WeightInfo for () { {{~#each benchmark.components as |c| ~}} {{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}} ) -> Weight { - Weight::from_ref_time({{underscore benchmark.base_weight}} as u64) + // Proof Size summary in bytes: + // Measured: `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` + // Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` + // Minimum execution time: {{underscore benchmark.min_execution_time}}_000 picoseconds. + Weight::from_parts({{underscore benchmark.base_weight}}, {{benchmark.base_calculated_proof_size}}) {{#each benchmark.component_weight as |cw|}} // Standard Error: {{underscore cw.error}} - .saturating_add(Weight::from_ref_time({{underscore cw.slope}} as u64).saturating_mul({{cw.name}} as u64)) + .saturating_add(Weight::from_parts({{underscore cw.slope}}, 0).saturating_mul({{cw.name}}.into())) {{/each}} {{#if (ne benchmark.base_reads "0")}} - .saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}} as u64)) + .saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}}_u64)) {{/if}} {{#each benchmark.component_reads as |cr|}} - .saturating_add(RocksDbWeight::get().reads(({{cr.slope}} as u64).saturating_mul({{cr.name}} as u64))) + .saturating_add(RocksDbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into()))) {{/each}} {{#if (ne benchmark.base_writes "0")}} - .saturating_add(RocksDbWeight::get().writes({{benchmark.base_writes}} as u64)) + .saturating_add(RocksDbWeight::get().writes({{benchmark.base_writes}}_u64)) {{/if}} {{#each benchmark.component_writes as |cw|}} - .saturating_add(RocksDbWeight::get().writes(({{cw.slope}} as u64).saturating_mul({{cw.name}} as u64))) + .saturating_add(RocksDbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into()))) + {{/each}} + {{#each benchmark.component_calculated_proof_size as |cp|}} + .saturating_add(Weight::from_parts(0, {{cp.slope}}).saturating_mul({{cp.name}}.into())) {{/each}} } {{/each}} diff --git a/Cargo.lock b/Cargo.lock index b91526f297..4b58155fd6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -300,6 +300,17 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" +[[package]] +name = "async-channel" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + [[package]] name = "async-io" version = "1.12.0" @@ -452,9 +463,9 @@ dependencies = [ [[package]] name = "binary-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ - "hash-db", + "hash-db 0.16.0", "log", ] @@ -469,9 +480,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.60.1" +version = "0.64.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" +checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" dependencies = [ "bitflags", "cexpr", @@ -484,6 +495,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", + "syn", ] [[package]] @@ -515,13 +527,13 @@ dependencies = [ [[package]] name = "blake2b_simd" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72936ee4afc7f8f736d1c38383b56480b5497b4617b4a77bdbf1d2ababc76127" +checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" dependencies = [ "arrayref", "arrayvec 0.7.2", - "constant_time_eq 0.1.5", + "constant_time_eq 0.2.4", ] [[package]] @@ -996,18 +1008,18 @@ checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" [[package]] name = "cranelift-bforest" -version = "0.93.0" +version = "0.93.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91b18cf92869a6ae85cde3af4bc4beb6154efa8adef03b18db2ad413d5bce3a2" +checksum = "a7379abaacee0f14abf3204a7606118f0465785252169d186337bcb75030815a" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.93.0" +version = "0.93.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567d9f6e919bac076f39b902a072686eaf9e6d015baa34d10a61b85105b7af59" +checksum = "9489fa336927df749631f1008007ced2871068544f40a202ce6d93fbf2366a7b" dependencies = [ "arrayvec 0.7.2", "bumpalo", @@ -1026,33 +1038,33 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.93.0" +version = "0.93.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e72b2d5ec8917b2971fe83850187373d0a186db4748a7c23a5f48691b8d92bb" +checksum = "05bbb67da91ec721ed57cef2f7c5ef7728e1cd9bde9ffd3ef8601022e73e3239" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.93.0" +version = "0.93.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3461c0e0c2ebbeb92533aacb27e219289f60dc84134ef34fbf2d77c9eddf07ef" +checksum = "418ecb2f36032f6665dc1a5e2060a143dbab41d83b784882e97710e890a7a16d" [[package]] name = "cranelift-entity" -version = "0.93.0" +version = "0.93.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af684f7f7b01427b1942c7102673322a51b9d6f261e9663dc5e5595786775531" +checksum = "7cf583f7b093f291005f9fb1323e2c37f6ee4c7909e39ce016b2e8360d461705" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.93.0" +version = "0.93.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d361ed0373cf5f086b49c499aa72227b646a64f899f32e34312f97c0fadff75" +checksum = "0b66bf9e916f57fbbd0f7703ec6286f4624866bf45000111627c70d272c8dda1" dependencies = [ "cranelift-codegen", "log", @@ -1062,15 +1074,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.93.0" +version = "0.93.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cef4f8f3984d772c199a48896d2fb766f96301bf71b371e03a2b99f4f3b7b931" +checksum = "649782a39ce99798dd6b4029e2bb318a2fbeaade1b4fa25330763c10c65bc358" [[package]] name = "cranelift-native" -version = "0.93.0" +version = "0.93.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98e4e99a353703475d5acb402b9c13482d41d8a4008b352559bd560afb90363" +checksum = "937e021e089c51f9749d09e7ad1c4f255c2f8686cb8c3df63a34b3ec9921bc41" dependencies = [ "cranelift-codegen", "libc", @@ -1079,9 +1091,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.93.0" +version = "0.93.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e3f4f0779a1b0f286a6ef19835d8665f88326e656a6d7d84fa9a39fa38ca32" +checksum = "d850cf6775477747c9dfda9ae23355dd70512ffebc70cf82b85a5b111ae668b5" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -1756,7 +1768,7 @@ checksum = "6a89fb87a9e103f71b903b80b670200b54cc67a07578f070681f1fffb7396fb7" dependencies = [ "bytes", "ethereum-types", - "hash-db", + "hash-db 0.15.2", "hash256-std-hasher", "parity-scale-codec", "rlp", @@ -1855,6 +1867,19 @@ dependencies = [ "futures", ] +[[package]] +name = "expander" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f360349150728553f92e4c997a16af8915f418d3a0f21b440d34c5632f16ed84" +dependencies = [ + "blake2", + "fs-err", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "fake-simd" version = "0.1.2" @@ -1913,7 +1938,6 @@ dependencies = [ "sc-consensus", "sp-api", "sp-block-builder", - "sp-blockchain", "sp-consensus", "sp-runtime", "thiserror", @@ -2003,6 +2027,7 @@ dependencies = [ "sc-client-db", "sc-network", "sc-network-common", + "sc-network-sync", "sc-rpc", "sc-service", "sc-transaction-pool", @@ -2095,9 +2120,9 @@ dependencies = [ [[package]] name = "finality-grandpa" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e24e6c429951433ccb7c87fd528c60084834dcd14763182c1f83291bcde24c34" +checksum = "36530797b9bf31cd4ff126dcfee8170f86b00cfdcea3269d73133cc0415945c3" dependencies = [ "either", "futures", @@ -2156,7 +2181,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", ] @@ -2277,7 +2302,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support", "frame-support-procedural", @@ -2302,7 +2327,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "Inflector", "array-bytes", @@ -2349,7 +2374,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support", "frame-system", @@ -2377,9 +2402,10 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "bitflags", + "environmental", "frame-metadata", "frame-support-procedural", "impl-trait-for-tuples", @@ -2409,7 +2435,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "Inflector", "cfg-expr", @@ -2424,7 +2450,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2436,7 +2462,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "proc-macro2", "quote", @@ -2446,7 +2472,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support", "log", @@ -2464,7 +2490,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-benchmarking", "frame-support", @@ -2479,7 +2505,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "sp-api", @@ -2520,11 +2546,12 @@ dependencies = [ "sc-client-api", "sc-consensus", "sc-consensus-aura", + "sc-consensus-grandpa", "sc-consensus-manual-seal", "sc-executor", - "sc-finality-grandpa", "sc-network", "sc-network-common", + "sc-network-sync", "sc-rpc", "sc-rpc-api", "sc-service", @@ -2536,8 +2563,8 @@ dependencies = [ "sp-block-builder", "sp-blockchain", "sp-consensus-aura", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-inherents", "sp-offchain", "sp-runtime", @@ -2597,6 +2624,12 @@ dependencies = [ "substrate-wasm-builder", ] +[[package]] +name = "fs-err" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" + [[package]] name = "fs2" version = "0.4.3" @@ -2607,6 +2640,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "fs4" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea55201cc351fdb478217c0fb641b59813da9b4efe4c414a9d8f989a657d149" +dependencies = [ + "libc", + "rustix 0.35.13", + "winapi", +] + [[package]] name = "fs_extra" version = "1.2.0" @@ -2907,6 +2951,12 @@ version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" +[[package]] +name = "hash-db" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" + [[package]] name = "hash256-std-hasher" version = "0.15.2" @@ -3285,6 +3335,12 @@ dependencies = [ "webrtc-util", ] +[[package]] +name = "io-lifetimes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074" + [[package]] name = "io-lifetimes" version = "1.0.4" @@ -3326,8 +3382,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" dependencies = [ "hermit-abi 0.2.6", - "io-lifetimes", - "rustix", + "io-lifetimes 1.0.4", + "rustix 0.36.7", "windows-sys", ] @@ -3951,9 +4007,9 @@ dependencies = [ [[package]] name = "librocksdb-sys" -version = "0.8.0+7.4.4" +version = "0.8.3+7.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611804e4666a25136fcc5f8cf425ab4d26c7f74ea245ffe92ea23b85b6420b5d" +checksum = "557b255ff04123fcc176162f56ed0c9cd42d8f357cf55b3fabeb60f7413741b3" dependencies = [ "bindgen", "bzip2-sys", @@ -4056,6 +4112,12 @@ dependencies = [ "nalgebra", ] +[[package]] +name = "linux-raw-sys" +version = "0.0.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" + [[package]] name = "linux-raw-sys" version = "0.1.4" @@ -4179,7 +4241,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b20a59d985586e4a5aef64564ac77299f8586d8be6cf9106a5a40207e8908efb" dependencies = [ - "rustix", + "rustix 0.36.7", ] [[package]] @@ -4211,12 +4273,11 @@ dependencies = [ [[package]] name = "memory-db" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e0c7cba9ce19ac7ffd2053ac9f49843bbd3f4318feedfd74e85c19d5fb0ba66" +checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" dependencies = [ - "hash-db", - "hashbrown 0.12.3", + "hash-db 0.16.0", ] [[package]] @@ -4485,20 +4546,6 @@ dependencies = [ "memoffset 0.6.5", ] -[[package]] -name = "nix" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" -dependencies = [ - "bitflags", - "cfg-if", - "libc", - "memoffset 0.7.1", - "pin-utils", - "static_assertions", -] - [[package]] name = "nohash-hasher" version = "0.2.0" @@ -4732,7 +4779,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support", "frame-system", @@ -4748,7 +4795,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support", "frame-system", @@ -4762,7 +4809,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-benchmarking", "frame-support", @@ -4786,7 +4833,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-benchmarking", "frame-support", @@ -4815,7 +4862,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support", "frame-system", @@ -4824,7 +4871,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-beefy", + "sp-consensus-beefy", "sp-runtime", "sp-session", "sp-staking", @@ -4834,7 +4881,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", "binary-merkle-tree", @@ -4848,7 +4895,7 @@ dependencies = [ "scale-info", "serde", "sp-api", - "sp-beefy", + "sp-consensus-beefy", "sp-core", "sp-io", "sp-runtime", @@ -5035,7 +5082,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5046,8 +5093,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-application-crypto", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-io", "sp-runtime", "sp-session", @@ -5074,7 +5121,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5091,7 +5138,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support", "frame-system", @@ -5112,7 +5159,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support", "frame-system", @@ -5126,7 +5173,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5144,7 +5191,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-support", "frame-system", @@ -5160,7 +5207,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5176,7 +5223,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5188,7 +5235,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5203,9 +5250,9 @@ dependencies = [ [[package]] name = "parity-db" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd684a725651d9588ef21f140a328b6b4f64e646b2e931f3e6f14f75eedf9980" +checksum = "00bfb81cf5c90a222db2fb7b3a7cbf8cc7f38dfb6647aca4d98edf8281f56ed5" dependencies = [ "blake2", "crc32fast", @@ -5217,6 +5264,7 @@ dependencies = [ "memmap2", "parking_lot 0.12.1", "rand 0.8.5", + "siphasher", "snap", ] @@ -6137,7 +6185,7 @@ dependencies = [ "log", "netlink-packet-route", "netlink-proto", - "nix 0.24.3", + "nix", "thiserror", "tokio", ] @@ -6202,6 +6250,20 @@ dependencies = [ "nom", ] +[[package]] +name = "rustix" +version = "0.35.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "727a1a6d65f786ec22df8a81ca3121107f235970dc1705ed681d3e6e8b9cd5f9" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes 0.7.5", + "libc", + "linux-raw-sys 0.0.46", + "windows-sys", +] + [[package]] name = "rustix" version = "0.36.7" @@ -6210,9 +6272,9 @@ checksum = "d4fdebc4b395b7fbb9ab11e462e20ed9051e7b16e42d24042c776eca0ac81b03" dependencies = [ "bitflags", "errno", - "io-lifetimes", + "io-lifetimes 1.0.4", "libc", - "linux-raw-sys", + "linux-raw-sys 0.1.4", "windows-sys", ] @@ -6306,7 +6368,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "log", "sp-core", @@ -6317,7 +6379,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "futures", "futures-timer", @@ -6340,7 +6402,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -6350,28 +6412,31 @@ dependencies = [ "sp-core", "sp-inherents", "sp-runtime", - "sp-state-machine", ] [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "memmap2", "sc-chain-spec-derive", - "sc-network-common", + "sc-client-api", + "sc-executor", + "sc-network", "sc-telemetry", "serde", "serde_json", + "sp-blockchain", "sp-core", "sp-runtime", + "sp-state-machine", ] [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6382,7 +6447,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", "chrono", @@ -6422,7 +6487,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "fnv", "futures", @@ -6448,9 +6513,9 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ - "hash-db", + "hash-db 0.16.0", "kvdb", "kvdb-memorydb", "kvdb-rocksdb", @@ -6474,7 +6539,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "futures", @@ -6499,7 +6564,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "futures", @@ -6528,7 +6593,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "fork-tree", @@ -6567,7 +6632,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "fork-tree", "parity-scale-codec", @@ -6577,10 +6642,50 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "sc-consensus-grandpa" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +dependencies = [ + "ahash 0.8.3", + "array-bytes", + "async-trait", + "dyn-clone", + "finality-grandpa", + "fork-tree", + "futures", + "futures-timer", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "rand 0.8.5", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-consensus", + "sc-network", + "sc-network-common", + "sc-network-gossip", + "sc-telemetry", + "sc-utils", + "serde_json", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-grandpa", + "sp-core", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", +] + [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "assert_matches", "async-trait", @@ -6614,7 +6719,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "futures", @@ -6637,7 +6742,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "lru", "parity-scale-codec", @@ -6661,7 +6766,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -6674,7 +6779,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "log", "sc-allocator", @@ -6687,14 +6792,14 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "anyhow", "cfg-if", "libc", "log", "once_cell", - "rustix", + "rustix 0.36.7", "sc-allocator", "sc-executor-common", "sp-runtime-interface", @@ -6702,56 +6807,17 @@ dependencies = [ "wasmtime", ] -[[package]] -name = "sc-finality-grandpa" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" -dependencies = [ - "ahash 0.8.3", - "array-bytes", - "async-trait", - "dyn-clone", - "finality-grandpa", - "fork-tree", - "futures", - "futures-timer", - "log", - "parity-scale-codec", - "parking_lot 0.12.1", - "rand 0.8.5", - "sc-block-builder", - "sc-chain-spec", - "sc-client-api", - "sc-consensus", - "sc-network", - "sc-network-common", - "sc-network-gossip", - "sc-telemetry", - "sc-utils", - "serde_json", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-finality-grandpa", - "sp-keystore", - "sp-runtime", - "substrate-prometheus-endpoint", - "thiserror", -] - [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "ansi_term", "futures", "futures-timer", "log", "sc-client-api", + "sc-network", "sc-network-common", "sp-blockchain", "sp-runtime", @@ -6760,7 +6826,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", "async-trait", @@ -6775,12 +6841,12 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", + "async-channel", "async-trait", "asynchronous-codec", - "backtrace", "bytes", "either", "fnv", @@ -6788,6 +6854,7 @@ dependencies = [ "futures-timer", "ip_network", "libp2p", + "linked_hash_set", "log", "lru", "mockall", @@ -6818,7 +6885,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "cid", "futures", @@ -6827,6 +6894,7 @@ dependencies = [ "prost", "prost-build", "sc-client-api", + "sc-network", "sc-network-common", "sp-blockchain", "sp-runtime", @@ -6837,33 +6905,35 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ + "array-bytes", "async-trait", "bitflags", "bytes", "futures", "futures-timer", "libp2p", - "linked_hash_set", "parity-scale-codec", "prost-build", "sc-consensus", "sc-peerset", + "sc-utils", "serde", "smallvec", "sp-blockchain", "sp-consensus", - "sp-finality-grandpa", + "sp-consensus-grandpa", "sp-runtime", "substrate-prometheus-endpoint", "thiserror", + "zeroize", ] [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "ahash 0.8.3", "futures", @@ -6871,6 +6941,7 @@ dependencies = [ "libp2p", "log", "lru", + "sc-network", "sc-network-common", "sc-peerset", "sp-runtime", @@ -6881,7 +6952,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", "futures", @@ -6891,6 +6962,7 @@ dependencies = [ "prost", "prost-build", "sc-client-api", + "sc-network", "sc-network-common", "sc-peerset", "sp-blockchain", @@ -6902,12 +6974,13 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", "async-trait", "fork-tree", "futures", + "futures-timer", "libp2p", "log", "lru", @@ -6917,6 +6990,7 @@ dependencies = [ "prost-build", "sc-client-api", "sc-consensus", + "sc-network", "sc-network-common", "sc-peerset", "sc-utils", @@ -6924,8 +6998,8 @@ dependencies = [ "sp-arithmetic", "sp-blockchain", "sp-consensus", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-runtime", "substrate-prometheus-endpoint", "thiserror", @@ -6934,7 +7008,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", "futures", @@ -6942,6 +7016,7 @@ dependencies = [ "log", "parity-scale-codec", "pin-project", + "sc-network", "sc-network-common", "sc-peerset", "sc-utils", @@ -6953,7 +7028,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", "bytes", @@ -6969,6 +7044,7 @@ dependencies = [ "parking_lot 0.12.1", "rand 0.8.5", "sc-client-api", + "sc-network", "sc-network-common", "sc-peerset", "sc-utils", @@ -6983,7 +7059,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "futures", "libp2p", @@ -6996,7 +7072,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -7005,7 +7081,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "futures", "jsonrpsee", @@ -7035,7 +7111,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -7054,7 +7130,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "http", "jsonrpsee", @@ -7069,7 +7145,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", "futures", @@ -7095,7 +7171,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "directories", @@ -7161,7 +7237,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "log", "parity-scale-codec", @@ -7172,12 +7248,12 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "clap", + "fs4", "futures", "log", - "nix 0.26.2", "sc-client-db", "sc-utils", "sp-core", @@ -7188,7 +7264,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "futures", "libc", @@ -7207,7 +7283,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "chrono", "futures", @@ -7226,7 +7302,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "ansi_term", "atty", @@ -7257,7 +7333,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -7268,7 +7344,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "futures", @@ -7295,7 +7371,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "futures", @@ -7309,15 +7385,16 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ - "backtrace", + "async-channel", "futures", "futures-timer", "lazy_static", "log", "parking_lot 0.12.1", "prometheus", + "sp-arithmetic", ] [[package]] @@ -7653,6 +7730,12 @@ dependencies = [ "wide", ] +[[package]] +name = "siphasher" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" + [[package]] name = "slab" version = "0.4.7" @@ -7727,9 +7810,9 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ - "hash-db", + "hash-db 0.16.0", "log", "parity-scale-codec", "sp-api-proc-macro", @@ -7745,9 +7828,11 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ + "Inflector", "blake2", + "expander", "proc-macro-crate", "proc-macro2", "quote", @@ -7757,7 +7842,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "scale-info", @@ -7770,7 +7855,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "integer-sqrt", "num-traits", @@ -7781,29 +7866,10 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "sp-beefy" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" -dependencies = [ - "lazy_static", - "parity-scale-codec", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-io", - "sp-mmr-primitives", - "sp-runtime", - "sp-std", - "strum", -] - [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "sp-api", @@ -7815,7 +7881,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "futures", "log", @@ -7833,25 +7899,22 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "futures", "log", - "parity-scale-codec", "sp-core", "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-std", - "sp-version", "thiserror", ] [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "parity-scale-codec", @@ -7869,7 +7932,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "merlin", @@ -7889,10 +7952,47 @@ dependencies = [ "sp-timestamp", ] +[[package]] +name = "sp-consensus-beefy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +dependencies = [ + "lazy_static", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-io", + "sp-mmr-primitives", + "sp-runtime", + "sp-std", + "strum", +] + +[[package]] +name = "sp-consensus-grandpa" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +dependencies = [ + "finality-grandpa", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "sp-runtime", + "sp-std", +] + [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "scale-info", @@ -7904,7 +8004,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "scale-info", @@ -7917,7 +8017,7 @@ dependencies = [ [[package]] name = "sp-core" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", "base58", @@ -7927,7 +8027,7 @@ dependencies = [ "dyn-clonable", "ed25519-zebra", "futures", - "hash-db", + "hash-db 0.16.0", "hash256-std-hasher", "impl-serde", "lazy_static", @@ -7960,9 +8060,9 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ - "blake2", + "blake2b_simd", "byteorder", "digest 0.10.6", "sha2 0.10.6", @@ -7974,7 +8074,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "proc-macro2", "quote", @@ -7985,7 +8085,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -7994,7 +8094,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "proc-macro2", "quote", @@ -8004,7 +8104,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "environmental", "parity-scale-codec", @@ -8012,28 +8112,10 @@ dependencies = [ "sp-storage", ] -[[package]] -name = "sp-finality-grandpa" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" -dependencies = [ - "finality-grandpa", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "sp-runtime", - "sp-std", -] - [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -8048,7 +8130,7 @@ dependencies = [ [[package]] name = "sp-io" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "bytes", "ed25519", @@ -8073,7 +8155,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "lazy_static", "sp-core", @@ -8084,7 +8166,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "futures", @@ -8101,7 +8183,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "thiserror", "zstd", @@ -8110,7 +8192,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -8128,7 +8210,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "sp-api", "sp-core", @@ -8138,7 +8220,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "backtrace", "lazy_static", @@ -8148,7 +8230,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "rustc-hash", "serde", @@ -8158,7 +8240,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "either", "hash256-std-hasher", @@ -8180,7 +8262,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -8198,7 +8280,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "Inflector", "proc-macro-crate", @@ -8210,7 +8292,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "scale-info", @@ -8224,7 +8306,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "scale-info", @@ -8236,9 +8318,9 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ - "hash-db", + "hash-db 0.16.0", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -8256,12 +8338,12 @@ dependencies = [ [[package]] name = "sp-std" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" [[package]] name = "sp-storage" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "impl-serde", "parity-scale-codec", @@ -8274,7 +8356,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "futures-timer", @@ -8289,7 +8371,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "sp-std", @@ -8301,7 +8383,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "sp-api", "sp-runtime", @@ -8310,7 +8392,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "async-trait", "log", @@ -8326,10 +8408,10 @@ dependencies = [ [[package]] name = "sp-trie" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "ahash 0.8.3", - "hash-db", + "hash-db 0.16.0", "hashbrown 0.12.3", "lazy_static", "memory-db", @@ -8349,7 +8431,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "impl-serde", "parity-scale-codec", @@ -8366,7 +8448,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -8377,7 +8459,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -8391,7 +8473,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "parity-scale-codec", "scale-info", @@ -8550,7 +8632,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "platforms", ] @@ -8558,7 +8640,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -8577,7 +8659,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "hyper", "log", @@ -8589,7 +8671,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "array-bytes", "async-trait", @@ -8615,7 +8697,7 @@ dependencies = [ [[package]] name = "substrate-test-runtime" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "cfg-if", "frame-support", @@ -8632,13 +8714,13 @@ dependencies = [ "serde", "sp-api", "sp-application-crypto", - "sp-beefy", "sp-block-builder", "sp-consensus-aura", "sp-consensus-babe", + "sp-consensus-beefy", + "sp-consensus-grandpa", "sp-core", "sp-externalities", - "sp-finality-grandpa", "sp-inherents", "sp-io", "sp-keyring", @@ -8658,11 +8740,12 @@ dependencies = [ [[package]] name = "substrate-test-runtime-client" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "futures", "parity-scale-codec", "sc-block-builder", + "sc-chain-spec", "sc-client-api", "sc-consensus", "sp-api", @@ -8677,7 +8760,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.39#1837f423b494254e1d27834b1c9da34b2c0c2375" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" dependencies = [ "ansi_term", "build-helper", @@ -9146,11 +9229,11 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.25.1" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3390c0409daaa6027d6681393316f4ccd3ff82e1590a1e4725014e3ae2bf1920" +checksum = "767abe6ffed88a1889671a102c2861ae742726f52e0a5a425b92c9fbfa7e9c85" dependencies = [ - "hash-db", + "hash-db 0.16.0", "hashbrown 0.13.2", "log", "rustc-hex", @@ -9159,11 +9242,11 @@ dependencies = [ [[package]] name = "trie-root" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a36c5ca3911ed3c9a5416ee6c679042064b93fc637ded67e25f92e68d783891" +checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" dependencies = [ - "hash-db", + "hash-db 0.16.0", ] [[package]] @@ -9172,7 +9255,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" dependencies = [ - "hash-db", + "hash-db 0.15.2", "rlp", ] @@ -9261,7 +9344,7 @@ checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", "digest 0.10.6", - "rand 0.8.5", + "rand 0.7.3", "static_assertions", ] @@ -9625,9 +9708,9 @@ dependencies = [ [[package]] name = "wasmtime" -version = "6.0.0" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9010891d0b8e367c3be94ca35d7bc25c1de3240463bb1d61bcfc8c2233c4e0d0" +checksum = "f6e89f9819523447330ffd70367ef4a18d8c832e24e8150fe054d1d912841632" dependencies = [ "anyhow", "bincode", @@ -9653,18 +9736,18 @@ dependencies = [ [[package]] name = "wasmtime-asm-macros" -version = "6.0.0" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65805c663eaa8257b910666f6d4b056b5c7329750da754ba5df54f3af7dbf35c" +checksum = "9bd3a5e46c198032da934469f3a6e48649d1f9142438e4fd4617b68a35644b8a" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "6.0.0" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2049ddfc1b10efc3c5591d0e84b9570ca50478f8818f3bfabb1a467918f53fb4" +checksum = "b389ae9b678b9c3851091a4804f4182d688d27aff7abc9aa37fa7be37d8ecffa" dependencies = [ "anyhow", "base64 0.13.1", @@ -9672,7 +9755,7 @@ dependencies = [ "directories-next", "file-per-thread-logger", "log", - "rustix", + "rustix 0.36.7", "serde", "sha2 0.10.6", "toml", @@ -9682,9 +9765,9 @@ dependencies = [ [[package]] name = "wasmtime-cranelift" -version = "6.0.0" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9065cad6a724fa838ec8497567e0b23acc26417bb2449f8d9d2021925c72f2" +checksum = "59b2c92a08c0db6efffd88fdc97d7aa9c7c63b03edb0971dbca745469f820e8c" dependencies = [ "anyhow", "cranelift-codegen", @@ -9703,9 +9786,9 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "6.0.0" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f964bb0b91fa021b8d1b488c62cc77b346c1dae6e3ebd010050b57c1f2ca657" +checksum = "9a6db9fc52985ba06ca601f2ff0ff1f526c5d724c7ac267b47326304b0c97883" dependencies = [ "anyhow", "cranelift-entity", @@ -9722,9 +9805,9 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "6.0.0" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7a1d06f5d109539e0168fc74fa65e3948ac8dac3bb8cdbd08b62b36a0ae27b8" +checksum = "b77e3a52cd84d0f7f18554afa8060cfe564ccac61e3b0802d3fd4084772fa5f6" dependencies = [ "addr2line 0.17.0", "anyhow", @@ -9746,20 +9829,20 @@ dependencies = [ [[package]] name = "wasmtime-jit-debug" -version = "6.0.0" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f76ef2e410329aaf8555ac6571d6fe07711be0646dcdf7ff3ab750a42ed2e583" +checksum = "d0245e8a9347017c7185a72e215218a802ff561545c242953c11ba00fccc930f" dependencies = [ "object 0.29.0", "once_cell", - "rustix", + "rustix 0.36.7", ] [[package]] name = "wasmtime-jit-icache-coherence" -version = "6.0.0" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec1fd0f0dd79e7cc0f55b102e320d7c77ab76cd272008a8fd98e25b5777e2636" +checksum = "67d412e9340ab1c83867051d8d1d7c90aa8c9afc91da086088068e2734e25064" dependencies = [ "cfg-if", "libc", @@ -9768,9 +9851,9 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "6.0.0" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271aef9b4ca2e953a866293683f2db33cda46f6933c5e431e68d8373723d4ab6" +checksum = "d594e791b5fdd4dbaf8cf7ae62f2e4ff85018ce90f483ca6f42947688e48827d" dependencies = [ "anyhow", "cc", @@ -9783,7 +9866,7 @@ dependencies = [ "memoffset 0.6.5", "paste", "rand 0.8.5", - "rustix", + "rustix 0.36.7", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", @@ -9792,9 +9875,9 @@ dependencies = [ [[package]] name = "wasmtime-types" -version = "6.0.0" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b18144b0e45479a830ac9fcebfc71a16d90dc72d8ebd5679700eb3bfe974d7df" +checksum = "a6688d6f96d4dbc1f89fab626c56c1778936d122b5f4ae7a57c2eb42b8d982e2" dependencies = [ "cranelift-entity", "serde", @@ -10046,7 +10129,7 @@ dependencies = [ "lazy_static", "libc", "log", - "nix 0.24.3", + "nix", "rand 0.8.5", "thiserror", "tokio", diff --git a/Cargo.toml b/Cargo.toml index af0d9c4d9e..a1ac48f6bd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,7 @@ repository = "https://github.com/paritytech/frontier/" [workspace.dependencies] bn = { package = "substrate-bn", version = "0.6", default-features = false } -environmental = { version = "1.1.3", default-features = false } +environmental = { version = "1.1.4", default-features = false } ethereum = { version = "0.14.0", default-features = false } ethereum-types = { version = "0.14.1", default-features = false } evm = { version = "0.37.0", default-features = false } @@ -47,79 +47,80 @@ jsonrpsee = "0.16.2" kvdb-rocksdb = "0.17.0" libsecp256k1 = { version = "0.7.1", default-features = false } log = { version = "0.4.17", default-features = false } -parity-db = "0.4.2" +parity-db = "0.4.6" rlp = { version = "0.5", default-features = false } scale-codec = { package = "parity-scale-codec", version = "3.2.1", default-features = false, features = ["derive"] } scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" # Substrate Client -sc-basic-authorship = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-block-builder = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-chain-spec = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-client-db = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-consensus-manual-seal = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-finality-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-network-common = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sc-utils = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +sc-basic-authorship = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-block-builder = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-chain-spec = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-client-db = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-consensus-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-consensus-manual-seal = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-network-common = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-network-sync = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sc-utils = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } # Substrate Primitive -sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-core = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-database = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-finality-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-io = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-keyring = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -sp-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-runtime = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-state-machine = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-std = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-storage = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-trie = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -sp-version = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sp-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-consensus-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-core = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-database = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-io = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-keyring = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +sp-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-runtime = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-state-machine = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-std = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-storage = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-trie = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +sp-version = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } # Substrate FRAME -frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -frame-executive = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -frame-system-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -frame-system-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-aura = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-sudo = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-transaction-payment = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -pallet-transaction-payment-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } -pallet-utility = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39", default-features = false } +frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +frame-executive = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +frame-system-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +frame-system-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-aura = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-sudo = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-transaction-payment = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +pallet-transaction-payment-rpc-runtime-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +pallet-utility = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } # Substrate Utility -frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } -substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.39" } +frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } +substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" } # Frontier Client fc-cli = { version = "1.0.0-dev", path = "client/cli" } fc-consensus = { version = "2.0.0-dev", path = "client/consensus" } diff --git a/HEADER-APACHE2 b/HEADER-APACHE2 new file mode 100644 index 0000000000..981528be5f --- /dev/null +++ b/HEADER-APACHE2 @@ -0,0 +1,16 @@ +// This file is part of Frontier. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. diff --git a/client/consensus/Cargo.toml b/client/consensus/Cargo.toml index 5330da29fe..5afdb76916 100644 --- a/client/consensus/Cargo.toml +++ b/client/consensus/Cargo.toml @@ -17,7 +17,6 @@ thiserror = "1.0" sc-consensus = { workspace = true } sp-api = { workspace = true } sp-block-builder = { workspace = true, features = ["default"] } -sp-blockchain = { workspace = true } sp-consensus = { workspace = true } sp-runtime = { workspace = true } # Frontier diff --git a/client/consensus/src/lib.rs b/client/consensus/src/lib.rs index d65655427d..c9575196e8 100644 --- a/client/consensus/src/lib.rs +++ b/client/consensus/src/lib.rs @@ -18,13 +18,12 @@ #![deny(unused_crate_dependencies)] -use std::{collections::HashMap, marker::PhantomData, sync::Arc}; +use std::{marker::PhantomData, sync::Arc}; // Substrate use sc_consensus::{BlockCheckParams, BlockImport, BlockImportParams, ImportResult}; use sp_api::ProvideRuntimeApi; use sp_block_builder::BlockBuilder as BlockBuilderApi; -use sp_blockchain::well_known_cache_keys::Id as CacheKeyId; use sp_consensus::Error as ConsensusError; use sp_runtime::traits::{Block as BlockT, Header as HeaderT}; // Frontier @@ -120,16 +119,12 @@ where async fn import_block( &mut self, block: BlockImportParams, - new_cache: HashMap>, ) -> Result { // We validate that there are only one frontier log. No other // actions are needed and mapping syncing is delegated to a separate // worker. ensure_log(block.header.digest()).map_err(Error::from)?; - self.inner - .import_block(block, new_cache) - .await - .map_err(Into::into) + self.inner.import_block(block).await.map_err(Into::into) } } diff --git a/client/mapping-sync/src/worker.rs b/client/mapping-sync/src/worker.rs index 1299bd7f25..fc3b7c945f 100644 --- a/client/mapping-sync/src/worker.rs +++ b/client/mapping-sync/src/worker.rs @@ -174,7 +174,6 @@ mod tests { use crate::{EthereumBlockNotification, EthereumBlockNotificationSinks}; use fc_storage::{OverrideHandle, SchemaV3Override, StorageOverride}; use fp_storage::{EthereumStorageSchema, PALLET_ETHEREUM_SCHEMA}; - use futures::executor; use sc_block_builder::BlockBuilderProvider; use sc_client_api::BlockchainEvents; use sp_api::Encode; @@ -318,10 +317,10 @@ mod tests { } // Let's produce a block, which we expect to trigger a channel message - let mut builder = client.new_block(ethereum_digest()).unwrap(); + let builder = client.new_block(ethereum_digest()).unwrap(); let block = builder.build().unwrap().block; let block_hash = block.header.hash(); - client.import(BlockOrigin::Own, block).await; + let _res = client.import(BlockOrigin::Own, block).await; // Receive assert_eq!( @@ -355,10 +354,10 @@ mod tests { // Let's produce another block, this not only triggers a message in the new channel // but also removes the closed channels from the pool. - let mut builder = client.new_block(ethereum_digest()).unwrap(); + let builder = client.new_block(ethereum_digest()).unwrap(); let block = builder.build().unwrap().block; let block_hash = block.header.hash(); - client.import(BlockOrigin::Own, block).await; + let _res = client.import(BlockOrigin::Own, block).await; // Receive assert_eq!( @@ -456,10 +455,9 @@ mod tests { } // Let's produce a block, which we expect to trigger a channel message - let mut builder = client.new_block(ethereum_digest()).unwrap(); + let builder = client.new_block(ethereum_digest()).unwrap(); let block = builder.build().unwrap().block; - let block_hash = block.header.hash(); - client.import(BlockOrigin::Own, block).await; + let _res = client.import(BlockOrigin::Own, block).await; // Not received, channel closed because major syncing assert!(block_notification_stream.next().await.is_none()); diff --git a/client/rpc-core/src/eth.rs b/client/rpc-core/src/eth.rs index 407e495115..244df26fcb 100644 --- a/client/rpc-core/src/eth.rs +++ b/client/rpc-core/src/eth.rs @@ -19,7 +19,7 @@ //! Eth rpc interface. use ethereum_types::{H160, H256, H64, U256, U64}; -use jsonrpsee::{core::RpcResult as Result, proc_macros::rpc}; +use jsonrpsee::{core::RpcResult, proc_macros::rpc}; use std::collections::BTreeMap; use crate::types::*; @@ -34,29 +34,29 @@ pub trait EthApi { /// Returns protocol version encoded as a string (quotes are necessary). #[method(name = "eth_protocolVersion")] - fn protocol_version(&self) -> Result; + fn protocol_version(&self) -> RpcResult; /// Returns an object with data about the sync status or false. (wtf?) #[method(name = "eth_syncing")] - fn syncing(&self) -> Result; + fn syncing(&self) -> RpcResult; /// Returns block author. #[method(name = "eth_coinbase")] - fn author(&self) -> Result; + fn author(&self) -> RpcResult; /// Returns accounts list. #[method(name = "eth_accounts")] - fn accounts(&self) -> Result>; + fn accounts(&self) -> RpcResult>; /// Returns highest block number. #[method(name = "eth_blockNumber")] - fn block_number(&self) -> Result; + fn block_number(&self) -> RpcResult; /// Returns the chain ID used for transaction signing at the /// current best block. None is returned if not /// available. #[method(name = "eth_chainId")] - fn chain_id(&self) -> Result>; + fn chain_id(&self) -> RpcResult>; // ######################################################################## // Block @@ -64,31 +64,39 @@ pub trait EthApi { /// Returns block with given hash. #[method(name = "eth_getBlockByHash")] - async fn block_by_hash(&self, hash: H256, full: bool) -> Result>; + async fn block_by_hash(&self, hash: H256, full: bool) -> RpcResult>; /// Returns block with given number. #[method(name = "eth_getBlockByNumber")] - async fn block_by_number(&self, number: BlockNumber, full: bool) -> Result>; + async fn block_by_number( + &self, + number: BlockNumber, + full: bool, + ) -> RpcResult>; /// Returns the number of transactions in a block with given hash. #[method(name = "eth_getBlockTransactionCountByHash")] - fn block_transaction_count_by_hash(&self, hash: H256) -> Result>; + fn block_transaction_count_by_hash(&self, hash: H256) -> RpcResult>; /// Returns the number of transactions in a block with given block number. #[method(name = "eth_getBlockTransactionCountByNumber")] - fn block_transaction_count_by_number(&self, number: BlockNumber) -> Result>; + fn block_transaction_count_by_number(&self, number: BlockNumber) -> RpcResult>; /// Returns the number of uncles in a block with given hash. #[method(name = "eth_getUncleCountByBlockHash")] - fn block_uncles_count_by_hash(&self, hash: H256) -> Result; + fn block_uncles_count_by_hash(&self, hash: H256) -> RpcResult; /// Returns the number of uncles in a block with given block number. #[method(name = "eth_getUncleCountByBlockNumber")] - fn block_uncles_count_by_number(&self, number: BlockNumber) -> Result; + fn block_uncles_count_by_number(&self, number: BlockNumber) -> RpcResult; /// Returns an uncles at given block and index. #[method(name = "eth_getUncleByBlockHashAndIndex")] - fn uncle_by_block_hash_and_index(&self, hash: H256, index: Index) -> Result>; + fn uncle_by_block_hash_and_index( + &self, + hash: H256, + index: Index, + ) -> RpcResult>; /// Returns an uncles at given block and index. #[method(name = "eth_getUncleByBlockNumberAndIndex")] @@ -96,7 +104,7 @@ pub trait EthApi { &self, number: BlockNumber, index: Index, - ) -> Result>; + ) -> RpcResult>; // ######################################################################## // Transaction @@ -104,7 +112,7 @@ pub trait EthApi { /// Get transaction by its hash. #[method(name = "eth_getTransactionByHash")] - async fn transaction_by_hash(&self, hash: H256) -> Result>; + async fn transaction_by_hash(&self, hash: H256) -> RpcResult>; /// Returns transaction at given block hash and index. #[method(name = "eth_getTransactionByBlockHashAndIndex")] @@ -112,7 +120,7 @@ pub trait EthApi { &self, hash: H256, index: Index, - ) -> Result>; + ) -> RpcResult>; /// Returns transaction by given block number and index. #[method(name = "eth_getTransactionByBlockNumberAndIndex")] @@ -120,11 +128,11 @@ pub trait EthApi { &self, number: BlockNumber, index: Index, - ) -> Result>; + ) -> RpcResult>; /// Returns transaction receipt by transaction hash. #[method(name = "eth_getTransactionReceipt")] - async fn transaction_receipt(&self, hash: H256) -> Result>; + async fn transaction_receipt(&self, hash: H256) -> RpcResult>; // ######################################################################## // State @@ -132,19 +140,24 @@ pub trait EthApi { /// Returns balance of the given account. #[method(name = "eth_getBalance")] - fn balance(&self, address: H160, number: Option) -> Result; + fn balance(&self, address: H160, number: Option) -> RpcResult; /// Returns content of the storage at given address. #[method(name = "eth_getStorageAt")] - fn storage_at(&self, address: H160, index: U256, number: Option) -> Result; + fn storage_at( + &self, + address: H160, + index: U256, + number: Option, + ) -> RpcResult; /// Returns the number of transactions sent from given address at given time (block number). #[method(name = "eth_getTransactionCount")] - fn transaction_count(&self, address: H160, number: Option) -> Result; + fn transaction_count(&self, address: H160, number: Option) -> RpcResult; /// Returns the code at given address at given time (block number). #[method(name = "eth_getCode")] - fn code_at(&self, address: H160, number: Option) -> Result; + fn code_at(&self, address: H160, number: Option) -> RpcResult; // ######################################################################## // Execute @@ -157,12 +170,15 @@ pub trait EthApi { request: CallRequest, number: Option, state_overrides: Option>, - ) -> Result; + ) -> RpcResult; /// Estimate gas needed for execution of given contract. #[method(name = "eth_estimateGas")] - async fn estimate_gas(&self, request: CallRequest, number: Option) - -> Result; + async fn estimate_gas( + &self, + request: CallRequest, + number: Option, + ) -> RpcResult; // ######################################################################## // Fee @@ -170,7 +186,7 @@ pub trait EthApi { /// Returns current gas_price. #[method(name = "eth_gasPrice")] - fn gas_price(&self) -> Result; + fn gas_price(&self) -> RpcResult; /// Introduced in EIP-1159 for getting information on the appropriate priority fee to use. #[method(name = "eth_feeHistory")] @@ -179,12 +195,12 @@ pub trait EthApi { block_count: U256, newest_block: BlockNumber, reward_percentiles: Option>, - ) -> Result; + ) -> RpcResult; /// Introduced in EIP-1159, a Geth-specific and simplified priority fee oracle. /// Leverages the already existing fee history cache. #[method(name = "eth_maxPriorityFeePerGas")] - fn max_priority_fee_per_gas(&self) -> Result; + fn max_priority_fee_per_gas(&self) -> RpcResult; // ######################################################################## // Mining @@ -192,23 +208,23 @@ pub trait EthApi { /// Returns true if client is actively mining new blocks. #[method(name = "eth_mining")] - fn is_mining(&self) -> Result; + fn is_mining(&self) -> RpcResult; /// Returns the number of hashes per second that the node is mining with. #[method(name = "eth_hashrate")] - fn hashrate(&self) -> Result; + fn hashrate(&self) -> RpcResult; /// Returns the hash of the current block, the seedHash, and the boundary condition to be met. #[method(name = "eth_getWork")] - fn work(&self) -> Result; + fn work(&self) -> RpcResult; /// Used for submitting mining hashrate. #[method(name = "eth_submitHashrate")] - fn submit_hashrate(&self, hashrate: U256, id: H256) -> Result; + fn submit_hashrate(&self, hashrate: U256, id: H256) -> RpcResult; /// Used for submitting a proof-of-work solution. #[method(name = "eth_submitWork")] - fn submit_work(&self, nonce: H64, pow_hash: H256, mix_digest: H256) -> Result; + fn submit_work(&self, nonce: H64, pow_hash: H256, mix_digest: H256) -> RpcResult; // ######################################################################## // Submit @@ -217,11 +233,11 @@ pub trait EthApi { /// Sends transaction; will block waiting for signer to return the /// transaction hash. #[method(name = "eth_sendTransaction")] - async fn send_transaction(&self, request: TransactionRequest) -> Result; + async fn send_transaction(&self, request: TransactionRequest) -> RpcResult; /// Sends signed transaction, returning its hash. #[method(name = "eth_sendRawTransaction")] - async fn send_raw_transaction(&self, bytes: Bytes) -> Result; + async fn send_raw_transaction(&self, bytes: Bytes) -> RpcResult; } /// Eth filters rpc api (polling). @@ -229,29 +245,29 @@ pub trait EthApi { pub trait EthFilterApi { /// Returns id of new filter. #[method(name = "eth_newFilter")] - fn new_filter(&self, filter: Filter) -> Result; + fn new_filter(&self, filter: Filter) -> RpcResult; /// Returns id of new block filter. #[method(name = "eth_newBlockFilter")] - fn new_block_filter(&self) -> Result; + fn new_block_filter(&self) -> RpcResult; /// Returns id of new block filter. #[method(name = "eth_newPendingTransactionFilter")] - fn new_pending_transaction_filter(&self) -> Result; + fn new_pending_transaction_filter(&self) -> RpcResult; /// Returns filter changes since last poll. #[method(name = "eth_getFilterChanges")] - async fn filter_changes(&self, index: Index) -> Result; + async fn filter_changes(&self, index: Index) -> RpcResult; /// Returns all logs matching given filter (in a range 'from' - 'to'). #[method(name = "eth_getFilterLogs")] - async fn filter_logs(&self, index: Index) -> Result>; + async fn filter_logs(&self, index: Index) -> RpcResult>; /// Uninstalls filter. #[method(name = "eth_uninstallFilter")] - fn uninstall_filter(&self, index: Index) -> Result; + fn uninstall_filter(&self, index: Index) -> RpcResult; /// Returns logs matching given filter object. #[method(name = "eth_getLogs")] - async fn logs(&self, filter: Filter) -> Result>; + async fn logs(&self, filter: Filter) -> RpcResult>; } diff --git a/client/rpc-core/src/net.rs b/client/rpc-core/src/net.rs index ddee51ca21..5eb2a9ea96 100644 --- a/client/rpc-core/src/net.rs +++ b/client/rpc-core/src/net.rs @@ -18,7 +18,7 @@ //! Net rpc interface. -use jsonrpsee::{core::RpcResult as Result, proc_macros::rpc}; +use jsonrpsee::{core::RpcResult, proc_macros::rpc}; use crate::types::PeerCount; @@ -27,14 +27,14 @@ use crate::types::PeerCount; pub trait NetApi { /// Returns protocol version. #[method(name = "net_version")] - fn version(&self) -> Result; + fn version(&self) -> RpcResult; /// Returns number of peers connected to node. #[method(name = "net_peerCount")] - fn peer_count(&self) -> Result; + fn peer_count(&self) -> RpcResult; /// Returns true if client is actively listening for network connections. /// Otherwise false. #[method(name = "net_listening")] - fn is_listening(&self) -> Result; + fn is_listening(&self) -> RpcResult; } diff --git a/client/rpc-core/src/types/account_info.rs b/client/rpc-core/src/types/account_info.rs index 103ce0f92b..feee617703 100644 --- a/client/rpc-core/src/types/account_info.rs +++ b/client/rpc-core/src/types/account_info.rs @@ -18,10 +18,11 @@ //! Return types for RPC calls -use crate::types::Bytes; use ethereum_types::{Address, Public, H160, H256, U256}; use serde::Serialize; +use crate::types::Bytes; + /// Account information. #[derive(Clone, Debug, Default, Eq, PartialEq, Serialize)] pub struct AccountInfo { diff --git a/client/rpc-core/src/types/block.rs b/client/rpc-core/src/types/block.rs index e1fbefd186..0ab435e253 100644 --- a/client/rpc-core/src/types/block.rs +++ b/client/rpc-core/src/types/block.rs @@ -18,10 +18,11 @@ use std::{collections::BTreeMap, ops::Deref}; -use crate::types::{Bytes, Transaction}; use ethereum_types::{Bloom as H2048, H160, H256, H64, U256}; use serde::{ser::Error, Serialize, Serializer}; +use crate::types::{Bytes, Transaction}; + /// Block Transactions #[derive(Debug)] pub enum BlockTransactions { diff --git a/client/rpc-core/src/types/block_number.rs b/client/rpc-core/src/types/block_number.rs index c61c4c9ed1..d566847717 100644 --- a/client/rpc-core/src/types/block_number.rs +++ b/client/rpc-core/src/types/block_number.rs @@ -16,12 +16,13 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +use std::fmt; + use ethereum_types::H256; use serde::{ de::{Error, MapAccess, Visitor}, Deserialize, Deserializer, Serialize, Serializer, }; -use std::fmt; /// Represents rpc api block number param. #[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)] diff --git a/client/rpc-core/src/types/bytes.rs b/client/rpc-core/src/types/bytes.rs index 12001352be..4978d99a9c 100644 --- a/client/rpc-core/src/types/bytes.rs +++ b/client/rpc-core/src/types/bytes.rs @@ -18,12 +18,13 @@ //! Serializable wrapper around vector of bytes +use std::fmt; + use rustc_hex::{FromHex, ToHex}; use serde::{ de::{Error, Visitor}, Deserialize, Deserializer, Serialize, Serializer, }; -use std::fmt; /// Wrapper structure around vector of bytes. #[derive(Clone, Debug, Default, Eq, PartialEq, Hash)] diff --git a/client/rpc-core/src/types/call_request.rs b/client/rpc-core/src/types/call_request.rs index 163b18af9b..2e014d3475 100644 --- a/client/rpc-core/src/types/call_request.rs +++ b/client/rpc-core/src/types/call_request.rs @@ -16,11 +16,13 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use crate::types::Bytes; +use std::collections::BTreeMap; + use ethereum::AccessListItem; use ethereum_types::{H160, H256, U256}; use serde::Deserialize; -use std::collections::BTreeMap; + +use crate::types::Bytes; /// Call request #[derive(Clone, Debug, Default, Eq, PartialEq, Deserialize)] diff --git a/client/rpc-core/src/types/fee.rs b/client/rpc-core/src/types/fee.rs index 41960ff4b2..db2edc6890 100644 --- a/client/rpc-core/src/types/fee.rs +++ b/client/rpc-core/src/types/fee.rs @@ -16,13 +16,14 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use ethereum_types::U256; -use serde::Serialize; use std::{ collections::BTreeMap, sync::{Arc, Mutex}, }; +use ethereum_types::U256; +use serde::Serialize; + /// `eth_feeHistory` response #[derive(Debug, Serialize)] #[serde(rename_all = "camelCase")] diff --git a/client/rpc-core/src/types/filter.rs b/client/rpc-core/src/types/filter.rs index 72ffe325ce..6fa1adfc46 100644 --- a/client/rpc-core/src/types/filter.rs +++ b/client/rpc-core/src/types/filter.rs @@ -16,17 +16,17 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use core::convert::AsRef; +use std::{ + collections::BTreeMap, + sync::{Arc, Mutex}, +}; + use ethereum_types::{Bloom, BloomInput, H160, H256, U256}; use serde::{ de::{DeserializeOwned, Error}, Deserialize, Deserializer, Serialize, Serializer, }; use serde_json::{from_value, Value}; -use std::{ - collections::BTreeMap, - sync::{Arc, Mutex}, -}; use crate::types::{BlockNumber, Log}; diff --git a/client/rpc-core/src/types/index.rs b/client/rpc-core/src/types/index.rs index 26c981fac7..cf859e169d 100644 --- a/client/rpc-core/src/types/index.rs +++ b/client/rpc-core/src/types/index.rs @@ -16,11 +16,12 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +use std::fmt; + use serde::{ de::{Error, Visitor}, Deserialize, Deserializer, }; -use std::fmt; /// Represents usize. #[derive(Debug, Eq, PartialEq)] diff --git a/client/rpc-core/src/types/log.rs b/client/rpc-core/src/types/log.rs index 6bc5b0cd85..82fe0b7b8b 100644 --- a/client/rpc-core/src/types/log.rs +++ b/client/rpc-core/src/types/log.rs @@ -16,10 +16,11 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use crate::types::Bytes; use ethereum_types::{H160, H256, U256}; use serde::Serialize; +use crate::types::Bytes; + /// Log #[derive(Clone, Debug, Eq, PartialEq, Hash, Serialize)] #[serde(rename_all = "camelCase")] diff --git a/client/rpc-core/src/types/pubsub.rs b/client/rpc-core/src/types/pubsub.rs index 5075a59e49..ba2940b6bd 100644 --- a/client/rpc-core/src/types/pubsub.rs +++ b/client/rpc-core/src/types/pubsub.rs @@ -18,11 +18,12 @@ //! Pub-Sub types. -use crate::types::{Filter, Log, RichHeader}; use ethereum_types::H256; use serde::{de::Error, Deserialize, Deserializer, Serialize, Serializer}; use serde_json::{from_value, Value}; +use crate::types::{Filter, Log, RichHeader}; + /// Subscription result. #[derive(Clone, Debug, Eq, PartialEq)] pub enum Result { diff --git a/client/rpc-core/src/types/receipt.rs b/client/rpc-core/src/types/receipt.rs index 985b0016cb..2c62840479 100644 --- a/client/rpc-core/src/types/receipt.rs +++ b/client/rpc-core/src/types/receipt.rs @@ -16,10 +16,11 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use crate::types::Log; use ethereum_types::{Bloom as H2048, H160, H256, U256, U64}; use serde::Serialize; +use crate::types::Log; + /// Receipt #[derive(Clone, Debug, Serialize)] #[serde(rename_all = "camelCase")] diff --git a/client/rpc-core/src/types/transaction.rs b/client/rpc-core/src/types/transaction.rs index 706e1f0941..6306df69e0 100644 --- a/client/rpc-core/src/types/transaction.rs +++ b/client/rpc-core/src/types/transaction.rs @@ -16,11 +16,12 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use crate::types::Bytes; use ethereum::{AccessListItem, TransactionV2}; use ethereum_types::{H160, H256, H512, U256, U64}; use serde::{ser::SerializeStruct, Serialize, Serializer}; +use crate::types::Bytes; + /// Transaction #[derive(Clone, Debug, Default, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] diff --git a/client/rpc-core/src/types/transaction_request.rs b/client/rpc-core/src/types/transaction_request.rs index 43097f6a93..a263f4a7f1 100644 --- a/client/rpc-core/src/types/transaction_request.rs +++ b/client/rpc-core/src/types/transaction_request.rs @@ -18,13 +18,14 @@ //! `TransactionRequest` type -use crate::types::Bytes; use ethereum::{ AccessListItem, EIP1559TransactionMessage, EIP2930TransactionMessage, LegacyTransactionMessage, }; use ethereum_types::{H160, U256}; use serde::{Deserialize, Serialize}; +use crate::types::Bytes; + pub enum TransactionMessage { Legacy(LegacyTransactionMessage), EIP2930(EIP2930TransactionMessage), diff --git a/client/rpc-core/src/types/work.rs b/client/rpc-core/src/types/work.rs index b4c198978d..88af66691e 100644 --- a/client/rpc-core/src/types/work.rs +++ b/client/rpc-core/src/types/work.rs @@ -17,7 +17,6 @@ // along with this program. If not, see . use ethereum_types::{H256, U256}; - use serde::{Serialize, Serializer}; /// The result of an `eth_getWork` call: it differs based on an option diff --git a/client/rpc-core/src/web3.rs b/client/rpc-core/src/web3.rs index e2c71da222..9ad9638293 100644 --- a/client/rpc-core/src/web3.rs +++ b/client/rpc-core/src/web3.rs @@ -19,7 +19,7 @@ //! Web3 rpc interface. use ethereum_types::H256; -use jsonrpsee::{core::RpcResult as Result, proc_macros::rpc}; +use jsonrpsee::{core::RpcResult, proc_macros::rpc}; use crate::types::Bytes; @@ -28,9 +28,9 @@ use crate::types::Bytes; pub trait Web3Api { /// Returns current client version. #[method(name = "web3_clientVersion")] - fn client_version(&self) -> Result; + fn client_version(&self) -> RpcResult; /// Returns sha3 of the given data #[method(name = "web3_sha3")] - fn sha3(&self, input: Bytes) -> Result; + fn sha3(&self, input: Bytes) -> RpcResult; } diff --git a/client/rpc/Cargo.toml b/client/rpc/Cargo.toml index 97f2a788c7..820bdbb4ed 100644 --- a/client/rpc/Cargo.toml +++ b/client/rpc/Cargo.toml @@ -27,11 +27,11 @@ scale-codec = { package = "parity-scale-codec", workspace = true } tokio = { version = "1.24", features = ["sync"] } # Substrate -pallet-evm = { workspace = true } prometheus-endpoint = { workspace = true } sc-client-api = { workspace = true } sc-network = { workspace = true } sc-network-common = { workspace = true } +sc-network-sync = { workspace = true } sc-rpc = { workspace = true } sc-service = { workspace = true } sc-transaction-pool = { workspace = true } @@ -55,6 +55,7 @@ fp-ethereum = { workspace = true, features = ["default"] } fp-evm = { workspace = true } fp-rpc = { workspace = true, features = ["default"] } fp-storage = { workspace = true, features = ["default"] } +pallet-evm = { workspace = true } [dev-dependencies] tempfile = "3.3.0" diff --git a/client/rpc/src/eth/block.rs b/client/rpc/src/eth/block.rs index 7ec24f3b81..a4169e8b00 100644 --- a/client/rpc/src/eth/block.rs +++ b/client/rpc/src/eth/block.rs @@ -19,10 +19,9 @@ use std::sync::Arc; use ethereum_types::{H256, U256}; -use jsonrpsee::core::RpcResult as Result; +use jsonrpsee::core::RpcResult; // Substrate use sc_client_api::backend::{Backend, StorageProvider}; -use sc_network_common::ExHashT; use sc_transaction_pool::ChainApi; use sp_api::{HeaderT, ProvideRuntimeApi}; use sp_blockchain::HeaderBackend; @@ -37,7 +36,7 @@ use crate::{ frontier_backend_client, internal_err, }; -impl> Eth +impl> Eth where B: BlockT, C: ProvideRuntimeApi, @@ -45,7 +44,7 @@ where C: HeaderBackend + StorageProvider + 'static, BE: Backend, { - pub async fn block_by_hash(&self, hash: H256, full: bool) -> Result> { + pub async fn block_by_hash(&self, hash: H256, full: bool) -> RpcResult> { let client = Arc::clone(&self.client); let block_data_cache = Arc::clone(&self.block_data_cache); let backend = Arc::clone(&self.backend); @@ -112,7 +111,7 @@ where &self, number: BlockNumber, full: bool, - ) -> Result> { + ) -> RpcResult> { let client = Arc::clone(&self.client); let block_data_cache = Arc::clone(&self.block_data_cache); let backend = Arc::clone(&self.backend); @@ -190,7 +189,7 @@ where } } - pub fn block_transaction_count_by_hash(&self, hash: H256) -> Result> { + pub fn block_transaction_count_by_hash(&self, hash: H256) -> RpcResult> { let substrate_hash = match frontier_backend_client::load_hash::( self.client.as_ref(), self.backend.as_ref(), @@ -215,7 +214,10 @@ where } } - pub fn block_transaction_count_by_number(&self, number: BlockNumber) -> Result> { + pub fn block_transaction_count_by_number( + &self, + number: BlockNumber, + ) -> RpcResult> { if let BlockNumber::Pending = number { // get the pending transactions count return Ok(Some(U256::from( @@ -249,15 +251,15 @@ where } } - pub fn block_uncles_count_by_hash(&self, _: H256) -> Result { + pub fn block_uncles_count_by_hash(&self, _: H256) -> RpcResult { Ok(U256::zero()) } - pub fn block_uncles_count_by_number(&self, _: BlockNumber) -> Result { + pub fn block_uncles_count_by_number(&self, _: BlockNumber) -> RpcResult { Ok(U256::zero()) } - pub fn uncle_by_block_hash_and_index(&self, _: H256, _: Index) -> Result> { + pub fn uncle_by_block_hash_and_index(&self, _: H256, _: Index) -> RpcResult> { Ok(None) } @@ -265,7 +267,7 @@ where &self, _: BlockNumber, _: Index, - ) -> Result> { + ) -> RpcResult> { Ok(None) } } diff --git a/client/rpc/src/eth/client.rs b/client/rpc/src/eth/client.rs index 114e2e2e9d..b114adbfc7 100644 --- a/client/rpc/src/eth/client.rs +++ b/client/rpc/src/eth/client.rs @@ -17,10 +17,9 @@ // along with this program. If not, see . use ethereum_types::{H160, U256, U64}; -use jsonrpsee::core::RpcResult as Result; +use jsonrpsee::core::RpcResult; // Substrate use sc_client_api::backend::{Backend, StorageProvider}; -use sc_network_common::ExHashT; use sc_transaction_pool::ChainApi; use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; @@ -35,7 +34,7 @@ use crate::{ internal_err, }; -impl> Eth +impl> Eth where B: BlockT, C: ProvideRuntimeApi, @@ -43,12 +42,12 @@ where C: HeaderBackend + StorageProvider + 'static, BE: Backend, { - pub fn protocol_version(&self) -> Result { + pub fn protocol_version(&self) -> RpcResult { Ok(1) } - pub fn syncing(&self) -> Result { - if self.network.is_major_syncing() { + pub fn syncing(&self) -> RpcResult { + if self.sync.is_major_syncing() { let block_number = U256::from(UniqueSaturatedInto::::unique_saturated_into( self.client.info().best_number, )); @@ -67,7 +66,7 @@ where } } - pub fn author(&self) -> Result { + pub fn author(&self) -> RpcResult { let hash = self.client.info().best_hash; let schema = fc_storage::onchain_storage_schema(self.client.as_ref(), hash); @@ -82,7 +81,7 @@ where .beneficiary) } - pub fn accounts(&self) -> Result> { + pub fn accounts(&self) -> RpcResult> { let mut accounts = Vec::new(); for signer in &*self.signers { accounts.append(&mut signer.accounts()); @@ -90,13 +89,13 @@ where Ok(accounts) } - pub fn block_number(&self) -> Result { + pub fn block_number(&self) -> RpcResult { Ok(U256::from( UniqueSaturatedInto::::unique_saturated_into(self.client.info().best_number), )) } - pub fn chain_id(&self) -> Result> { + pub fn chain_id(&self) -> RpcResult> { let hash = self.client.info().best_hash; Ok(Some( self.client diff --git a/client/rpc/src/eth/execute.rs b/client/rpc/src/eth/execute.rs index 58de621806..4a80b3b26b 100644 --- a/client/rpc/src/eth/execute.rs +++ b/client/rpc/src/eth/execute.rs @@ -16,23 +16,25 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use std::{collections::BTreeMap, sync::Arc}; +use std::{cell::RefCell, collections::BTreeMap, sync::Arc}; use ethereum_types::{H160, H256, U256}; use evm::{ExitError, ExitReason}; -use jsonrpsee::core::RpcResult as Result; -use scale_codec::Encode; +use jsonrpsee::core::RpcResult; +use scale_codec::{Decode, Encode}; // Substrate use sc_client_api::backend::{Backend, StorageProvider}; -use sc_network_common::ExHashT; use sc_transaction_pool::ChainApi; -use sp_api::{ApiExt, CallApiAt, ProvideRuntimeApi}; +use sp_api::{ApiExt, CallApiAt, CallApiAtParams, ProvideRuntimeApi, StorageTransactionCache}; use sp_block_builder::BlockBuilder as BlockBuilderApi; use sp_blockchain::HeaderBackend; +use sp_core::ExecutionContext; use sp_io::hashing::{blake2_128, twox_128}; -use sp_runtime::{traits::Block as BlockT, SaturatedConversion}; +use sp_runtime::{traits::Block as BlockT, DispatchError, SaturatedConversion}; +use sp_state_machine::OverlayedChanges; // Frontier use fc_rpc_core::types::*; +use fp_evm::CallInfo; use fp_rpc::{EthereumRuntimeRPCApi, RuntimeStorageOverride}; use fp_storage::{EVM_ACCOUNT_CODES, PALLET_EVM}; @@ -62,12 +64,12 @@ impl EstimateGasAdapter for () { } } -impl> Eth +impl> Eth where B: BlockT, - C: ProvideRuntimeApi, + C: CallApiAt + ProvideRuntimeApi, C::Api: BlockBuilderApi + EthereumRuntimeRPCApi, - C: HeaderBackend + CallApiAt + StorageProvider + 'static, + C: HeaderBackend + StorageProvider + 'static, BE: Backend + 'static, A: ChainApi + 'static, { @@ -76,7 +78,7 @@ where request: CallRequest, number: Option, state_overrides: Option>, - ) -> Result { + ) -> RpcResult { let CallRequest { from, to, @@ -208,7 +210,7 @@ where Ok(Bytes(info.value)) } else if api_version == 4 { // Post-london + access list support - let encoded_params = sp_api::Encode::encode(&( + let encoded_params = Encode::encode(&( &from.unwrap_or_default(), &to, &data, @@ -226,38 +228,34 @@ where .collect::)>>(), ), )); - let overlayed_changes = self.create_overrides_overlay( substrate_hash, api_version, state_overrides, )?; - let storage_transaction_cache = std::cell::RefCell::< - sp_api::StorageTransactionCache, - >::default(); - let params = sp_api::CallApiAtParams { + let storage_transaction_cache = + RefCell::>::default(); + let params = CallApiAtParams { at: substrate_hash, function: "EthereumRuntimeRPCApi_call", arguments: encoded_params, - overlayed_changes: &std::cell::RefCell::new(overlayed_changes), + overlayed_changes: &RefCell::new(overlayed_changes), storage_transaction_cache: &storage_transaction_cache, - context: sp_api::ExecutionContext::OffchainCall(None), + context: ExecutionContext::OffchainCall(None), recorder: &None, }; + let info = self .client .call_api_at(params) .and_then(|r| { - std::result::Result::map_err( - as sp_api::Decode>::decode(&mut &r[..]), - |error| sp_api::ApiError::FailedToDecodeReturnValue { - function: "EthereumRuntimeRPCApi_call", - error, - }, - ) + Result::map_err( + as Decode>::decode(&mut &r[..]), + |error| sp_api::ApiError::FailedToDecodeReturnValue { + function: "EthereumRuntimeRPCApi_call", + error, + }, + ) }) .map_err(|err| internal_err(format!("runtime error: {:?}", err)))? .map_err(|err| internal_err(format!("execution fatal: {:?}", err)))?; @@ -355,7 +353,7 @@ where &self, request: CallRequest, number: Option, - ) -> Result { + ) -> RpcResult { let client = Arc::clone(&self.client); let block_data_cache = Arc::clone(&self.block_data_cache); @@ -494,7 +492,7 @@ where #[rustfmt::skip] let executable = move | request, gas_limit, api_version, api: sp_api::ApiRef<'_, C::Api>, estimate_mode - | -> Result { + | -> RpcResult { let CallRequest { from, to, @@ -766,8 +764,8 @@ where block_hash: B::Hash, api_version: u32, state_overrides: Option>, - ) -> Result { - let mut overlayed_changes = sp_api::OverlayedChanges::default(); + ) -> RpcResult { + let mut overlayed_changes = OverlayedChanges::default(); if let Some(state_overrides) = state_overrides { for (address, state_override) in state_overrides { if EC::RuntimeStorageOverride::is_enabled() { @@ -843,7 +841,7 @@ where } } -pub fn error_on_execution_failure(reason: &ExitReason, data: &[u8]) -> Result<()> { +pub fn error_on_execution_failure(reason: &ExitReason, data: &[u8]) -> RpcResult<()> { match reason { ExitReason::Succeed(_) => Ok(()), ExitReason::Error(e) => { @@ -894,7 +892,7 @@ fn fee_details( request_gas_price: Option, request_max_fee: Option, request_priority: Option, -) -> Result { +) -> RpcResult { match (request_gas_price, request_max_fee, request_priority) { (gas_price, None, None) => { // Legacy request, all default to gas price. diff --git a/client/rpc/src/eth/fee.rs b/client/rpc/src/eth/fee.rs index ec5a7042e2..102b9e6fb9 100644 --- a/client/rpc/src/eth/fee.rs +++ b/client/rpc/src/eth/fee.rs @@ -17,10 +17,9 @@ // along with this program. If not, see . use ethereum_types::U256; -use jsonrpsee::core::RpcResult as Result; +use jsonrpsee::core::RpcResult; // Substrate use sc_client_api::backend::{Backend, StorageProvider}; -use sc_network_common::ExHashT; use sc_transaction_pool::ChainApi; use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; @@ -34,7 +33,7 @@ use crate::{ frontier_backend_client, internal_err, }; -impl> Eth +impl> Eth where B: BlockT, C: ProvideRuntimeApi, @@ -42,7 +41,7 @@ where C: HeaderBackend + StorageProvider + 'static, BE: Backend + 'static, { - pub fn gas_price(&self) -> Result { + pub fn gas_price(&self) -> RpcResult { let block_hash = self.client.info().best_hash; self.client @@ -56,7 +55,7 @@ where block_count: U256, newest_block: BlockNumber, reward_percentiles: Option>, - ) -> Result { + ) -> RpcResult { // The max supported range size is 1024 by spec. let range_limit = U256::from(1024); let block_count = if block_count > range_limit { @@ -178,7 +177,7 @@ where ))) } - pub fn max_priority_fee_per_gas(&self) -> Result { + pub fn max_priority_fee_per_gas(&self) -> RpcResult { // https://github.com/ethereum/go-ethereum/blob/master/eth/ethconfig/config.go#L44-L51 let at_percentile = 60; let block_count = 20; diff --git a/client/rpc/src/eth/filter.rs b/client/rpc/src/eth/filter.rs index ef23800108..458b917fa8 100644 --- a/client/rpc/src/eth/filter.rs +++ b/client/rpc/src/eth/filter.rs @@ -20,7 +20,7 @@ use std::{marker::PhantomData, sync::Arc, time}; use ethereum::BlockV2 as EthereumBlock; use ethereum_types::{H256, U256}; -use jsonrpsee::core::{async_trait, RpcResult as Result}; +use jsonrpsee::core::{async_trait, RpcResult}; // Substrate use sc_client_api::backend::{Backend, StorageProvider}; use sp_api::ProvideRuntimeApi; @@ -72,7 +72,7 @@ where B: BlockT, C: HeaderBackend, { - fn create_filter(&self, filter_type: FilterType) -> Result { + fn create_filter(&self, filter_type: FilterType) -> RpcResult { let block_number = UniqueSaturatedInto::::unique_saturated_into(self.client.info().best_number); let pool = self.filter_pool.clone(); @@ -117,19 +117,19 @@ where C: HeaderBackend + StorageProvider + 'static, BE: Backend + 'static, { - fn new_filter(&self, filter: Filter) -> Result { + fn new_filter(&self, filter: Filter) -> RpcResult { self.create_filter(FilterType::Log(filter)) } - fn new_block_filter(&self) -> Result { + fn new_block_filter(&self) -> RpcResult { self.create_filter(FilterType::Block) } - fn new_pending_transaction_filter(&self) -> Result { + fn new_pending_transaction_filter(&self) -> RpcResult { Err(internal_err("Method not available.")) } - async fn filter_changes(&self, index: Index) -> Result { + async fn filter_changes(&self, index: Index) -> RpcResult { // There are multiple branches that needs to return async blocks. // Also, each branch need to (synchronously) do stuff with the pool // (behind a lock), and the lock should be released before entering @@ -278,13 +278,13 @@ where } } - async fn filter_logs(&self, index: Index) -> Result> { + async fn filter_logs(&self, index: Index) -> RpcResult> { let key = U256::from(index.value()); let pool = self.filter_pool.clone(); // We want to get the filter, while releasing the pool lock outside // of the async block. - let filter_result: Result = (|| { + let filter_result: RpcResult = (|| { let pool = pool .lock() .map_err(|_| internal_err("Filter pool is not available."))?; @@ -339,7 +339,7 @@ where Ok(ret) } - fn uninstall_filter(&self, index: Index) -> Result { + fn uninstall_filter(&self, index: Index) -> RpcResult { let key = U256::from(index.value()); let pool = self.filter_pool.clone(); // Try to lock. @@ -355,7 +355,7 @@ where response } - async fn logs(&self, filter: Filter) -> Result> { + async fn logs(&self, filter: Filter) -> RpcResult> { let client = Arc::clone(&self.client); let block_data_cache = Arc::clone(&self.block_data_cache); let backend = Arc::clone(&self.backend); @@ -423,7 +423,7 @@ async fn filter_range_logs( filter: &Filter, from: NumberFor, to: NumberFor, -) -> Result<()> +) -> RpcResult<()> where B: BlockT, C: ProvideRuntimeApi, diff --git a/client/rpc/src/eth/mining.rs b/client/rpc/src/eth/mining.rs index 190435f3e4..1d97ff4080 100644 --- a/client/rpc/src/eth/mining.rs +++ b/client/rpc/src/eth/mining.rs @@ -17,9 +17,8 @@ // along with this program. If not, see . use ethereum_types::{H256, H64, U256}; -use jsonrpsee::core::RpcResult as Result; +use jsonrpsee::core::RpcResult; // Substrate -use sc_network_common::ExHashT; use sc_transaction_pool::ChainApi; use sp_runtime::traits::Block as BlockT; // Frontier @@ -27,26 +26,24 @@ use fc_rpc_core::types::*; use crate::eth::{Eth, EthConfig}; -impl> - Eth -{ - pub fn is_mining(&self) -> Result { +impl> Eth { + pub fn is_mining(&self) -> RpcResult { Ok(self.is_authority) } - pub fn hashrate(&self) -> Result { + pub fn hashrate(&self) -> RpcResult { Ok(U256::zero()) } - pub fn work(&self) -> Result { + pub fn work(&self) -> RpcResult { Ok(Work::default()) } - pub fn submit_hashrate(&self, _: U256, _: H256) -> Result { + pub fn submit_hashrate(&self, _: U256, _: H256) -> RpcResult { Ok(false) } - pub fn submit_work(&self, _: H64, _: H256, _: H256) -> Result { + pub fn submit_work(&self, _: H64, _: H256, _: H256) -> RpcResult { Ok(false) } } diff --git a/client/rpc/src/eth/mod.rs b/client/rpc/src/eth/mod.rs index a1405c80fa..9cb5a1b828 100644 --- a/client/rpc/src/eth/mod.rs +++ b/client/rpc/src/eth/mod.rs @@ -32,14 +32,13 @@ use std::{collections::BTreeMap, marker::PhantomData, sync::Arc}; use ethereum::{BlockV2 as EthereumBlock, TransactionV2 as EthereumTransaction}; use ethereum_types::{H160, H256, H512, H64, U256, U64}; -use jsonrpsee::core::{async_trait, RpcResult as Result}; +use jsonrpsee::core::{async_trait, RpcResult}; // Substrate use sc_client_api::backend::{Backend, StorageProvider}; -use sc_network::NetworkService; -use sc_network_common::ExHashT; +use sc_network_sync::SyncingService; use sc_transaction_pool::{ChainApi, Pool}; use sc_transaction_pool_api::{InPoolTransaction, TransactionPool}; -use sp_api::{CallApiAt, Core, HeaderT, ProvideRuntimeApi}; +use sp_api::{ApiRef, CallApiAt, Core, HeaderT, ProvideRuntimeApi}; use sp_block_builder::BlockBuilder as BlockBuilderApi; use sp_blockchain::HeaderBackend; use sp_core::hashing::keccak_256; @@ -72,12 +71,12 @@ impl EthConfig for () { } /// Eth API implementation. -pub struct Eth> { +pub struct Eth> { pool: Arc

, graph: Arc>, client: Arc, convert_transaction: Option, - network: Arc>, + sync: Arc>, is_authority: bool, signers: Vec>, overrides: Arc>, @@ -91,13 +90,13 @@ pub struct Eth, } -impl Eth { +impl Eth { pub fn new( client: Arc, pool: Arc

, graph: Arc>, convert_transaction: Option, - network: Arc>, + sync: Arc>, signers: Vec>, overrides: Arc>, backend: Arc>, @@ -112,7 +111,7 @@ impl Eth Eth> - Eth -{ - pub fn replace_config>(self) -> Eth { +impl> Eth { + pub fn replace_config>(self) -> Eth { let Self { client, pool, graph, convert_transaction, - network, + sync, is_authority, signers, overrides, @@ -152,7 +149,7 @@ impl> pool, graph, convert_transaction, - network, + sync, is_authority, signers, overrides, @@ -167,43 +164,43 @@ impl> } #[async_trait] -impl EthApiServer for Eth +impl EthApiServer for Eth where B: BlockT, - C: ProvideRuntimeApi, + C: CallApiAt + ProvideRuntimeApi, C::Api: BlockBuilderApi + ConvertTransactionRuntimeApi + EthereumRuntimeRPCApi, - C: HeaderBackend + CallApiAt + StorageProvider + 'static, + C: HeaderBackend + StorageProvider + 'static, BE: Backend + 'static, P: TransactionPool + 'static, CT: ConvertTransaction<::Extrinsic> + Send + Sync + 'static, A: ChainApi + 'static, - EC: EthConfig + Send + Sync + 'static, + EC: EthConfig, { // ######################################################################## // Client // ######################################################################## - fn protocol_version(&self) -> Result { + fn protocol_version(&self) -> RpcResult { self.protocol_version() } - fn syncing(&self) -> Result { + fn syncing(&self) -> RpcResult { self.syncing() } - fn author(&self) -> Result { + fn author(&self) -> RpcResult { self.author() } - fn accounts(&self) -> Result> { + fn accounts(&self) -> RpcResult> { self.accounts() } - fn block_number(&self) -> Result { + fn block_number(&self) -> RpcResult { self.block_number() } - fn chain_id(&self) -> Result> { + fn chain_id(&self) -> RpcResult> { self.chain_id() } @@ -211,31 +208,39 @@ where // Block // ######################################################################## - async fn block_by_hash(&self, hash: H256, full: bool) -> Result> { + async fn block_by_hash(&self, hash: H256, full: bool) -> RpcResult> { self.block_by_hash(hash, full).await } - async fn block_by_number(&self, number: BlockNumber, full: bool) -> Result> { + async fn block_by_number( + &self, + number: BlockNumber, + full: bool, + ) -> RpcResult> { self.block_by_number(number, full).await } - fn block_transaction_count_by_hash(&self, hash: H256) -> Result> { + fn block_transaction_count_by_hash(&self, hash: H256) -> RpcResult> { self.block_transaction_count_by_hash(hash) } - fn block_transaction_count_by_number(&self, number: BlockNumber) -> Result> { + fn block_transaction_count_by_number(&self, number: BlockNumber) -> RpcResult> { self.block_transaction_count_by_number(number) } - fn block_uncles_count_by_hash(&self, hash: H256) -> Result { + fn block_uncles_count_by_hash(&self, hash: H256) -> RpcResult { self.block_uncles_count_by_hash(hash) } - fn block_uncles_count_by_number(&self, number: BlockNumber) -> Result { + fn block_uncles_count_by_number(&self, number: BlockNumber) -> RpcResult { self.block_uncles_count_by_number(number) } - fn uncle_by_block_hash_and_index(&self, hash: H256, index: Index) -> Result> { + fn uncle_by_block_hash_and_index( + &self, + hash: H256, + index: Index, + ) -> RpcResult> { self.uncle_by_block_hash_and_index(hash, index) } @@ -243,7 +248,7 @@ where &self, number: BlockNumber, index: Index, - ) -> Result> { + ) -> RpcResult> { self.uncle_by_block_number_and_index(number, index) } @@ -251,7 +256,7 @@ where // Transaction // ######################################################################## - async fn transaction_by_hash(&self, hash: H256) -> Result> { + async fn transaction_by_hash(&self, hash: H256) -> RpcResult> { self.transaction_by_hash(hash).await } @@ -259,7 +264,7 @@ where &self, hash: H256, index: Index, - ) -> Result> { + ) -> RpcResult> { self.transaction_by_block_hash_and_index(hash, index).await } @@ -267,12 +272,12 @@ where &self, number: BlockNumber, index: Index, - ) -> Result> { + ) -> RpcResult> { self.transaction_by_block_number_and_index(number, index) .await } - async fn transaction_receipt(&self, hash: H256) -> Result> { + async fn transaction_receipt(&self, hash: H256) -> RpcResult> { self.transaction_receipt(hash).await } @@ -280,19 +285,24 @@ where // State // ######################################################################## - fn balance(&self, address: H160, number: Option) -> Result { + fn balance(&self, address: H160, number: Option) -> RpcResult { self.balance(address, number) } - fn storage_at(&self, address: H160, index: U256, number: Option) -> Result { + fn storage_at( + &self, + address: H160, + index: U256, + number: Option, + ) -> RpcResult { self.storage_at(address, index, number) } - fn transaction_count(&self, address: H160, number: Option) -> Result { + fn transaction_count(&self, address: H160, number: Option) -> RpcResult { self.transaction_count(address, number) } - fn code_at(&self, address: H160, number: Option) -> Result { + fn code_at(&self, address: H160, number: Option) -> RpcResult { self.code_at(address, number) } @@ -305,7 +315,7 @@ where request: CallRequest, number: Option, state_overrides: Option>, - ) -> Result { + ) -> RpcResult { self.call(request, number, state_overrides) } @@ -313,7 +323,7 @@ where &self, request: CallRequest, number: Option, - ) -> Result { + ) -> RpcResult { self.estimate_gas(request, number).await } @@ -321,7 +331,7 @@ where // Fee // ######################################################################## - fn gas_price(&self) -> Result { + fn gas_price(&self) -> RpcResult { self.gas_price() } @@ -330,11 +340,11 @@ where block_count: U256, newest_block: BlockNumber, reward_percentiles: Option>, - ) -> Result { + ) -> RpcResult { self.fee_history(block_count, newest_block, reward_percentiles) } - fn max_priority_fee_per_gas(&self) -> Result { + fn max_priority_fee_per_gas(&self) -> RpcResult { self.max_priority_fee_per_gas() } @@ -342,23 +352,23 @@ where // Mining // ######################################################################## - fn is_mining(&self) -> Result { + fn is_mining(&self) -> RpcResult { self.is_mining() } - fn hashrate(&self) -> Result { + fn hashrate(&self) -> RpcResult { self.hashrate() } - fn work(&self) -> Result { + fn work(&self) -> RpcResult { self.work() } - fn submit_hashrate(&self, hashrate: U256, id: H256) -> Result { + fn submit_hashrate(&self, hashrate: U256, id: H256) -> RpcResult { self.submit_hashrate(hashrate, id) } - fn submit_work(&self, nonce: H64, pow_hash: H256, mix_digest: H256) -> Result { + fn submit_work(&self, nonce: H64, pow_hash: H256, mix_digest: H256) -> RpcResult { self.submit_work(nonce, pow_hash, mix_digest) } @@ -366,11 +376,11 @@ where // Submit // ######################################################################## - async fn send_transaction(&self, request: TransactionRequest) -> Result { + async fn send_transaction(&self, request: TransactionRequest) -> RpcResult { self.send_transaction(request).await } - async fn send_raw_transaction(&self, bytes: Bytes) -> Result { + async fn send_raw_transaction(&self, bytes: Bytes) -> RpcResult { self.send_raw_transaction(bytes).await } } @@ -545,7 +555,7 @@ fn transaction_build( fn pending_runtime_api<'a, B: BlockT, C, BE, A: ChainApi>( client: &'a C, graph: &'a Pool, -) -> Result> +) -> RpcResult> where B: BlockT, C: ProvideRuntimeApi, diff --git a/client/rpc/src/eth/state.rs b/client/rpc/src/eth/state.rs index d4b09b70be..8a03f16da3 100644 --- a/client/rpc/src/eth/state.rs +++ b/client/rpc/src/eth/state.rs @@ -17,11 +17,10 @@ // along with this program. If not, see . use ethereum_types::{H160, H256, U256}; -use jsonrpsee::core::RpcResult as Result; +use jsonrpsee::core::RpcResult; use scale_codec::Encode; // Substrate use sc_client_api::backend::{Backend, StorageProvider}; -use sc_network_common::ExHashT; use sc_transaction_pool::ChainApi; use sc_transaction_pool_api::{InPoolTransaction, TransactionPool}; use sp_api::ProvideRuntimeApi; @@ -37,7 +36,7 @@ use crate::{ frontier_backend_client, internal_err, }; -impl> Eth +impl> Eth where B: BlockT, C: ProvideRuntimeApi, @@ -47,7 +46,7 @@ where P: TransactionPool + 'static, A: ChainApi + 'static, { - pub fn balance(&self, address: H160, number: Option) -> Result { + pub fn balance(&self, address: H160, number: Option) -> RpcResult { let number = number.unwrap_or(BlockNumber::Latest); if number == BlockNumber::Pending { let api = pending_runtime_api(self.client.as_ref(), self.graph.as_ref())?; @@ -80,7 +79,7 @@ where address: H160, index: U256, number: Option, - ) -> Result { + ) -> RpcResult { let number = number.unwrap_or(BlockNumber::Latest); if number == BlockNumber::Pending { let api = pending_runtime_api(self.client.as_ref(), self.graph.as_ref())?; @@ -109,7 +108,7 @@ where } } - pub fn transaction_count(&self, address: H160, number: Option) -> Result { + pub fn transaction_count(&self, address: H160, number: Option) -> RpcResult { if let Some(BlockNumber::Pending) = number { let substrate_hash = self.client.info().best_hash; @@ -158,7 +157,7 @@ where .nonce) } - pub fn code_at(&self, address: H160, number: Option) -> Result { + pub fn code_at(&self, address: H160, number: Option) -> RpcResult { let number = number.unwrap_or(BlockNumber::Latest); if number == BlockNumber::Pending { let api = pending_runtime_api(self.client.as_ref(), self.graph.as_ref())?; diff --git a/client/rpc/src/eth/submit.rs b/client/rpc/src/eth/submit.rs index 3d0ee2651b..1d37bd9b5b 100644 --- a/client/rpc/src/eth/submit.rs +++ b/client/rpc/src/eth/submit.rs @@ -18,10 +18,9 @@ use ethereum_types::H256; use futures::future::TryFutureExt; -use jsonrpsee::core::RpcResult as Result; +use jsonrpsee::core::RpcResult; // Substrate use sc_client_api::backend::{Backend, StorageProvider}; -use sc_network_common::ExHashT; use sc_transaction_pool::ChainApi; use sc_transaction_pool_api::TransactionPool; use sp_api::{ApiExt, ProvideRuntimeApi}; @@ -39,7 +38,7 @@ use crate::{ internal_err, }; -impl> Eth +impl> Eth where B: BlockT, C: ProvideRuntimeApi, @@ -50,7 +49,7 @@ where CT: ConvertTransaction<::Extrinsic> + 'static, A: ChainApi + 'static, { - pub async fn send_transaction(&self, request: TransactionRequest) -> Result { + pub async fn send_transaction(&self, request: TransactionRequest) -> RpcResult { let from = match request.from { Some(from) => from, None => { @@ -207,7 +206,7 @@ where .await } - pub async fn send_raw_transaction(&self, bytes: Bytes) -> Result { + pub async fn send_raw_transaction(&self, bytes: Bytes) -> RpcResult { let slice = &bytes.0[..]; if slice.is_empty() { return Err(internal_err("transaction data is empty")); diff --git a/client/rpc/src/eth/transaction.rs b/client/rpc/src/eth/transaction.rs index 71f1ef3534..0b47c37d85 100644 --- a/client/rpc/src/eth/transaction.rs +++ b/client/rpc/src/eth/transaction.rs @@ -20,10 +20,9 @@ use std::sync::Arc; use ethereum::TransactionV2 as EthereumTransaction; use ethereum_types::{H256, U256, U64}; -use jsonrpsee::core::RpcResult as Result; +use jsonrpsee::core::RpcResult; // Substrate use sc_client_api::backend::{Backend, StorageProvider}; -use sc_network_common::ExHashT; use sc_transaction_pool::ChainApi; use sc_transaction_pool_api::InPoolTransaction; use sp_api::{ApiExt, ProvideRuntimeApi}; @@ -39,7 +38,7 @@ use crate::{ frontier_backend_client, internal_err, }; -impl> Eth +impl> Eth where B: BlockT, C: ProvideRuntimeApi, @@ -48,7 +47,7 @@ where BE: Backend + 'static, A: ChainApi + 'static, { - pub async fn transaction_by_hash(&self, hash: H256) -> Result> { + pub async fn transaction_by_hash(&self, hash: H256) -> RpcResult> { let client = Arc::clone(&self.client); let block_data_cache = Arc::clone(&self.block_data_cache); let backend = Arc::clone(&self.backend); @@ -161,7 +160,7 @@ where &self, hash: H256, index: Index, - ) -> Result> { + ) -> RpcResult> { let client = Arc::clone(&self.client); let block_data_cache = Arc::clone(&self.block_data_cache); let backend = Arc::clone(&self.backend); @@ -214,7 +213,7 @@ where &self, number: BlockNumber, index: Index, - ) -> Result> { + ) -> RpcResult> { let client = Arc::clone(&self.client); let block_data_cache = Arc::clone(&self.block_data_cache); let backend = Arc::clone(&self.backend); @@ -263,7 +262,7 @@ where } } - pub async fn transaction_receipt(&self, hash: H256) -> Result> { + pub async fn transaction_receipt(&self, hash: H256) -> RpcResult> { let client = Arc::clone(&self.client); let overrides = Arc::clone(&self.overrides); let block_data_cache = Arc::clone(&self.block_data_cache); @@ -326,7 +325,7 @@ where hash ))), }) - .sum::>()?; + .sum::>()?; ( d.logs.clone(), d.logs_bloom, diff --git a/client/rpc/src/eth_pubsub.rs b/client/rpc/src/eth_pubsub.rs index 9a7bb9821d..8f08934c39 100644 --- a/client/rpc/src/eth_pubsub.rs +++ b/client/rpc/src/eth_pubsub.rs @@ -27,8 +27,7 @@ use sc_client_api::{ backend::{Backend, StorageProvider}, client::BlockchainEvents, }; -use sc_network::{NetworkService, NetworkStatusProvider}; -use sc_network_common::ExHashT; +use sc_network_sync::SyncingService; use sc_rpc::SubscriptionTaskExecutor; use sc_transaction_pool_api::TransactionPool; use sp_api::{ApiExt, ProvideRuntimeApi}; @@ -58,10 +57,10 @@ impl jsonrpsee::core::traits::IdProvider for EthereumSubIdProvider { } /// Eth pub-sub API implementation. -pub struct EthPubSub { +pub struct EthPubSub { pool: Arc

, client: Arc, - network: Arc>, + sync: Arc>, subscriptions: SubscriptionTaskExecutor, overrides: Arc>, starting_block: u64, @@ -69,14 +68,14 @@ pub struct EthPubSub { _marker: PhantomData, } -impl EthPubSub +impl EthPubSub where C: HeaderBackend, { pub fn new( pool: Arc

, client: Arc, - network: Arc>, + sync: Arc>, subscriptions: SubscriptionTaskExecutor, overrides: Arc>, pubsub_notification_sinks: Arc< @@ -89,7 +88,7 @@ where Self { pool, client, - network, + sync, subscriptions, overrides, starting_block, @@ -199,7 +198,7 @@ impl EthSubscriptionResult { } } -impl EthPubSubApiServer for EthPubSub +impl EthPubSubApiServer for EthPubSub where B: BlockT, P: TransactionPool + 'static, @@ -228,7 +227,7 @@ where sc_utils::mpsc::tracing_unbounded("pubsub_notification_stream", 100_000); self.pubsub_notification_sinks.lock().push(inner_sink); let pool = self.pool.clone(); - let network = self.network.clone(); + let sync = self.sync.clone(); let overrides = self.overrides.clone(); let starting_block = self.starting_block; let fut = async move { @@ -347,21 +346,21 @@ where } Kind::Syncing => { let client = Arc::clone(&client); - let network = Arc::clone(&network); + let sync = Arc::clone(&sync); // Gets the node syncing status. // The response is expected to be serialized either as a plain boolean // if the node is not syncing, or a structure containing syncing metadata // in case it is. - async fn status, B: BlockT, H: ExHashT + Send + Sync>( + async fn status, B: BlockT>( client: Arc, - network: Arc>, + sync: Arc>, starting_block: u64, ) -> PubSubSyncStatus { - if network.is_major_syncing() { + if sync.is_major_syncing() { // Get the target block to sync. // This value is only exposed through substrate async Api // in the `NetworkService`. - let highest_block = network + let highest_block = sync .status() .await .ok() @@ -384,9 +383,9 @@ where } // On connection subscriber expects a value. // Because import notifications are only emitted when the node is synced or - // in case of reorg, the first event is emited right away. + // in case of reorg, the first event is emitted right away. let _ = sink.send(&PubSubResult::SyncState( - status(Arc::clone(&client), Arc::clone(&network), starting_block).await, + status(Arc::clone(&client), Arc::clone(&sync), starting_block).await, )); // When the node is not under a major syncing (i.e. from genesis), react @@ -394,12 +393,12 @@ where // // Only send new notifications down the pipe when the syncing status changed. let mut stream = client.clone().import_notification_stream(); - let mut last_syncing_status = network.is_major_syncing(); + let mut last_syncing_status = sync.is_major_syncing(); while (stream.next().await).is_some() { - let syncing_status = network.is_major_syncing(); + let syncing_status = sync.is_major_syncing(); if syncing_status != last_syncing_status { let _ = sink.send(&PubSubResult::SyncState( - status(client.clone(), network.clone(), starting_block).await, + status(client.clone(), sync.clone(), starting_block).await, )); } last_syncing_status = syncing_status; diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index 0bf618a3cb..677afbf23f 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -55,13 +55,17 @@ pub mod frontier_backend_client { use jsonrpsee::core::RpcResult; use scale_codec::Encode; // Substrate - use sc_client_api::{StorageKey, StorageProvider}; + use sc_client_api::{ + backend::{Backend, StorageProvider}, + StorageKey, + }; use sp_blockchain::HeaderBackend; use sp_io::hashing::{blake2_128, twox_128}; use sp_runtime::{ generic::BlockId, traits::{Block as BlockT, UniqueSaturatedInto, Zero}, }; + use sp_state_machine::OverlayedChanges; // Frontier use fc_rpc_core::types::BlockNumber; use fp_storage::EthereumStorageSchema; @@ -75,7 +79,7 @@ pub mod frontier_backend_client { where B: BlockT, C: StorageProvider + Send + Sync, - BE: sc_client_api::Backend + Send + Sync, + BE: Backend, { fn is_enabled() -> bool { true @@ -83,7 +87,7 @@ pub mod frontier_backend_client { fn set_overlayed_changes( client: &C, - overlayed_changes: &mut sp_state_machine::OverlayedChanges, + overlayed_changes: &mut OverlayedChanges, block: B::Hash, _version: u32, address: H160, @@ -128,7 +132,7 @@ pub mod frontier_backend_client { where B: BlockT, C: StorageProvider + Send + Sync, - BE: sc_client_api::Backend + Send + Sync, + BE: Backend, { fn is_enabled() -> bool { true @@ -136,7 +140,7 @@ pub mod frontier_backend_client { fn set_overlayed_changes( client: &C, - overlayed_changes: &mut sp_state_machine::OverlayedChanges, + overlayed_changes: &mut OverlayedChanges, block: B::Hash, _version: u32, address: H160, diff --git a/client/rpc/src/net.rs b/client/rpc/src/net.rs index b931b453be..64e8792a53 100644 --- a/client/rpc/src/net.rs +++ b/client/rpc/src/net.rs @@ -18,10 +18,10 @@ use std::sync::Arc; -use jsonrpsee::core::RpcResult as Result; +use jsonrpsee::core::RpcResult; // Substrate -use sc_network::NetworkService; -use sc_network_common::{service::NetworkPeers, ExHashT}; +use sc_network::{NetworkPeers, NetworkService}; +use sc_network_common::ExHashT; use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; use sp_runtime::traits::Block as BlockT; @@ -59,7 +59,7 @@ where C::Api: EthereumRuntimeRPCApi, C: HeaderBackend + 'static, { - fn version(&self) -> Result { + fn version(&self) -> RpcResult { let hash = self.client.info().best_hash; Ok(self .client @@ -69,7 +69,7 @@ where .to_string()) } - fn peer_count(&self) -> Result { + fn peer_count(&self) -> RpcResult { let peer_count = self.network.sync_num_connected(); Ok(match self.peer_count_as_hex { true => PeerCount::String(format!("0x{:x}", peer_count)), @@ -77,7 +77,7 @@ where }) } - fn is_listening(&self) -> Result { + fn is_listening(&self) -> RpcResult { Ok(true) } } diff --git a/client/rpc/src/web3.rs b/client/rpc/src/web3.rs index 4d702cda1d..7ed1daede1 100644 --- a/client/rpc/src/web3.rs +++ b/client/rpc/src/web3.rs @@ -19,7 +19,7 @@ use std::{marker::PhantomData, sync::Arc}; use ethereum_types::H256; -use jsonrpsee::core::RpcResult as Result; +use jsonrpsee::core::RpcResult; // Substrate use sp_api::{Core, ProvideRuntimeApi}; use sp_blockchain::HeaderBackend; @@ -53,7 +53,7 @@ where C::Api: EthereumRuntimeRPCApi, C: HeaderBackend + 'static, { - fn client_version(&self) -> Result { + fn client_version(&self) -> RpcResult { let hash = self.client.info().best_hash; let version = self .client @@ -70,7 +70,7 @@ where )) } - fn sha3(&self, input: Bytes) -> Result { + fn sha3(&self, input: Bytes) -> RpcResult { Ok(H256::from(keccak_256(&input.into_vec()))) } } diff --git a/frame/base-fee/src/tests.rs b/frame/base-fee/src/tests.rs index 1cecb52a47..4953ae6b0d 100644 --- a/frame/base-fee/src/tests.rs +++ b/frame/base-fee/src/tests.rs @@ -40,7 +40,7 @@ type Block = frame_system::mocking::MockBlock; parameter_types! { pub const BlockHashCount: u64 = 250; pub BlockWeights: frame_system::limits::BlockWeights = - frame_system::limits::BlockWeights::simple_max(Weight::from_ref_time(1024)); + frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0)); } impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; @@ -149,7 +149,7 @@ fn should_not_overflow_u256() { new_test_ext(Some(base_fee), None).execute_with(|| { let init = BaseFee::base_fee_per_gas(); System::register_extra_weight_unchecked( - Weight::from_ref_time(1000000000000), + Weight::from_parts(1000000000000, 0), DispatchClass::Normal, ); BaseFee::on_finalize(System::block_number()); @@ -202,7 +202,7 @@ fn should_handle_consecutive_full_blocks() { for _ in 0..10000 { // Register max weight in block. System::register_extra_weight_unchecked( - Weight::from_ref_time(1000000000000), + Weight::from_parts(1000000000000, 0), DispatchClass::Normal, ); BaseFee::on_finalize(System::block_number()); @@ -222,7 +222,7 @@ fn should_handle_consecutive_full_blocks() { for _ in 0..10000 { // Register max weight in block. System::register_extra_weight_unchecked( - Weight::from_ref_time(1000000000000), + Weight::from_parts(1000000000000, 0), DispatchClass::Normal, ); BaseFee::on_finalize(System::block_number()); @@ -243,7 +243,7 @@ fn should_increase_total_base_fee() { assert_eq!(BaseFee::base_fee_per_gas(), U256::from(1000000000)); // Register max weight in block. System::register_extra_weight_unchecked( - Weight::from_ref_time(1000000000000), + Weight::from_parts(1000000000000, 0), DispatchClass::Normal, ); BaseFee::on_finalize(System::block_number()); @@ -259,7 +259,7 @@ fn should_increase_delta_of_base_fee() { assert_eq!(BaseFee::base_fee_per_gas(), U256::from(1000000000)); // Register 75% capacity in block weight. System::register_extra_weight_unchecked( - Weight::from_ref_time(750000000000), + Weight::from_parts(750000000000, 0), DispatchClass::Normal, ); BaseFee::on_finalize(System::block_number()); @@ -275,7 +275,7 @@ fn should_idle_base_fee() { assert_eq!(BaseFee::base_fee_per_gas(), U256::from(1000000000)); // Register half capacity in block weight. System::register_extra_weight_unchecked( - Weight::from_ref_time(500000000000), + Weight::from_parts(500000000000, 0), DispatchClass::Normal, ); BaseFee::on_finalize(System::block_number()); diff --git a/frame/dynamic-fee/src/tests.rs b/frame/dynamic-fee/src/tests.rs index 1fe73e4307..de6045c316 100644 --- a/frame/dynamic-fee/src/tests.rs +++ b/frame/dynamic-fee/src/tests.rs @@ -43,7 +43,7 @@ type Block = frame_system::mocking::MockBlock; parameter_types! { pub const BlockHashCount: u64 = 250; pub BlockWeights: frame_system::limits::BlockWeights = - frame_system::limits::BlockWeights::simple_max(Weight::from_ref_time(1024)); + frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0)); } impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; diff --git a/frame/ethereum/src/mock.rs b/frame/ethereum/src/mock.rs index 5eceb3d0ae..90eb823d65 100644 --- a/frame/ethereum/src/mock.rs +++ b/frame/ethereum/src/mock.rs @@ -139,7 +139,7 @@ parameter_types! { pub const ChainId: u64 = 42; pub const EVMModuleId: PalletId = PalletId(*b"py/evmpa"); pub const BlockGasLimit: U256 = U256::MAX; - pub const WeightPerGas: Weight = Weight::from_ref_time(20_000); + pub const WeightPerGas: Weight = Weight::from_parts(20_000, 0); } pub struct HashedAddressMapping; diff --git a/frame/ethereum/src/tests/eip1559.rs b/frame/ethereum/src/tests/eip1559.rs index b283bd1493..538ad04455 100644 --- a/frame/ethereum/src/tests/eip1559.rs +++ b/frame/ethereum/src/tests/eip1559.rs @@ -480,7 +480,7 @@ fn self_contained_transaction_with_extra_gas_should_adjust_weight_with_post_disp let (pairs, mut ext) = new_test_ext(1); let alice = &pairs[0]; let base_extrinsic_weight = frame_system::limits::BlockWeights::with_sensible_defaults( - Weight::from_ref_time(2000000000000).set_proof_size(u64::MAX), + Weight::from_parts(2000000000000, u64::MAX), sp_runtime::Perbill::from_percent(75), ) .per_class diff --git a/frame/ethereum/src/tests/eip2930.rs b/frame/ethereum/src/tests/eip2930.rs index 7feb7aaf8d..1378463588 100644 --- a/frame/ethereum/src/tests/eip2930.rs +++ b/frame/ethereum/src/tests/eip2930.rs @@ -401,7 +401,7 @@ fn self_contained_transaction_with_extra_gas_should_adjust_weight_with_post_disp let (pairs, mut ext) = new_test_ext(1); let alice = &pairs[0]; let base_extrinsic_weight = frame_system::limits::BlockWeights::with_sensible_defaults( - Weight::from_ref_time(2000000000000).set_proof_size(u64::MAX), + Weight::from_parts(2000000000000, u64::MAX), sp_runtime::Perbill::from_percent(75), ) .per_class diff --git a/frame/ethereum/src/tests/legacy.rs b/frame/ethereum/src/tests/legacy.rs index 25fc17a0f9..b8a33fcebb 100644 --- a/frame/ethereum/src/tests/legacy.rs +++ b/frame/ethereum/src/tests/legacy.rs @@ -401,7 +401,7 @@ fn self_contained_transaction_with_extra_gas_should_adjust_weight_with_post_disp let (pairs, mut ext) = new_test_ext(1); let alice = &pairs[0]; let base_extrinsic_weight = frame_system::limits::BlockWeights::with_sensible_defaults( - Weight::from_ref_time(2000000000000).set_proof_size(u64::MAX), + Weight::from_parts(2000000000000, u64::MAX), sp_runtime::Perbill::from_percent(75), ) .per_class diff --git a/frame/evm/precompile/dispatch/src/mock.rs b/frame/evm/precompile/dispatch/src/mock.rs index d55d73d2cf..7f0acfe231 100644 --- a/frame/evm/precompile/dispatch/src/mock.rs +++ b/frame/evm/precompile/dispatch/src/mock.rs @@ -56,7 +56,7 @@ frame_support::construct_runtime! { parameter_types! { pub const BlockHashCount: u64 = 250; pub BlockWeights: frame_system::limits::BlockWeights = - frame_system::limits::BlockWeights::simple_max(Weight::from_ref_time(1024)); + frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0)); } impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; @@ -121,7 +121,7 @@ pub struct FixedGasPrice; impl FeeCalculator for FixedGasPrice { fn min_gas_price() -> (U256, Weight) { // Return some meaningful gas price and weight - (1_000_000_000u128.into(), Weight::from_ref_time(7u64)) + (1_000_000_000u128.into(), Weight::from_parts(7u64, 0)) } } @@ -136,7 +136,7 @@ impl FindAuthor for FindAuthorTruncated { } parameter_types! { pub BlockGasLimit: U256 = U256::max_value(); - pub WeightPerGas: Weight = Weight::from_ref_time(20_000); + pub WeightPerGas: Weight = Weight::from_parts(20_000, 0); } impl pallet_evm::Config for Test { type FeeCalculator = FixedGasPrice; diff --git a/frame/evm/src/mock.rs b/frame/evm/src/mock.rs index 948810b72a..083d3fa33d 100644 --- a/frame/evm/src/mock.rs +++ b/frame/evm/src/mock.rs @@ -55,7 +55,7 @@ frame_support::construct_runtime! { parameter_types! { pub const BlockHashCount: u64 = 250; pub BlockWeights: frame_system::limits::BlockWeights = - frame_system::limits::BlockWeights::simple_max(Weight::from_ref_time(1024)); + frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0)); } impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; @@ -113,7 +113,7 @@ pub struct FixedGasPrice; impl FeeCalculator for FixedGasPrice { fn min_gas_price() -> (U256, Weight) { // Return some meaningful gas price and weight - (1_000_000_000u128.into(), Weight::from_ref_time(7u64)) + (1_000_000_000u128.into(), Weight::from_parts(7u64, 0)) } } @@ -128,7 +128,7 @@ impl FindAuthor for FindAuthorTruncated { } parameter_types! { pub BlockGasLimit: U256 = U256::max_value(); - pub WeightPerGas: Weight = Weight::from_ref_time(20_000); + pub WeightPerGas: Weight = Weight::from_parts(20_000, 0); pub MockPrecompiles: MockPrecompileSet = MockPrecompileSet; } impl crate::Config for Test { diff --git a/frame/evm/src/tests.rs b/frame/evm/src/tests.rs index 65fc0e033b..80170483a8 100644 --- a/frame/evm/src/tests.rs +++ b/frame/evm/src/tests.rs @@ -382,7 +382,7 @@ fn call_should_fail_with_priority_greater_than_max_fee() { // Some used weight is returned as part of the error. assert_eq!( result.unwrap_err().post_info.actual_weight, - Some(Weight::from_ref_time(7)) + Some(Weight::from_parts(7, 0)) ); }); } diff --git a/frame/evm/src/weights.rs b/frame/evm/src/weights.rs index eee8a78f97..a0d0e1d95e 100644 --- a/frame/evm/src/weights.rs +++ b/frame/evm/src/weights.rs @@ -1,13 +1,13 @@ -// SPDX-License-Identifier: Apache-2.0 // This file is part of Frontier. -// -// Copyright (c) 2020-2022 Parity Technologies (UK) Ltd. -// + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// 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,8 +18,9 @@ //! Autogenerated weights for pallet_evm //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-04-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `benchmarker`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2023-05-06, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `archlinux`, CPU: `AMD Ryzen 9 5900X 12-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -34,15 +35,16 @@ // --execution=wasm // --wasm-execution=compiled // --output=weights.rs -// --template=./benchmarking/frame-weight-template.hbs +// --header=HEADER-APACHE2 +// --template=./.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(clippy::unnecessary_cast)] +#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; +use core::marker::PhantomData; /// Weight functions needed for pallet_evm. pub trait WeightInfo { @@ -53,13 +55,21 @@ pub trait WeightInfo { pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { fn withdraw() -> Weight { - Weight::from_ref_time(4_532_000 as u64) + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) } } // For backwards compatibility and tests impl WeightInfo for () { fn withdraw() -> Weight { - Weight::from_ref_time(4_532_000 as u64) + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_000_000 picoseconds. + Weight::from_parts(2_000_000, 0) } } diff --git a/frame/hotfix-sufficients/src/mock.rs b/frame/hotfix-sufficients/src/mock.rs index 352e707e85..1d222f1139 100644 --- a/frame/hotfix-sufficients/src/mock.rs +++ b/frame/hotfix-sufficients/src/mock.rs @@ -49,7 +49,7 @@ type Block = frame_system::mocking::MockBlock; parameter_types! { pub const BlockHashCount: u64 = 250; pub BlockWeights: frame_system::limits::BlockWeights = - frame_system::limits::BlockWeights::simple_max(Weight::from_ref_time(1024)); + frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0)); } impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; diff --git a/frame/hotfix-sufficients/src/weights.rs b/frame/hotfix-sufficients/src/weights.rs index 2da794f1bb..86303d1c4d 100644 --- a/frame/hotfix-sufficients/src/weights.rs +++ b/frame/hotfix-sufficients/src/weights.rs @@ -1,13 +1,13 @@ -// This file is part of Substrate. +// This file is part of Frontier. -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// 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,7 +18,8 @@ //! Autogenerated weights for pallet_hotfix_sufficients //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-18, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-05-06, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `archlinux`, CPU: `AMD Ryzen 9 5900X 12-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 @@ -34,15 +35,16 @@ // --execution=wasm // --wasm-execution=compiled // --output=weights.rs -// --template=./benchmarking/frame-weight-template.hbs +// --header=HEADER-APACHE2 +// --template=./.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -#![allow(clippy::unnecessary_cast)] +#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; +use core::marker::PhantomData; /// Weight functions needed for pallet_hotfix_sufficients. pub trait WeightInfo { @@ -52,34 +54,58 @@ pub trait WeightInfo { /// Weights for pallet_hotfix_sufficients using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { - // Storage: System Account (r:20 w:20) - // Storage: System Number (r:1 w:0) - // Storage: System ExecutionPhase (r:1 w:0) - // Storage: System EventCount (r:1 w:1) - // Storage: System Events (r:1 w:1) + /// Storage: System Account (r:1000 w:1000) + /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) + /// Storage: System Number (r:1 w:0) + /// Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: System ExecutionPhase (r:1 w:0) + /// Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + /// Storage: System EventCount (r:1 w:1) + /// Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: System Events (r:1 w:1) + /// Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) /// The range of component `n` is `[0, 1000]`. fn hotfix_inc_account_sufficients(n: u32, ) -> Weight { - Weight::from_ref_time(3_798_000 as u64) - // Standard Error: 7_576 - .saturating_add(Weight::from_ref_time(12_811_127 as u64).saturating_mul(n as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(n as u64))) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(n as u64))) + // Proof Size summary in bytes: + // Measured: `0 + n * (124 ±0)` + // Estimated: `6572 + n * (2715 ±0)` + // Minimum execution time: 2_000_000 picoseconds. + Weight::from_parts(2_000_000, 6572) + // Standard Error: 12_231 + .saturating_add(Weight::from_parts(15_224_397, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) + .saturating_add(Weight::from_parts(0, 2715).saturating_mul(n.into())) } } // For backwards compatibility and tests impl WeightInfo for () { - // Storage: System Account (r:20 w:20) - // Storage: System Number (r:1 w:0) - // Storage: System ExecutionPhase (r:1 w:0) - // Storage: System EventCount (r:1 w:1) - // Storage: System Events (r:1 w:1) + /// Storage: System Account (r:1000 w:1000) + /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) + /// Storage: System Number (r:1 w:0) + /// Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: System ExecutionPhase (r:1 w:0) + /// Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + /// Storage: System EventCount (r:1 w:1) + /// Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: System Events (r:1 w:1) + /// Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) /// The range of component `n` is `[0, 1000]`. fn hotfix_inc_account_sufficients(n: u32, ) -> Weight { - Weight::from_ref_time(3_798_000 as u64) - // Standard Error: 7_576 - .saturating_add(Weight::from_ref_time(12_811_127 as u64).saturating_mul(n as u64)) - .saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(n as u64))) - .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(n as u64))) + // Proof Size summary in bytes: + // Measured: `0 + n * (124 ±0)` + // Estimated: `6572 + n * (2715 ±0)` + // Minimum execution time: 2_000_000 picoseconds. + Weight::from_parts(2_000_000, 6572) + // Standard Error: 12_231 + .saturating_add(Weight::from_parts(15_224_397, 0).saturating_mul(n.into())) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(n.into()))) + .saturating_add(RocksDbWeight::get().writes(2_u64)) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into()))) + .saturating_add(Weight::from_parts(0, 2715).saturating_mul(n.into())) } } diff --git a/template/node/Cargo.toml b/template/node/Cargo.toml index 3c3581fafb..0e3083c928 100644 --- a/template/node/Cargo.toml +++ b/template/node/Cargo.toml @@ -29,11 +29,12 @@ sc-cli = { workspace = true } sc-client-api = { workspace = true } sc-consensus = { workspace = true } sc-consensus-aura = { workspace = true } +sc-consensus-grandpa = { workspace = true } sc-consensus-manual-seal = { workspace = true } sc-executor = { workspace = true } -sc-finality-grandpa = { workspace = true } sc-network = { workspace = true } sc-network-common = { workspace = true } +sc-network-sync = { workspace = true } sc-rpc = { workspace = true } sc-rpc-api = { workspace = true } sc-service = { workspace = true } @@ -44,8 +45,8 @@ sp-api = { workspace = true, features = ["default"] } sp-block-builder = { workspace = true } sp-blockchain = { workspace = true } sp-consensus-aura = { workspace = true, features = ["default"] } +sp-consensus-grandpa = { workspace = true, features = ["default"] } sp-core = { workspace = true, features = ["default"] } -sp-finality-grandpa = { workspace = true, features = ["default"] } sp-inherents = { workspace = true, features = ["default"] } sp-offchain = { workspace = true, features = ["default"] } sp-runtime = { workspace = true, features = ["default"] } diff --git a/template/node/src/chain_spec.rs b/template/node/src/chain_spec.rs index e09fa944c2..d53c230903 100644 --- a/template/node/src/chain_spec.rs +++ b/template/node/src/chain_spec.rs @@ -4,8 +4,8 @@ use serde::{Deserialize, Serialize}; // Substrate use sc_chain_spec::{ChainType, Properties}; use sp_consensus_aura::sr25519::AuthorityId as AuraId; +use sp_consensus_grandpa::AuthorityId as GrandpaId; use sp_core::{ecdsa, storage::Storage, Pair, Public, H160, U256}; -use sp_finality_grandpa::AuthorityId as GrandpaId; use sp_runtime::traits::{IdentifyAccount, Verify}; use sp_state_machine::BasicExternalities; // Frontier diff --git a/template/node/src/client.rs b/template/node/src/client.rs index 5b58b71eef..23c31eb7e5 100644 --- a/template/node/src/client.rs +++ b/template/node/src/client.rs @@ -65,7 +65,7 @@ pub trait RuntimeApiCollection: BaseRuntimeApiCollection + EthCompatRuntimeApiCollection + sp_consensus_aura::AuraApi - + sp_finality_grandpa::GrandpaApi + + sp_consensus_grandpa::GrandpaApi + frame_system_rpc_runtime_api::AccountNonceApi + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi where @@ -78,7 +78,7 @@ where Api: BaseRuntimeApiCollection + EthCompatRuntimeApiCollection + sp_consensus_aura::AuraApi - + sp_finality_grandpa::GrandpaApi + + sp_consensus_grandpa::GrandpaApi + frame_system_rpc_runtime_api::AccountNonceApi + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi, >::StateBackend: sp_api::StateBackend, diff --git a/template/node/src/command.rs b/template/node/src/command.rs index f8dc8e30e3..2979d33f29 100644 --- a/template/node/src/command.rs +++ b/template/node/src/command.rs @@ -142,7 +142,7 @@ pub fn run() -> sc_cli::Result<()> { let (client, backend, _, task_manager, _) = service::new_chain_ops(&mut config, &cli.eth)?; let aux_revert = Box::new(move |client, _, blocks| { - sc_finality_grandpa::revert(client, blocks)?; + sc_consensus_grandpa::revert(client, blocks)?; Ok(()) }); Ok((cmd.run(client, backend, Some(aux_revert)), task_manager)) diff --git a/template/node/src/eth.rs b/template/node/src/eth.rs index 1deb447f0c..75a4a20961 100644 --- a/template/node/src/eth.rs +++ b/template/node/src/eth.rs @@ -9,8 +9,7 @@ use futures::{future, prelude::*}; // Substrate use sc_client_api::{BlockchainEvents, StateBackendFor}; use sc_executor::NativeExecutionDispatch; -use sc_network::NetworkService; -use sc_network_common::ExHashT; +use sc_network_sync::SyncingService; use sc_service::{error::Error as ServiceError, BasePath, Configuration, TaskManager}; use sp_api::ConstructRuntimeApi; use sp_runtime::traits::BlakeTwo256; @@ -106,7 +105,7 @@ where { } -pub fn spawn_frontier_tasks( +pub fn spawn_frontier_tasks( task_manager: &TaskManager, client: Arc>, backend: Arc, @@ -115,7 +114,7 @@ pub fn spawn_frontier_tasks( overrides: Arc>, fee_history_cache: FeeHistoryCache, fee_history_cache_limit: FeeHistoryCacheLimit, - network: Arc>, + sync: Arc>, pubsub_notification_sinks: Arc< fc_mapping_sync::EthereumBlockNotificationSinks< fc_mapping_sync::EthereumBlockNotification, @@ -141,7 +140,7 @@ pub fn spawn_frontier_tasks( 3, 0, SyncStrategy::Normal, - network, + sync, pubsub_notification_sinks, ) .for_each(|()| future::ready(())), diff --git a/template/node/src/rpc/eth.rs b/template/node/src/rpc/eth.rs index 5d6ab4bab4..6087234f3b 100644 --- a/template/node/src/rpc/eth.rs +++ b/template/node/src/rpc/eth.rs @@ -7,6 +7,7 @@ use sc_client_api::{ client::BlockchainEvents, }; use sc_network::NetworkService; +use sc_network_sync::SyncingService; use sc_rpc::SubscriptionTaskExecutor; use sc_transaction_pool::{ChainApi, Pool}; use sc_transaction_pool_api::TransactionPool; @@ -37,6 +38,8 @@ pub struct EthDeps { pub enable_dev_signer: bool, /// Network service pub network: Arc>, + /// Chain syncing service + pub sync: Arc>, /// Frontier Backend. pub frontier_backend: Arc>, /// Ethereum data access overrides. @@ -66,6 +69,7 @@ impl Clone for EthDeps is_authority: self.is_authority, enable_dev_signer: self.enable_dev_signer, network: self.network.clone(), + sync: self.sync.clone(), frontier_backend: self.frontier_backend.clone(), overrides: self.overrides.clone(), block_data_cache: self.block_data_cache.clone(), @@ -91,13 +95,10 @@ pub fn create_eth>( ) -> Result, Box> where B: BlockT, - C: ProvideRuntimeApi, + C: CallApiAt + ProvideRuntimeApi, C::Api: BlockBuilderApi + EthereumRuntimeRPCApi + ConvertTransactionRuntimeApi, C: BlockchainEvents + 'static, - C: HeaderBackend - + CallApiAt - + HeaderMetadata - + StorageProvider, + C: HeaderBackend + HeaderMetadata + StorageProvider, BE: Backend + 'static, P: TransactionPool + 'static, A: ChainApi + 'static, @@ -116,6 +117,7 @@ where is_authority, enable_dev_signer, network, + sync, frontier_backend, overrides, block_data_cache, @@ -137,7 +139,7 @@ where pool.clone(), graph, converter, - network.clone(), + sync.clone(), vec![], overrides.clone(), frontier_backend.clone(), @@ -169,7 +171,7 @@ where EthPubSub::new( pool, client.clone(), - network.clone(), + sync, subscription_task_executor, overrides, pubsub_notification_sinks, diff --git a/template/node/src/rpc/mod.rs b/template/node/src/rpc/mod.rs index c5f340a2c1..e1357ce716 100644 --- a/template/node/src/rpc/mod.rs +++ b/template/node/src/rpc/mod.rs @@ -60,7 +60,7 @@ pub fn create_full( >, ) -> Result, Box> where - C: ProvideRuntimeApi, + C: CallApiAt + ProvideRuntimeApi, C::Api: substrate_frame_rpc_system::AccountNonceApi, C::Api: sp_block_builder::BlockBuilder, C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, @@ -68,7 +68,6 @@ where C::Api: fp_rpc::EthereumRuntimeRPCApi, C: BlockchainEvents + 'static, C: HeaderBackend - + CallApiAt + HeaderMetadata + StorageProvider, BE: Backend + 'static, diff --git a/template/node/src/service.rs b/template/node/src/service.rs index d24610371c..5331d12e1d 100644 --- a/template/node/src/service.rs +++ b/template/node/src/service.rs @@ -37,8 +37,8 @@ type FullPool = sc_transaction_pool::FullPool; type FullSelectChain = sc_consensus::LongestChain; type GrandpaBlockImport = - sc_finality_grandpa::GrandpaBlockImport; -type GrandpaLinkHalf = sc_finality_grandpa::LinkHalf; + sc_consensus_grandpa::GrandpaBlockImport; +type GrandpaLinkHalf = sc_consensus_grandpa::LinkHalf; type BoxBlockImport = sc_consensus::BoxBlockImport>; pub fn new_partial( @@ -117,7 +117,7 @@ where }); let select_chain = sc_consensus::LongestChain::new(backend.clone()); - let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import( + let (grandpa_block_import, grandpa_link) = sc_consensus_grandpa::block_import( client.clone(), &client, select_chain.clone(), @@ -289,7 +289,7 @@ where fee_history_cache_limit, } = new_frontier_partial(ð_config)?; - let grandpa_protocol_name = sc_finality_grandpa::protocol_standard_name( + let grandpa_protocol_name = sc_consensus_grandpa::protocol_standard_name( &client.block_hash(0)?.expect("Genesis block exists; qed"), &config.chain_spec, ); @@ -300,11 +300,11 @@ where config .network .extra_sets - .push(sc_finality_grandpa::grandpa_peers_set_config( + .push(sc_consensus_grandpa::grandpa_peers_set_config( grandpa_protocol_name.clone(), )); let warp_sync: Arc> = - Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new( + Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new( backend.clone(), grandpa_link.shared_authority_set().clone(), Vec::default(), @@ -312,7 +312,7 @@ where Some(WarpSyncParams::WithProvider(warp_sync)) }; - let (network, system_rpc_tx, tx_handler_controller, network_starter) = + let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) = sc_service::build_network(sc_service::BuildNetworkParams { config: &config, client: client.clone(), @@ -361,6 +361,7 @@ where is_authority: config.role.is_authority(), enable_dev_signer: eth_config.enable_dev_signer, network: network.clone(), + sync: sync_service.clone(), frontier_backend: frontier_backend.clone(), overrides: overrides.clone(), block_data_cache: Arc::new(fc_rpc::EthBlockDataCacheTask::new( @@ -415,6 +416,7 @@ where network: network.clone(), system_rpc_tx, tx_handler_controller, + sync_service: sync_service.clone(), telemetry: telemetry.as_mut(), })?; @@ -427,7 +429,7 @@ where overrides, fee_history_cache, fee_history_cache_limit, - network.clone(), + sync_service.clone(), pubsub_notification_sinks, ); @@ -479,8 +481,8 @@ where select_chain, block_import, proposer_factory, - sync_oracle: network.clone(), - justification_sync_link: network.clone(), + sync_oracle: sync_service.clone(), + justification_sync_link: sync_service.clone(), create_inherent_data_providers, force_authoring, backoff_authoring_blocks: Option::<()>::None, @@ -507,7 +509,7 @@ where None }; - let grandpa_config = sc_finality_grandpa::Config { + let grandpa_config = sc_consensus_grandpa::Config { // FIXME #1578 make this available through chainspec gossip_duration: Duration::from_millis(333), justification_period: 512, @@ -526,13 +528,14 @@ where // been tested extensively yet and having most nodes in a network run it // could lead to finality stalls. let grandpa_voter = - sc_finality_grandpa::run_grandpa_voter(sc_finality_grandpa::GrandpaParams { + sc_consensus_grandpa::run_grandpa_voter(sc_consensus_grandpa::GrandpaParams { config: grandpa_config, link: grandpa_link, network, - voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(), + sync: sync_service, + voting_rule: sc_consensus_grandpa::VotingRulesBuilder::default().build(), prometheus_registry, - shared_voter_state: sc_finality_grandpa::SharedVoterState::empty(), + shared_voter_state: sc_consensus_grandpa::SharedVoterState::empty(), telemetry: telemetry.as_ref().map(|x| x.handle()), })?; diff --git a/template/runtime/src/lib.rs b/template/runtime/src/lib.rs index c115b119bd..6e6d954a92 100644 --- a/template/runtime/src/lib.rs +++ b/template/runtime/src/lib.rs @@ -35,7 +35,7 @@ use frame_support::weights::constants::ParityDbWeight as RuntimeDbWeight; use frame_support::weights::constants::RocksDbWeight as RuntimeDbWeight; use frame_support::{ construct_runtime, parameter_types, - traits::{ConstU32, ConstU8, FindAuthor, KeyOwnerProofSystem, OnTimestampSet}, + traits::{ConstU32, ConstU8, FindAuthor, OnTimestampSet}, weights::{constants::WEIGHT_REF_TIME_PER_MILLIS, ConstantMultiplier, IdentityFee, Weight}, }; use pallet_grandpa::{ @@ -224,21 +224,12 @@ impl pallet_aura::Config for Runtime { impl pallet_grandpa::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type KeyOwnerProof = - >::Proof; - - type KeyOwnerIdentification = >::IdentificationTuple; - - type KeyOwnerProofSystem = (); - - type HandleEquivocation = (); - type WeightInfo = (); type MaxAuthorities = ConstU32<32>; type MaxSetIdSessionEntries = (); + + type KeyOwnerProof = sp_core::Void; + type EquivocationReportSystem = (); } parameter_types! { @@ -324,7 +315,7 @@ const BLOCK_GAS_LIMIT: u64 = 75_000_000; parameter_types! { pub BlockGasLimit: U256 = U256::from(BLOCK_GAS_LIMIT); pub PrecompilesValue: FrontierPrecompiles = FrontierPrecompiles::<_>::new(); - pub WeightPerGas: Weight = Weight::from_ref_time(weight_per_gas(BLOCK_GAS_LIMIT, NORMAL_DISPATCH_RATIO, WEIGHT_MILLISECS_PER_BLOCK)); + pub WeightPerGas: Weight = Weight::from_parts(weight_per_gas(BLOCK_GAS_LIMIT, NORMAL_DISPATCH_RATIO, WEIGHT_MILLISECS_PER_BLOCK), 0); } impl pallet_evm::Config for Runtime {