From eb8296ea13366356d7e6835a61cc03ea5bbb6368 Mon Sep 17 00:00:00 2001 From: notlesh Date: Mon, 5 Jun 2023 18:01:35 +0000 Subject: [PATCH] Add GMP precompile to Moonriver and Moonbeam runtimes --- Cargo.lock | 2 ++ runtime/moonbeam/Cargo.toml | 1 + runtime/moonbeam/src/precompiles.rs | 2 ++ runtime/moonbeam/tests/integration_test.rs | 2 +- runtime/moonriver/Cargo.toml | 1 + runtime/moonriver/src/precompiles.rs | 2 ++ runtime/moonriver/tests/integration_test.rs | 2 +- 7 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 52b21565a5..2ae88418a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5906,6 +5906,7 @@ dependencies = [ "pallet-evm-precompile-crowdloan-rewards", "pallet-evm-precompile-democracy", "pallet-evm-precompile-dispatch", + "pallet-evm-precompile-gmp", "pallet-evm-precompile-modexp", "pallet-evm-precompile-parachain-staking", "pallet-evm-precompile-preimage", @@ -6255,6 +6256,7 @@ dependencies = [ "pallet-evm-precompile-crowdloan-rewards", "pallet-evm-precompile-democracy", "pallet-evm-precompile-dispatch", + "pallet-evm-precompile-gmp", "pallet-evm-precompile-modexp", "pallet-evm-precompile-parachain-staking", "pallet-evm-precompile-preimage", diff --git a/runtime/moonbeam/Cargo.toml b/runtime/moonbeam/Cargo.toml index 9f38be91a2..461c431302 100644 --- a/runtime/moonbeam/Cargo.toml +++ b/runtime/moonbeam/Cargo.toml @@ -51,6 +51,7 @@ pallet-evm-precompile-collective = { workspace = true } pallet-evm-precompile-conviction-voting = { workspace = true } pallet-evm-precompile-crowdloan-rewards = { workspace = true } pallet-evm-precompile-democracy = { workspace = true } +pallet-evm-precompile-gmp = { workspace = true } pallet-evm-precompile-parachain-staking = { workspace = true } pallet-evm-precompile-preimage = { workspace = true } pallet-evm-precompile-proxy = { workspace = true } diff --git a/runtime/moonbeam/src/precompiles.rs b/runtime/moonbeam/src/precompiles.rs index d4f615d955..e2290e8674 100644 --- a/runtime/moonbeam/src/precompiles.rs +++ b/runtime/moonbeam/src/precompiles.rs @@ -31,6 +31,7 @@ use pallet_evm_precompile_collective::CollectivePrecompile; use pallet_evm_precompile_conviction_voting::ConvictionVotingPrecompile; use pallet_evm_precompile_crowdloan_rewards::CrowdloanRewardsPrecompile; use pallet_evm_precompile_democracy::DemocracyPrecompile; +use pallet_evm_precompile_gmp::GmpPrecompile; use pallet_evm_precompile_modexp::Modexp; use pallet_evm_precompile_parachain_staking::ParachainStakingPrecompile; use pallet_evm_precompile_preimage::PreimagePrecompile; @@ -228,6 +229,7 @@ type MoonbeamPrecompilesAt = ( PrecompileRegistry, (CallableByContract, CallableByPrecompile), >, + PrecompileAt, GmpPrecompile, SubcallWithMaxNesting<0>>, ); /// The PrecompileSet installed in the Moonbeam runtime. diff --git a/runtime/moonbeam/tests/integration_test.rs b/runtime/moonbeam/tests/integration_test.rs index 801b4d66b7..e747e31820 100644 --- a/runtime/moonbeam/tests/integration_test.rs +++ b/runtime/moonbeam/tests/integration_test.rs @@ -2936,7 +2936,7 @@ fn precompile_existence() { let precompile_addresses: std::collections::BTreeSet<_> = vec![ 1, 2, 3, 4, 5, 6, 7, 8, 9, 1024, 1025, 1026, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 2055, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 2063, 2064, 2065, 2066, 2067, 2068, - 2069, + 2069, 2070, ] .into_iter() .map(H160::from_low_u64_be) diff --git a/runtime/moonriver/Cargo.toml b/runtime/moonriver/Cargo.toml index 68a7e22354..5248e60f15 100644 --- a/runtime/moonriver/Cargo.toml +++ b/runtime/moonriver/Cargo.toml @@ -51,6 +51,7 @@ pallet-evm-precompile-collective = { workspace = true } pallet-evm-precompile-conviction-voting = { workspace = true } pallet-evm-precompile-crowdloan-rewards = { workspace = true } pallet-evm-precompile-democracy = { workspace = true } +pallet-evm-precompile-gmp = { workspace = true } pallet-evm-precompile-parachain-staking = { workspace = true } pallet-evm-precompile-preimage = { workspace = true } pallet-evm-precompile-proxy = { workspace = true } diff --git a/runtime/moonriver/src/precompiles.rs b/runtime/moonriver/src/precompiles.rs index 9c32489b57..ec7b624408 100644 --- a/runtime/moonriver/src/precompiles.rs +++ b/runtime/moonriver/src/precompiles.rs @@ -31,6 +31,7 @@ use pallet_evm_precompile_collective::CollectivePrecompile; use pallet_evm_precompile_conviction_voting::ConvictionVotingPrecompile; use pallet_evm_precompile_crowdloan_rewards::CrowdloanRewardsPrecompile; use pallet_evm_precompile_democracy::DemocracyPrecompile; +use pallet_evm_precompile_gmp::GmpPrecompile; use pallet_evm_precompile_modexp::Modexp; use pallet_evm_precompile_parachain_staking::ParachainStakingPrecompile; use pallet_evm_precompile_preimage::PreimagePrecompile; @@ -228,6 +229,7 @@ type MoonriverPrecompilesAt = ( PrecompileRegistry, (CallableByContract, CallableByPrecompile), >, + PrecompileAt, GmpPrecompile, SubcallWithMaxNesting<0>>, ); /// The PrecompileSet installed in the Moonriver runtime. diff --git a/runtime/moonriver/tests/integration_test.rs b/runtime/moonriver/tests/integration_test.rs index 3e926e4e7c..cd42704aa1 100644 --- a/runtime/moonriver/tests/integration_test.rs +++ b/runtime/moonriver/tests/integration_test.rs @@ -2844,7 +2844,7 @@ fn precompile_existence() { let precompile_addresses: std::collections::BTreeSet<_> = vec![ 1, 2, 3, 4, 5, 6, 7, 8, 9, 1024, 1025, 1026, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 2055, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 2063, 2064, 2065, 2066, 2067, 2068, - 2069, + 2069, 2070, ] .into_iter() .map(H160::from_low_u64_be)