From e82c320eb5d4a4a02e5b934e4ad7e73ce465e0c2 Mon Sep 17 00:00:00 2001 From: tgmichel Date: Wed, 4 Aug 2021 21:42:16 +0200 Subject: [PATCH] Update Frontier (#664) * Implement EthereumRuntimeRPCApi::extrinsic_filter * Update runtime associated types * Pass backend to EthFilterApi * Add SyncStrategy::Parachain * Add `frontier-schema-cache-task` * Update frontier * Update `receiptsRoot` in ts tests * fmt * fix integration tests Co-authored-by: librelois --- Cargo.lock | 151 +++++++++++++++------- client/rpc-core/txpool/Cargo.toml | 2 +- client/rpc/debug/Cargo.toml | 8 +- client/rpc/trace/Cargo.toml | 8 +- client/rpc/txpool/Cargo.toml | 2 +- node/service/Cargo.toml | 18 +-- node/service/src/rpc.rs | 14 +- precompiles/crowdloan-rewards/Cargo.toml | 2 +- precompiles/crowdloan-rewards/src/mock.rs | 2 + precompiles/parachain-staking/Cargo.toml | 2 +- precompiles/utils/Cargo.toml | 2 +- primitives/account/Cargo.toml | 2 +- runtime/common/src/apis.rs | 11 +- runtime/evm_tracer/Cargo.toml | 4 +- runtime/moonbase/Cargo.toml | 16 +-- runtime/moonbase/src/lib.rs | 3 +- runtime/moonbase/tests/common/mod.rs | 10 +- runtime/moonbase/tests/runtime_apis.rs | 2 +- runtime/moonbeam/Cargo.toml | 16 +-- runtime/moonbeam/src/lib.rs | 3 +- runtime/moonbeam/tests/common/mod.rs | 10 +- runtime/moonbeam/tests/runtime_apis.rs | 2 +- runtime/moonriver/Cargo.toml | 16 +-- runtime/moonriver/src/lib.rs | 3 +- runtime/moonriver/tests/common/mod.rs | 10 +- runtime/moonriver/tests/runtime_apis.rs | 2 +- tests/tests/test-block-1.ts | 2 +- tests/tests/test-block-genesis.ts | 4 +- tests/tests/test-subscription.ts | 2 +- 29 files changed, 200 insertions(+), 129 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8ceefccc09..e80b4ca97a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,7 +18,7 @@ version = "0.1.1" dependencies = [ "blake2-rfc", "hex", - "libsecp256k1", + "libsecp256k1 0.3.5", "log", "pallet-evm", "parity-scale-codec", @@ -2229,8 +2229,8 @@ dependencies = [ [[package]] name = "fc-consensus" -version = "1.0.1-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.8#7791640de26445134a50f84126909fcab3431a33" +version = "2.0.0-dev" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-pre#6235ebb9afe295e8430ec5a889651f6bd7c17bbb" dependencies = [ "async-trait", "derive_more", @@ -2254,11 +2254,13 @@ dependencies = [ [[package]] name = "fc-db" -version = "1.0.0" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.8#7791640de26445134a50f84126909fcab3431a33" +version = "2.0.0-dev" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-pre#6235ebb9afe295e8430ec5a889651f6bd7c17bbb" dependencies = [ + "fp-storage", "kvdb", "kvdb-rocksdb", + "pallet-ethereum", "parity-scale-codec", "parking_lot 0.11.1", "sp-core", @@ -2268,8 +2270,8 @@ dependencies = [ [[package]] name = "fc-mapping-sync" -version = "1.1.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.8#7791640de26445134a50f84126909fcab3431a33" +version = "2.0.0-dev" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-pre#6235ebb9afe295e8430ec5a889651f6bd7c17bbb" dependencies = [ "fc-consensus", "fc-db", @@ -2287,7 +2289,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.8#7791640de26445134a50f84126909fcab3431a33" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-pre#6235ebb9afe295e8430ec5a889651f6bd7c17bbb" dependencies = [ "ethereum", "ethereum-types", @@ -2304,7 +2306,7 @@ dependencies = [ "jsonrpc-core-client 14.2.0", "jsonrpc-derive 14.2.2", "jsonrpc-pubsub 15.1.0", - "libsecp256k1", + "libsecp256k1 0.3.5", "log", "pallet-ethereum", "pallet-evm", @@ -2328,7 +2330,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.8#7791640de26445134a50f84126909fcab3431a33" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-pre#6235ebb9afe295e8430ec5a889651f6bd7c17bbb" dependencies = [ "ethereum-types", "jsonrpc-core 15.1.0", @@ -2432,7 +2434,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "1.0.0" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.8#7791640de26445134a50f84126909fcab3431a33" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-pre#6235ebb9afe295e8430ec5a889651f6bd7c17bbb" dependencies = [ "ethereum", "parity-scale-codec", @@ -2445,8 +2447,8 @@ dependencies = [ [[package]] name = "fp-evm" -version = "1.0.1-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.8#7791640de26445134a50f84126909fcab3431a33" +version = "2.0.0" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-pre#6235ebb9afe295e8430ec5a889651f6bd7c17bbb" dependencies = [ "evm", "impl-trait-for-tuples 0.1.3", @@ -2458,8 +2460,8 @@ dependencies = [ [[package]] name = "fp-rpc" -version = "1.0.1-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.8#7791640de26445134a50f84126909fcab3431a33" +version = "2.1.0" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-pre#6235ebb9afe295e8430ec5a889651f6bd7c17bbb" dependencies = [ "ethereum", "ethereum-types", @@ -2474,18 +2476,8 @@ dependencies = [ [[package]] name = "fp-storage" -version = "1.0.1-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.8#7791640de26445134a50f84126909fcab3431a33" -dependencies = [ - "ethereum", - "ethereum-types", - "fp-evm", - "parity-scale-codec", - "sp-api", - "sp-core", - "sp-runtime", - "sp-std", -] +version = "2.0.0-dev" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-pre#6235ebb9afe295e8430ec5a889651f6bd7c17bbb" [[package]] name = "frame-benchmarking" @@ -3152,6 +3144,17 @@ dependencies = [ "hmac 0.7.1", ] +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array 0.14.4", + "hmac 0.8.1", +] + [[package]] name = "hostname" version = "0.3.1" @@ -4063,7 +4066,7 @@ dependencies = [ "futures 0.3.15", "futures-timer 3.0.2", "lazy_static", - "libsecp256k1", + "libsecp256k1 0.3.5", "log", "multihash", "multistream-select", @@ -4465,13 +4468,61 @@ dependencies = [ "arrayref", "crunchy", "digest 0.8.1", - "hmac-drbg", + "hmac-drbg 0.2.0", "rand 0.7.3", "sha2 0.8.2", "subtle 2.4.1", "typenum", ] +[[package]] +name = "libsecp256k1" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd1137239ab33b41aa9637a88a28249e5e70c40a42ccc92db7f12cc356c1fcd7" +dependencies = [ + "arrayref", + "base64 0.12.3", + "digest 0.9.0", + "hmac-drbg 0.3.0", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.7.3", + "serde", + "sha2 0.9.5", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle 2.4.1", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" +dependencies = [ + "libsecp256k1-core", +] + [[package]] name = "libz-sys" version = "1.1.3" @@ -4963,7 +5014,7 @@ name = "moonbeam-cli-opt" version = "0.9.6" dependencies = [ "account", - "libsecp256k1", + "libsecp256k1 0.3.5", "primitive-types", "sc-cli", "sha3 0.8.2", @@ -6088,8 +6139,8 @@ dependencies = [ [[package]] name = "pallet-ethereum" -version = "1.0.1-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.8#7791640de26445134a50f84126909fcab3431a33" +version = "3.0.0-dev" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-pre#6235ebb9afe295e8430ec5a889651f6bd7c17bbb" dependencies = [ "ethereum", "ethereum-types", @@ -6100,7 +6151,7 @@ dependencies = [ "fp-storage", "frame-support", "frame-system", - "libsecp256k1", + "libsecp256k1 0.5.0", "pallet-balances", "pallet-evm", "pallet-timestamp", @@ -6126,15 +6177,17 @@ dependencies = [ [[package]] name = "pallet-evm" -version = "3.0.1-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.8#7791640de26445134a50f84126909fcab3431a33" +version = "5.0.0-dev" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-pre#6235ebb9afe295e8430ec5a889651f6bd7c17bbb" dependencies = [ "evm", "evm-gasometer", "evm-runtime", "fp-evm", + "frame-benchmarking", "frame-support", "frame-system", + "hex", "log", "pallet-balances", "pallet-timestamp", @@ -6152,7 +6205,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-bn128" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.8#7791640de26445134a50f84126909fcab3431a33" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-pre#6235ebb9afe295e8430ec5a889651f6bd7c17bbb" dependencies = [ "evm", "fp-evm", @@ -6163,8 +6216,8 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-dispatch" -version = "1.0.1-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.8#7791640de26445134a50f84126909fcab3431a33" +version = "2.0.0-dev" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-pre#6235ebb9afe295e8430ec5a889651f6bd7c17bbb" dependencies = [ "evm", "fp-evm", @@ -6177,8 +6230,8 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" -version = "1.1.0-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.8#7791640de26445134a50f84126909fcab3431a33" +version = "2.0.0-dev" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-pre#6235ebb9afe295e8430ec5a889651f6bd7c17bbb" dependencies = [ "evm", "fp-evm", @@ -6189,8 +6242,8 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-sha3fips" -version = "1.0.1-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.8#7791640de26445134a50f84126909fcab3431a33" +version = "2.0.0-dev" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-pre#6235ebb9afe295e8430ec5a889651f6bd7c17bbb" dependencies = [ "evm", "fp-evm", @@ -6201,8 +6254,8 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" -version = "1.0.1-dev" -source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-v0.9.8#7791640de26445134a50f84126909fcab3431a33" +version = "2.0.0-dev" +source = "git+https://github.com/purestake/frontier?branch=moonbeam-polkadot-pre#6235ebb9afe295e8430ec5a889651f6bd7c17bbb" dependencies = [ "evm", "fp-evm", @@ -7889,7 +7942,7 @@ dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples 0.2.1", - "libsecp256k1", + "libsecp256k1 0.3.5", "log", "pallet-authorship", "pallet-balances", @@ -9561,7 +9614,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#741 dependencies = [ "derive_more", "lazy_static", - "libsecp256k1", + "libsecp256k1 0.3.5", "log", "parity-scale-codec", "parity-wasm 0.42.2", @@ -10890,7 +10943,7 @@ dependencies = [ "hex", "impl-serde", "lazy_static", - "libsecp256k1", + "libsecp256k1 0.3.5", "log", "max-encoded-len", "merlin", @@ -10987,7 +11040,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.8#741 dependencies = [ "futures 0.3.15", "hash-db", - "libsecp256k1", + "libsecp256k1 0.3.5", "log", "parity-scale-codec", "parking_lot 0.11.1", @@ -11871,7 +11924,7 @@ checksum = "01b874a4992538d4b2f4fbbac11b9419d685f4b39bdc3fed95b04e07bfd76040" dependencies = [ "base58", "hmac 0.7.1", - "libsecp256k1", + "libsecp256k1 0.3.5", "memzero", "sha2 0.8.2", ] diff --git a/client/rpc-core/txpool/Cargo.toml b/client/rpc-core/txpool/Cargo.toml index bf8ccd9228..ea62ccbcf2 100644 --- a/client/rpc-core/txpool/Cargo.toml +++ b/client/rpc-core/txpool/Cargo.toml @@ -16,4 +16,4 @@ jsonrpc-derive = "14.0.3" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -fc-rpc-core = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } +fc-rpc-core = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } diff --git a/client/rpc/debug/Cargo.toml b/client/rpc/debug/Cargo.toml index e784d186c5..c64d9c1cc6 100644 --- a/client/rpc/debug/Cargo.toml +++ b/client/rpc/debug/Cargo.toml @@ -25,7 +25,7 @@ sp-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot moonbeam-rpc-core-debug = { path = "../../rpc-core/debug" } moonbeam-rpc-primitives-debug = { path = "../../../primitives/rpc/debug" } -fc-consensus = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } -fc-db = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } -fc-rpc = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } -fp-rpc = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } +fc-consensus = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } +fc-db = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } +fc-rpc = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } +fp-rpc = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } diff --git a/client/rpc/trace/Cargo.toml b/client/rpc/trace/Cargo.toml index 0055661a00..e8b97f5512 100644 --- a/client/rpc/trace/Cargo.toml +++ b/client/rpc/trace/Cargo.toml @@ -28,7 +28,7 @@ sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } -fp-rpc = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } +fp-rpc = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } moonbeam-rpc-primitives-debug = { path = "../../../primitives/rpc/debug" } # Client and RPC @@ -36,7 +36,7 @@ jsonrpc-core = "15.0.0" sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } sc-transaction-graph = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } -fc-rpc = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } -fc-consensus = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } -fc-rpc-core = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } +fc-rpc = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } +fc-consensus = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } +fc-rpc-core = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } moonbeam-rpc-core-trace = { path = "../../rpc-core/trace" } diff --git a/client/rpc/txpool/Cargo.toml b/client/rpc/txpool/Cargo.toml index 4bd82e4f1f..74edc5d623 100644 --- a/client/rpc/txpool/Cargo.toml +++ b/client/rpc/txpool/Cargo.toml @@ -24,4 +24,4 @@ frame-system = { git = "https://github.com/paritytech/substrate", branch = "polk serde = { version = "1.0", features = ["derive"] } moonbeam-rpc-primitives-txpool = { path = "../../../primitives/rpc/txpool" } -fc-rpc = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } +fc-rpc = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index c693debd33..f859df5234 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -81,17 +81,17 @@ sc-consensus-manual-seal = { git = "https://github.com/paritytech/substrate", br frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } -evm = { package = "pallet-evm", git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } -ethereum = { package = "pallet-ethereum", git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } +evm = { package = "pallet-evm", git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } +ethereum = { package = "pallet-ethereum", git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } ethereum-primitives = { package = "ethereum", version = "0.7.1", default-features = false, features = ["with-codec"] } -fc-consensus = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } -fp-consensus = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } -fc-rpc-core = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } -fc-rpc = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } -fp-rpc = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } -fc-db = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } -fc-mapping-sync = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } +fc-consensus = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } +fp-consensus = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } +fc-rpc-core = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } +fc-rpc = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } +fp-rpc = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } +fc-db = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } +fc-mapping-sync = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } # Cumulus dependencies cumulus-client-cli = { git = "https://github.com/purestake/cumulus", branch = "joshy-np098" } diff --git a/node/service/src/rpc.rs b/node/service/src/rpc.rs index be878531cd..cd973053b8 100644 --- a/node/service/src/rpc.rs +++ b/node/service/src/rpc.rs @@ -25,7 +25,7 @@ use sp_block_builder::BlockBuilder; use crate::{client::RuntimeApiCollection, TransactionConverters}; use cli_opt::{EthApi as EthApiCmd, RpcConfig}; use ethereum::EthereumStorageSchema; -use fc_mapping_sync::MappingSyncWorker; +use fc_mapping_sync::{MappingSyncWorker, SyncStrategy}; use fc_rpc::{ EthApi, EthApiServer, EthFilterApi, EthFilterApiServer, EthPubSubApi, EthPubSubApiServer, EthTask, HexEncodedIdProvider, NetApi, NetApiServer, OverrideHandle, RuntimeApiStorageOverride, @@ -175,7 +175,7 @@ where pending_transactions, signers, overrides.clone(), - frontier_backend, + frontier_backend.clone(), is_authority, max_past_logs, ))); @@ -183,6 +183,7 @@ where if let Some(filter_pool) = filter_pool { io.extend_with(EthFilterApiServer::to_delegate(EthFilterApi::new( client.clone(), + frontier_backend, filter_pool, 500_usize, // max stored filters overrides.clone(), @@ -299,6 +300,7 @@ where params.client.clone(), params.substrate_backend.clone(), params.frontier_backend.clone(), + SyncStrategy::Parachain, ) .for_each(|()| futures::future::ready(())), ); @@ -350,6 +352,14 @@ where ); } + params.task_manager.spawn_essential_handle().spawn( + "frontier-schema-cache-task", + EthTask::ethereum_schema_cache_task( + Arc::clone(¶ms.client), + Arc::clone(¶ms.frontier_backend), + ), + ); + RpcRequesters { debug: debug_requester, trace: trace_filter_requester, diff --git a/precompiles/crowdloan-rewards/Cargo.toml b/precompiles/crowdloan-rewards/Cargo.toml index 4a2bce724d..961be39f45 100644 --- a/precompiles/crowdloan-rewards/Cargo.toml +++ b/precompiles/crowdloan-rewards/Cargo.toml @@ -13,7 +13,7 @@ frame-support = { git = "https://github.com/paritytech/substrate", branch = "pol evm = { version = "0.27.0", default-features = false, features = ["with-codec"] } sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } -pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.8" } +pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-pre" } pallet-crowdloan-rewards = { git = "https://github.com/purestake/crowdloan-rewards", default-features = false, branch = "main" } frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } precompile-utils = { path = "../utils", default-features = false } diff --git a/precompiles/crowdloan-rewards/src/mock.rs b/precompiles/crowdloan-rewards/src/mock.rs index 56e9032c26..4abd59261b 100644 --- a/precompiles/crowdloan-rewards/src/mock.rs +++ b/precompiles/crowdloan-rewards/src/mock.rs @@ -225,6 +225,8 @@ impl pallet_evm::Config for Test { type ChainId = (); type OnChargeTransaction = (); type BlockGasLimit = (); + type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping; + type FindAuthor = (); } parameter_types! { diff --git a/precompiles/parachain-staking/Cargo.toml b/precompiles/parachain-staking/Cargo.toml index 874f042a9d..39a1df14b1 100644 --- a/precompiles/parachain-staking/Cargo.toml +++ b/precompiles/parachain-staking/Cargo.toml @@ -15,7 +15,7 @@ evm = { version = "0.27.0", default-features = false, features = ["with-codec"] sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } -pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.8" } +pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-pre" } parachain-staking = { path = "../../pallets/parachain-staking", default-features = false } frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } diff --git a/precompiles/utils/Cargo.toml b/precompiles/utils/Cargo.toml index 6cc9af4927..ad82bd8254 100644 --- a/precompiles/utils/Cargo.toml +++ b/precompiles/utils/Cargo.toml @@ -16,7 +16,7 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } -pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.8" } +pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-pre" } evm = { version = "0.27.0", default-features = false, features = ["with-codec"] } [features] diff --git a/primitives/account/Cargo.toml b/primitives/account/Cargo.toml index 40b24c8c5a..a20ef0f02e 100644 --- a/primitives/account/Cargo.toml +++ b/primitives/account/Cargo.toml @@ -24,7 +24,7 @@ sp-core = { git = "https://github.com/paritytech/substrate", default-features = sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } -pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.8" } +pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-pre" } libsecp256k1 = { version = "0.3.2", default-features = false, features = ["hmac"] } [dev-dependencies] diff --git a/runtime/common/src/apis.rs b/runtime/common/src/apis.rs index 3136de678a..4ce85aa477 100644 --- a/runtime/common/src/apis.rs +++ b/runtime/common/src/apis.rs @@ -220,7 +220,7 @@ macro_rules! impl_runtime_apis_plus_common { } fn author() -> H160 { - Ethereum::find_author() + >::find_author() } fn storage_at(address: H160, index: U256) -> H256 { @@ -317,6 +317,15 @@ macro_rules! impl_runtime_apis_plus_common { Ethereum::current_transaction_statuses(), ) } + + fn extrinsic_filter( + xts: Vec<::Extrinsic>, + ) -> Vec { + xts.into_iter().filter_map(|xt| match xt.function { + Call::Ethereum(transact(t)) => Some(t), + _ => None + }).collect::>() + } } impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi diff --git a/runtime/evm_tracer/Cargo.toml b/runtime/evm_tracer/Cargo.toml index 545b77a7dc..66a9e04d26 100644 --- a/runtime/evm_tracer/Cargo.toml +++ b/runtime/evm_tracer/Cargo.toml @@ -9,8 +9,8 @@ repository = 'https://github.com/PureStake/moonbeam/' [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } -fp-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.8" } -pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.8" } +fp-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-pre" } +pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-pre" } evm = { version = "0.27.0", default-features = false, features = ["with-codec", "tracing"] } evm-runtime = { version = "0.27.0", default-features = false, features = ["tracing"] } evm-gasometer = { version = "0.27.0", default-features = false, features = ["tracing"] } diff --git a/runtime/moonbase/Cargo.toml b/runtime/moonbase/Cargo.toml index 0f30096005..9188d2e227 100644 --- a/runtime/moonbase/Cargo.toml +++ b/runtime/moonbase/Cargo.toml @@ -25,11 +25,11 @@ pallet-author-slot-filter = { git = "https://github.com/purestake/cumulus", bran nimbus-primitives = { git = "https://github.com/purestake/cumulus", branch = "joshy-np098", default-features = false } pallet-author-mapping = { path = "../../pallets/author-mapping", default-features = false } evm = { version = "0.27.0", default-features = false, features = ["with-codec"] } -pallet-evm-precompile-bn128 = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.8" } -pallet-evm-precompile-dispatch = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.8" } -pallet-evm-precompile-modexp = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.8" } -pallet-evm-precompile-simple = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.8" } -pallet-evm-precompile-sha3fips = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.8" } +pallet-evm-precompile-bn128 = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-pre" } +pallet-evm-precompile-dispatch = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-pre" } +pallet-evm-precompile-modexp = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-pre" } +pallet-evm-precompile-simple = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-pre" } +pallet-evm-precompile-sha3fips = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-pre" } # Substrate dependencies @@ -57,11 +57,11 @@ pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } -pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.8" } +pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-pre" } pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } -pallet-ethereum = { default-features = false, git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } -fp-rpc = { default-features = false, git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } +pallet-ethereum = { default-features = false, git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } +fp-rpc = { default-features = false, git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } pallet-democracy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } pallet-scheduler = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } diff --git a/runtime/moonbase/src/lib.rs b/runtime/moonbase/src/lib.rs index f150a9d22f..7dd3bc274f 100644 --- a/runtime/moonbase/src/lib.rs +++ b/runtime/moonbase/src/lib.rs @@ -339,6 +339,7 @@ pub type SlowAdjustingFeeUpdate = impl pallet_evm::Config for Runtime { type FeeCalculator = FixedGasPrice; type GasWeightMapping = MoonbeamGasWeightMapping; + type BlockHashMapping = pallet_ethereum::EthereumBlockHashMapping; type CallOrigin = EnsureAddressRoot; type WithdrawOrigin = EnsureAddressNever; type AddressMapping = IdentityAddressMapping; @@ -349,6 +350,7 @@ impl pallet_evm::Config for Runtime { type ChainId = EthereumChainId; type OnChargeTransaction = (); type BlockGasLimit = BlockGasLimit; + type FindAuthor = AuthorInherent; } parameter_types! { @@ -544,7 +546,6 @@ impl fp_rpc::ConvertTransaction for TransactionConve impl pallet_ethereum::Config for Runtime { type Event = Event; - type FindAuthor = AuthorInherent; type StateRoot = pallet_ethereum::IntermediateStateRoot; } diff --git a/runtime/moonbase/tests/common/mod.rs b/runtime/moonbase/tests/common/mod.rs index 1da623532a..a0b0cd4f77 100644 --- a/runtime/moonbase/tests/common/mod.rs +++ b/runtime/moonbase/tests/common/mod.rs @@ -188,12 +188,10 @@ impl ExtBuilder { ) .unwrap(); - >::assimilate_storage( - &pallet_evm::GenesisConfig { - accounts: self.evm_accounts, - }, - &mut t, - ) + pallet_evm::GenesisConfig { + accounts: self.evm_accounts, + } + .assimilate_storage::(&mut t) .unwrap(); pallet_ethereum::GenesisConfig::assimilate_storage::( diff --git a/runtime/moonbase/tests/runtime_apis.rs b/runtime/moonbase/tests/runtime_apis.rs index a2ed062136..d6b53f3763 100644 --- a/runtime/moonbase/tests/runtime_apis.rs +++ b/runtime/moonbase/tests/runtime_apis.rs @@ -300,7 +300,7 @@ fn txpool_runtime_api_extrinsic_filter() { pallet_balances::Call::::transfer(AccountId::from(BOB), 1 * UNIT).into(), ); let eth_uxt = uxt(); - let txpool = Runtime::extrinsic_filter( + let txpool = >::extrinsic_filter( vec![eth_uxt.clone(), non_eth_uxt.clone()], vec![uxt(), non_eth_uxt], ); diff --git a/runtime/moonbeam/Cargo.toml b/runtime/moonbeam/Cargo.toml index b1801f40d9..89e205c60e 100644 --- a/runtime/moonbeam/Cargo.toml +++ b/runtime/moonbeam/Cargo.toml @@ -25,11 +25,11 @@ pallet-author-slot-filter = { git = "https://github.com/purestake/cumulus", bran nimbus-primitives = { git = "https://github.com/purestake/cumulus", branch = "joshy-np098", default-features = false } pallet-author-mapping = { path = "../../pallets/author-mapping", default-features = false } evm = { version="0.27.0", default-features=false, features=["with-codec"] } -pallet-evm-precompile-bn128 = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-v0.9.8" } -pallet-evm-precompile-dispatch = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-v0.9.8" } -pallet-evm-precompile-modexp = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-v0.9.8" } -pallet-evm-precompile-simple = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-v0.9.8" } -pallet-evm-precompile-sha3fips = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-v0.9.8" } +pallet-evm-precompile-bn128 = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-pre" } +pallet-evm-precompile-dispatch = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-pre" } +pallet-evm-precompile-modexp = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-pre" } +pallet-evm-precompile-simple = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-pre" } +pallet-evm-precompile-sha3fips = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-pre" } # Substrate dependencies sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } @@ -56,11 +56,11 @@ pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } -pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.8" } +pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-pre" } pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } -pallet-ethereum = { default-features = false, git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } -fp-rpc = { default-features = false, git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } +pallet-ethereum = { default-features = false, git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } +fp-rpc = { default-features = false, git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } pallet-democracy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } pallet-scheduler = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } diff --git a/runtime/moonbeam/src/lib.rs b/runtime/moonbeam/src/lib.rs index b07c1a76a1..5c12c06005 100644 --- a/runtime/moonbeam/src/lib.rs +++ b/runtime/moonbeam/src/lib.rs @@ -354,6 +354,7 @@ pub type SlowAdjustingFeeUpdate = impl pallet_evm::Config for Runtime { type FeeCalculator = FixedGasPrice; type GasWeightMapping = MoonbeamGasWeightMapping; + type BlockHashMapping = pallet_ethereum::EthereumBlockHashMapping; type CallOrigin = EnsureAddressRoot; type WithdrawOrigin = EnsureAddressNever; type AddressMapping = IdentityAddressMapping; @@ -364,6 +365,7 @@ impl pallet_evm::Config for Runtime { type ChainId = EthereumChainId; type OnChargeTransaction = (); type BlockGasLimit = BlockGasLimit; + type FindAuthor = AuthorInherent; } parameter_types! { @@ -548,7 +550,6 @@ impl fp_rpc::ConvertTransaction for TransactionConve impl pallet_ethereum::Config for Runtime { type Event = Event; - type FindAuthor = AuthorInherent; type StateRoot = pallet_ethereum::IntermediateStateRoot; } diff --git a/runtime/moonbeam/tests/common/mod.rs b/runtime/moonbeam/tests/common/mod.rs index 0afedd2549..dff41fcba8 100644 --- a/runtime/moonbeam/tests/common/mod.rs +++ b/runtime/moonbeam/tests/common/mod.rs @@ -188,12 +188,10 @@ impl ExtBuilder { ) .unwrap(); - >::assimilate_storage( - &pallet_evm::GenesisConfig { - accounts: self.evm_accounts, - }, - &mut t, - ) + pallet_evm::GenesisConfig { + accounts: self.evm_accounts, + } + .assimilate_storage::(&mut t) .unwrap(); pallet_ethereum::GenesisConfig::assimilate_storage::( diff --git a/runtime/moonbeam/tests/runtime_apis.rs b/runtime/moonbeam/tests/runtime_apis.rs index ca6b8cd0a5..c138a2595f 100644 --- a/runtime/moonbeam/tests/runtime_apis.rs +++ b/runtime/moonbeam/tests/runtime_apis.rs @@ -307,7 +307,7 @@ fn txpool_runtime_api_extrinsic_filter() { pallet_balances::Call::::transfer(AccountId::from(BOB), 1 * GLMR).into(), ); let eth_uxt = uxt(); - let txpool = Runtime::extrinsic_filter( + let txpool = >::extrinsic_filter( vec![eth_uxt.clone(), non_eth_uxt.clone()], vec![uxt(), non_eth_uxt], ); diff --git a/runtime/moonriver/Cargo.toml b/runtime/moonriver/Cargo.toml index 0ba0630efb..42b6b893b4 100644 --- a/runtime/moonriver/Cargo.toml +++ b/runtime/moonriver/Cargo.toml @@ -25,11 +25,11 @@ pallet-author-slot-filter = { git = "https://github.com/purestake/cumulus", bran nimbus-primitives = { git = "https://github.com/purestake/cumulus", branch = "joshy-np098", default-features = false } pallet-author-mapping = { path = "../../pallets/author-mapping", default-features = false } evm = { version="0.27.0", default-features=false, features=["with-codec"] } -pallet-evm-precompile-bn128 = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-v0.9.8" } -pallet-evm-precompile-dispatch = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-v0.9.8" } -pallet-evm-precompile-modexp = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-v0.9.8" } -pallet-evm-precompile-simple = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-v0.9.8" } -pallet-evm-precompile-sha3fips = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-v0.9.8" } +pallet-evm-precompile-bn128 = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-pre" } +pallet-evm-precompile-dispatch = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-pre" } +pallet-evm-precompile-modexp = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-pre" } +pallet-evm-precompile-simple = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-pre" } +pallet-evm-precompile-sha3fips = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-pre" } # Substrate dependencies sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } @@ -55,11 +55,11 @@ pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } -pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.8" } +pallet-evm = { git = "https://github.com/purestake/frontier", default-features = false, branch = "moonbeam-polkadot-pre" } pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } -pallet-ethereum = { default-features = false, git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } -fp-rpc = { default-features = false, git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.8" } +pallet-ethereum = { default-features = false, git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } +fp-rpc = { default-features = false, git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-pre" } pallet-democracy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } pallet-scheduler = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } diff --git a/runtime/moonriver/src/lib.rs b/runtime/moonriver/src/lib.rs index 57649dd8e7..6c8c06deaa 100644 --- a/runtime/moonriver/src/lib.rs +++ b/runtime/moonriver/src/lib.rs @@ -350,6 +350,7 @@ pub type SlowAdjustingFeeUpdate = impl pallet_evm::Config for Runtime { type FeeCalculator = FixedGasPrice; type GasWeightMapping = MoonbeamGasWeightMapping; + type BlockHashMapping = pallet_ethereum::EthereumBlockHashMapping; type CallOrigin = EnsureAddressRoot; type WithdrawOrigin = EnsureAddressNever; type AddressMapping = IdentityAddressMapping; @@ -360,6 +361,7 @@ impl pallet_evm::Config for Runtime { type ChainId = EthereumChainId; type OnChargeTransaction = (); type BlockGasLimit = BlockGasLimit; + type FindAuthor = AuthorInherent; } parameter_types! { @@ -555,7 +557,6 @@ impl fp_rpc::ConvertTransaction for TransactionConve impl pallet_ethereum::Config for Runtime { type Event = Event; - type FindAuthor = AuthorInherent; type StateRoot = pallet_ethereum::IntermediateStateRoot; } diff --git a/runtime/moonriver/tests/common/mod.rs b/runtime/moonriver/tests/common/mod.rs index d43c2eac82..df0c2210e1 100644 --- a/runtime/moonriver/tests/common/mod.rs +++ b/runtime/moonriver/tests/common/mod.rs @@ -188,12 +188,10 @@ impl ExtBuilder { ) .unwrap(); - >::assimilate_storage( - &pallet_evm::GenesisConfig { - accounts: self.evm_accounts, - }, - &mut t, - ) + pallet_evm::GenesisConfig { + accounts: self.evm_accounts, + } + .assimilate_storage::(&mut t) .unwrap(); pallet_ethereum::GenesisConfig::assimilate_storage::( diff --git a/runtime/moonriver/tests/runtime_apis.rs b/runtime/moonriver/tests/runtime_apis.rs index 94a1f828fb..f24095a1ce 100644 --- a/runtime/moonriver/tests/runtime_apis.rs +++ b/runtime/moonriver/tests/runtime_apis.rs @@ -307,7 +307,7 @@ fn txpool_runtime_api_extrinsic_filter() { pallet_balances::Call::::transfer(AccountId::from(BOB), 1 * MOVR).into(), ); let eth_uxt = uxt(); - let txpool = Runtime::extrinsic_filter( + let txpool = >::extrinsic_filter( vec![eth_uxt.clone(), non_eth_uxt.clone()], vec![uxt(), non_eth_uxt], ); diff --git a/tests/tests/test-block-1.ts b/tests/tests/test-block-1.ts index 8056fc84db..9b8f581a34 100644 --- a/tests/tests/test-block-1.ts +++ b/tests/tests/test-block-1.ts @@ -31,7 +31,7 @@ describeDevMoonbeam("Block 1", (context) => { logsBloom: `0x${"0".repeat(512)}`, miner: "0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac", number: 1, - receiptsRoot: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + receiptsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", totalDifficulty: "0", transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", diff --git a/tests/tests/test-block-genesis.ts b/tests/tests/test-block-genesis.ts index d7b78e55ca..f5c9217021 100644 --- a/tests/tests/test-block-genesis.ts +++ b/tests/tests/test-block-genesis.ts @@ -17,7 +17,7 @@ describeDevMoonbeam("Block genesis", (context) => { gasUsed: 0, logsBloom: `0x${"0".repeat(512)}`, number: 0, - receiptsRoot: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + receiptsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", totalDifficulty: "0", transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", @@ -46,7 +46,7 @@ describeDevMoonbeam("Block genesis", (context) => { gasUsed: 0, logsBloom: `0x${"0".repeat(512)}`, number: 0, - receiptsRoot: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + receiptsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", totalDifficulty: "0", transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", diff --git a/tests/tests/test-subscription.ts b/tests/tests/test-subscription.ts index 0e3ad84658..55d2bfa40c 100644 --- a/tests/tests/test-subscription.ts +++ b/tests/tests/test-subscription.ts @@ -51,7 +51,7 @@ describeDevMoonbeam("Subscription - Block headers", (context) => { extraData: "0x", logsBloom: `0x${"0".repeat(512)}`, miner: "0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac", - receiptsRoot: "0x3f9d4f18305cd0de20569ab8f7efb114f6374c65d0f02fbc80fd275317b1d375", + receiptsRoot: "0xb641ad10026d278e29908b40c13ab496f2d9b719fc9b788c0504a8e5a2347bf3", sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", transactionsRoot: "0xf04aada99f08ad276fb593633bcb320bbbaf4499e9bfa8d59a7385e1772c6bcd", });