Skip to content

Commit a39000d

Browse files
Oppenjrchatruc
andauthored
chore(l1): remove old snap sync dead code (#5283)
**Motivation** I found some dead code looking for uses of `lazy_static`. **Description** Remove no longer used variables. --------- Co-authored-by: Javier Chatruc <[email protected]> Co-authored-by: Javier Rodríguez Chatruc <[email protected]>
1 parent f4905c2 commit a39000d

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

crates/networking/p2p/sync.rs

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,26 @@ use crate::utils::{
1414
};
1515
use crate::{
1616
metrics::METRICS,
17-
peer_handler::{HASH_MAX, MAX_BLOCK_BODIES_TO_REQUEST, PeerHandler},
17+
peer_handler::{MAX_BLOCK_BODIES_TO_REQUEST, PeerHandler},
1818
};
1919
use ethrex_blockchain::{BatchBlockProcessingFailure, Blockchain, error::ChainError};
20+
#[cfg(not(feature = "rocksdb"))]
21+
use ethrex_common::U256;
2022
use ethrex_common::types::Code;
2123
use ethrex_common::{
22-
BigEndianHash, H256, U256,
24+
H256,
2325
constants::{EMPTY_KECCACK_HASH, EMPTY_TRIE_HASH},
2426
types::{AccountState, Block, BlockHash, BlockHeader},
2527
};
2628
use ethrex_rlp::{decode::RLPDecode, encode::RLPEncode, error::RLPDecodeError};
27-
use ethrex_storage::{STATE_TRIE_SEGMENTS, Store, error::StoreError};
29+
use ethrex_storage::{Store, error::StoreError};
2830
use ethrex_trie::trie_sorted::TrieGenerationError;
2931
use ethrex_trie::{Trie, TrieError};
3032
use rayon::iter::{ParallelBridge, ParallelIterator};
3133
use std::collections::{BTreeMap, BTreeSet, HashSet};
3234
use std::path::{Path, PathBuf};
3335
use std::time::{Duration, SystemTime};
3436
use std::{
35-
array,
3637
cmp::min,
3738
collections::HashMap,
3839
sync::{
@@ -68,19 +69,6 @@ lazy_static::lazy_static! {
6869
static ref EXECUTE_BATCH_SIZE: usize = EXECUTE_BATCH_SIZE_DEFAULT;
6970
}
7071

71-
lazy_static::lazy_static! {
72-
// Size of each state trie segment
73-
static ref STATE_TRIE_SEGMENT_SIZE: U256 = HASH_MAX.into_uint()/STATE_TRIE_SEGMENTS;
74-
// Starting hash of each state trie segment
75-
static ref STATE_TRIE_SEGMENTS_START: [H256; STATE_TRIE_SEGMENTS] = {
76-
array::from_fn(|i| H256::from_uint(&(*STATE_TRIE_SEGMENT_SIZE * i)))
77-
};
78-
// Ending hash of each state trie segment
79-
static ref STATE_TRIE_SEGMENTS_END: [H256; STATE_TRIE_SEGMENTS] = {
80-
array::from_fn(|i| H256::from_uint(&(*STATE_TRIE_SEGMENT_SIZE * (i+1))))
81-
};
82-
}
83-
8472
#[derive(Debug, PartialEq, Clone, Default)]
8573
pub enum SyncMode {
8674
#[default]

0 commit comments

Comments
 (0)