diff --git a/bin/collator/src/rpc.rs b/bin/collator/src/rpc.rs index 62a52194b6..04d86c97a3 100644 --- a/bin/collator/src/rpc.rs +++ b/bin/collator/src/rpc.rs @@ -20,7 +20,8 @@ use fc_rpc::{ Eth, EthApiServer, EthBlockDataCacheTask, EthFilter, EthFilterApiServer, EthPubSub, - EthPubSubApiServer, Net, NetApiServer, OverrideHandle, Web3, Web3ApiServer, + EthPubSubApiServer, Net, NetApiServer, OverrideHandle, TxPool, TxPoolApiServer, Web3, + Web3ApiServer, }; use fc_rpc_core::types::{FeeHistoryCache, FilterPool}; use jsonrpsee::RpcModule; @@ -45,6 +46,7 @@ use substrate_frame_rpc_system::{System, SystemApiServer}; use moonbeam_rpc_debug::{Debug, DebugServer}; #[cfg(feature = "evm-tracing")] use moonbeam_rpc_trace::{Trace, TraceServer}; +// TODO: get rid of this completely now that it's part of frontier? #[cfg(feature = "evm-tracing")] use moonbeam_rpc_txpool::{TxPool, TxPoolServer}; @@ -142,8 +144,8 @@ where C: sc_client_api::BlockBackend, C::Api: substrate_frame_rpc_system::AccountNonceApi + pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi - + fp_rpc::ConvertTransactionRuntimeApi - + fp_rpc::EthereumRuntimeRPCApi + + ConvertTransactionRuntimeApi + + EthereumRuntimeRPCApi + BlockBuilder + moonbeam_rpc_primitives_debug::DebugRuntimeApi + moonbeam_rpc_primitives_txpool::TxPoolRuntimeApi, @@ -300,10 +302,12 @@ where let max_past_logs: u32 = 10_000; let max_stored_filters: usize = 500; + let tx_pool = TxPool::new(client.clone(), graph); io.merge( EthFilter::new( client.clone(), frontier_backend, + tx_pool.clone(), filter_pool, max_stored_filters, max_past_logs, @@ -327,6 +331,7 @@ where ) .into_rpc(), )?; + io.merge(tx_pool.into_rpc())?; Ok(io) } diff --git a/pallets/contracts-migration/src/lib.rs b/pallets/contracts-migration/src/lib.rs index f2e5b7e5e2..2c6d9ef777 100644 --- a/pallets/contracts-migration/src/lib.rs +++ b/pallets/contracts-migration/src/lib.rs @@ -294,7 +294,7 @@ pub mod pallet { } #[cfg(feature = "try-runtime")] - fn post_upgrade(_state: Vec) -> Result<(), &'static str> { + fn post_upgrade(_state: Vec) -> Result<(), sp_runtime::TryRuntimeError> { for value in CodeStorage::::iter_values() { ensure!( value.determinism == Determinism::Enforced, diff --git a/pallets/pallet-xcm/src/migration.rs b/pallets/pallet-xcm/src/migration.rs index ddee5a4399..1a91403a71 100644 --- a/pallets/pallet-xcm/src/migration.rs +++ b/pallets/pallet-xcm/src/migration.rs @@ -33,7 +33,7 @@ pub mod v1 { pub struct MigrateToV1(sp_std::marker::PhantomData); impl OnRuntimeUpgrade for MigrateToV1 { #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { + fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { ensure!( StorageVersion::get::>() == 0, "must upgrade linearly" diff --git a/pallets/xc-asset-config/src/migrations.rs b/pallets/xc-asset-config/src/migrations.rs index 944a7d1ca5..e1a445564e 100644 --- a/pallets/xc-asset-config/src/migrations.rs +++ b/pallets/xc-asset-config/src/migrations.rs @@ -86,7 +86,7 @@ impl OnRuntimeUpgrade for MigrationXcmV3 { } #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { + fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { assert!(Pallet::::on_chain_storage_version() < 2); let id_to_location_entries: Vec<_> = AssetIdToLocation::::iter().collect(); @@ -94,7 +94,7 @@ impl OnRuntimeUpgrade for MigrationXcmV3 { } #[cfg(feature = "try-runtime")] - fn post_upgrade(state: Vec) -> Result<(), &'static str> { + fn post_upgrade(state: Vec) -> Result<(), sp_runtime::TryRuntimeError> { assert_eq!(Pallet::::on_chain_storage_version(), 2); use xcm::VersionedMultiLocation; diff --git a/runtime/astar/src/lib.rs b/runtime/astar/src/lib.rs index b14b509e6e..df2a2d01f1 100644 --- a/runtime/astar/src/lib.rs +++ b/runtime/astar/src/lib.rs @@ -32,7 +32,7 @@ use frame_support::{ parameter_types, traits::{ AsEnsureOriginWithArg, ConstBool, ConstU32, Contains, Currency, FindAuthor, Get, Imbalance, - InstanceFilter, Nothing, OnUnbalanced, Randomness, WithdrawReasons, + InstanceFilter, Nothing, OnFinalize, OnUnbalanced, Randomness, WithdrawReasons, }, weights::{ constants::{ @@ -1094,30 +1094,6 @@ type EventRecord = frame_system::EventRecord< ::Hash, >; -use frame_support::pallet_prelude::*; -pub struct PalletContractsV9(PhantomData); -impl frame_support::traits::OnRuntimeUpgrade for PalletContractsV9 { - fn on_runtime_upgrade() -> Weight { - let version = >::on_chain_storage_version(); - - if version >= 9 { - return T::DbWeight::get().reads(1); - } - - StorageVersion::new(9).put::>(); - T::DbWeight::get().reads_writes(1, 1) - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade(_state: Vec) -> Result<(), &'static str> { - ensure!( - >::on_chain_storage_version() == 9, - "pallet-contracts storage version must be 9 at the end of migration" - ); - Ok(()) - } -} - impl fp_self_contained::SelfContainedCall for RuntimeCall { type SignedInfo = H160;