From 88a8ce2eb2b2700f4808ab723753aa879ef10be4 Mon Sep 17 00:00:00 2001 From: David Himmelstrup Date: Thu, 6 Mar 2025 13:59:56 +0100 Subject: [PATCH] remove unused sync-config fields --- src/chain_sync/chain_follower.rs | 2 ++ src/chain_sync/chain_muxer.rs | 13 ------------- src/cli_shared/cli/mod.rs | 7 ------- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/src/chain_sync/chain_follower.rs b/src/chain_sync/chain_follower.rs index 77690e96070..e045d7a9b5d 100644 --- a/src/chain_sync/chain_follower.rs +++ b/src/chain_sync/chain_follower.rs @@ -141,8 +141,10 @@ pub async fn chain_follower( let network = network.clone(); async move { while let Ok(event) = network_rx.recv_async().await { + // FIXME: Event metrics are not related to the chain follower. Should be moved elsewhere. inc_gossipsub_event_metrics(&event); + // FIXME: Keeping peer information up to date is not related to the chain follower. Should be moved elsewhere. upd_peer_information( &event, network.clone(), diff --git a/src/chain_sync/chain_muxer.rs b/src/chain_sync/chain_muxer.rs index 5202bc2d4a4..a8db577977b 100644 --- a/src/chain_sync/chain_muxer.rs +++ b/src/chain_sync/chain_muxer.rs @@ -3,34 +3,21 @@ use serde::{Deserialize, Serialize}; -// Sync the messages for one or many tipsets @ a time -// Lotus uses a window size of 8: https://github.com/filecoin-project/lotus/blob/c1d22d8b3298fdce573107413729be608e72187d/chain/sync.go#L56 -const DEFAULT_REQUEST_WINDOW: usize = 8; -const DEFAULT_TIPSET_SAMPLE_SIZE: usize = 1; const DEFAULT_RECENT_STATE_ROOTS: i64 = 2000; /// Structure that defines syncing configuration options #[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)] #[cfg_attr(test, derive(derive_quickcheck_arbitrary::Arbitrary))] pub struct SyncConfig { - /// Request window length for tipsets during chain exchange - #[cfg_attr(test, arbitrary(gen(|g| u32::arbitrary(g) as _)))] - pub request_window: usize, /// Number of recent state roots to keep in the database after `sync` /// and to include in the exported snapshot. pub recent_state_roots: i64, - /// Sample size of tipsets to acquire before determining what the network - /// head is - #[cfg_attr(test, arbitrary(gen(|g| u32::arbitrary(g) as _)))] - pub tipset_sample_size: usize, } impl Default for SyncConfig { fn default() -> Self { Self { - request_window: DEFAULT_REQUEST_WINDOW, recent_state_roots: DEFAULT_RECENT_STATE_ROOTS, - tipset_sample_size: DEFAULT_TIPSET_SAMPLE_SIZE, } } } diff --git a/src/cli_shared/cli/mod.rs b/src/cli_shared/cli/mod.rs index 46ee377c282..4d4da902e5b 100644 --- a/src/cli_shared/cli/mod.rs +++ b/src/cli_shared/cli/mod.rs @@ -217,13 +217,6 @@ impl CliOpts { } // (where to find these flags, should be easy to do with structops) - // check and set syncing configurations - if let Some(req_window) = self.req_window { - cfg.sync.request_window = req_window; - } - if let Some(tipset_sample_size) = self.tipset_sample_size { - cfg.sync.tipset_sample_size = tipset_sample_size.into(); - } if let Some(encrypt_keystore) = self.encrypt_keystore { cfg.client.encrypt_keystore = encrypt_keystore; }