Upgrade polkadot sdk v1.13.0 (#298)

* generic template updated to v1.13.0

* evm dependency upgrades

* evm dependency upgrades after moonbeam

* importing frontier updates 

* upgrade fuzzer to v1.11.0 

* upgrade fuzzer to v1.12.0

* generic template fuzzer updated

* evm fuzzer

---------

Co-authored-by: Nikita Khateev <nikita.khateev@openzeppelin.com>
This commit is contained in:
Özgün Özerk
2024-09-13 12:18:35 +03:00
committed by GitHub
parent a4b7acf9bd
commit ba730fab22
31 changed files with 4973 additions and 4319 deletions
+22 -16
View File
@@ -7,12 +7,13 @@ use std::{
// Local
use evm_runtime_template::opaque::Block;
use fc_rpc::{EthTask, OverrideHandle};
use fc_rpc::EthTask;
pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool};
pub use fc_storage::{StorageOverride, StorageOverrideHandler};
use futures::{future, prelude::*};
// Substrate
use sc_client_api::BlockchainEvents;
use sc_executor::WasmExecutor;
use sc_executor::{HostFunctions, WasmExecutor};
use sc_network_sync::SyncingService;
use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
use sp_api::ConstructRuntimeApi;
@@ -24,7 +25,7 @@ pub type FullClient<RuntimeApi, Executor> =
sc_service::TFullClient<Block, RuntimeApi, WasmExecutor<Executor>>;
/// Frontier DB backend type.
pub type FrontierBackend = fc_db::Backend<Block>;
pub type FrontierBackend<C> = fc_db::Backend<Block, C>;
pub fn db_config_dir(config: &Configuration) -> PathBuf {
config.base_path.config_dir(config.chain_spec.id())
@@ -124,13 +125,13 @@ impl<Api> EthCompatRuntimeApiCollection for Api where
{
}
pub async fn spawn_frontier_tasks<RuntimeApi, Functions>(
pub async fn spawn_frontier_tasks<RuntimeApi, Executor>(
task_manager: &TaskManager,
client: Arc<FullClient<RuntimeApi, Functions>>,
client: Arc<FullClient<RuntimeApi, Executor>>,
backend: Arc<FullBackend>,
frontier_backend: FrontierBackend,
frontier_backend: Arc<FrontierBackend<FullClient<RuntimeApi, Executor>>>,
filter_pool: Option<FilterPool>,
overrides: Arc<OverrideHandle<Block>>,
storage_override: Arc<dyn StorageOverride<Block>>,
fee_history_cache: FeeHistoryCache,
fee_history_cache_limit: FeeHistoryCacheLimit,
sync: Arc<SyncingService<Block>>,
@@ -140,13 +141,13 @@ pub async fn spawn_frontier_tasks<RuntimeApi, Functions>(
>,
>,
) where
RuntimeApi: ConstructRuntimeApi<Block, FullClient<RuntimeApi, Functions>>,
RuntimeApi: ConstructRuntimeApi<Block, FullClient<RuntimeApi, Executor>>,
RuntimeApi: Send + Sync + 'static,
RuntimeApi::RuntimeApi: EthCompatRuntimeApiCollection,
Functions: sc_executor::sp_wasm_interface::HostFunctions,
Executor: HostFunctions + 'static,
{
// Spawn main mapping sync worker background task.
match frontier_backend {
match &*frontier_backend {
fc_db::Backend::KeyValue(b) => {
task_manager.spawn_essential_handle().spawn(
"frontier-mapping-sync-worker",
@@ -156,10 +157,10 @@ pub async fn spawn_frontier_tasks<RuntimeApi, Functions>(
Duration::new(6, 0),
client.clone(),
backend,
overrides.clone(),
Arc::new(b),
storage_override.clone(),
b.clone(),
3,
0,
0u32,
fc_mapping_sync::SyncStrategy::Normal,
sync,
pubsub_notification_sinks,
@@ -174,10 +175,10 @@ pub async fn spawn_frontier_tasks<RuntimeApi, Functions>(
fc_mapping_sync::sql::SyncWorker::run(
client.clone(),
backend,
Arc::new(b),
b.clone(),
client.import_notification_stream(),
fc_mapping_sync::sql::SyncWorkerConfig {
read_notification_timeout: Duration::from_secs(10),
read_notification_timeout: Duration::from_secs(30),
check_indexed_blocks_interval: Duration::from_secs(60),
},
fc_mapping_sync::SyncStrategy::Parachain,
@@ -203,6 +204,11 @@ pub async fn spawn_frontier_tasks<RuntimeApi, Functions>(
task_manager.spawn_essential_handle().spawn(
"frontier-fee-history",
Some("frontier"),
EthTask::fee_history_task(client, overrides, fee_history_cache, fee_history_cache_limit),
EthTask::fee_history_task(
client,
storage_override,
fee_history_cache,
fee_history_cache_limit,
),
);
}