Skip to content

Commit

Permalink
feat: enable gossip dropped by default for history network (ethereum#…
Browse files Browse the repository at this point in the history
  • Loading branch information
njgheorghita committed Sep 23, 2024
1 parent 2932dc8 commit 11d5c3a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
7 changes: 0 additions & 7 deletions ethportal-api/src/types/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,6 @@ pub struct TrinConfig {
)]
pub utp_transfer_limit: usize,

#[arg(
long = "gossip-dropped",
help = "Gossip content as it gets dropped from local storage (history network only)."
)]
pub gossip_dropped: bool,

#[command(subcommand)]
pub command: Option<TrinConfigCommands>,
}
Expand Down Expand Up @@ -250,7 +244,6 @@ impl Default for TrinConfig {
ws_port: DEFAULT_WEB3_WS_PORT,
command: None,
utp_transfer_limit: DEFAULT_UTP_TRANSFER_LIMIT,
gossip_dropped: false,
network: MAINNET.clone(),
}
}
Expand Down
2 changes: 0 additions & 2 deletions ethportal-peertest/src/scenarios/gossip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,6 @@ fn fresh_node_config() -> (String, TrinConfig) {
"--unsafe-private-key",
// node id: 0x27128939ed60d6f4caef0374da15361a2c1cd6baa1a5bccebac1acd18f485900
"0x9ca7889c09ef1162132251b6284bd48e64bd3e71d75ea33b959c37be0582a2fd",
// gossip content as its dropped for the history network
"--gossip-dropped",
]
.iter(),
)
Expand Down
4 changes: 0 additions & 4 deletions portalnet/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ pub struct PortalnetConfig {
pub no_upnp: bool,
pub node_addr_cache_capacity: usize,
pub disable_poke: bool,
// gossip content as it gets dropped from local storage
pub gossip_dropped: bool,
pub trusted_block_root: Option<B256>,
// the max number of concurrent utp transfers
pub utp_transfer_limit: usize,
Expand All @@ -41,7 +39,6 @@ impl Default for PortalnetConfig {
no_upnp: false,
node_addr_cache_capacity: NODE_ADDR_CACHE_CAPACITY,
disable_poke: false,
gossip_dropped: false,
trusted_block_root: None,
utp_transfer_limit: DEFAULT_UTP_TRANSFER_LIMIT,
}
Expand All @@ -58,7 +55,6 @@ impl PortalnetConfig {
no_upnp: trin_config.no_upnp,
bootnodes: trin_config.bootnodes.clone(),
disable_poke: trin_config.disable_poke,
gossip_dropped: trin_config.gossip_dropped,
trusted_block_root: trin_config.trusted_block_root,
utp_transfer_limit: trin_config.utp_transfer_limit,
..Default::default()
Expand Down
6 changes: 5 additions & 1 deletion trin-history/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ use trin_validation::oracle::HeaderOracle;
use crate::validation::ChainHistoryValidator;
use trin_storage::PortalStorageConfig;

/// Gossip content as it gets dropped from local storage,
/// enabled by default for the history network.
const GOSSIP_DROPPED: bool = true;

/// History network layer on top of the overlay protocol. Encapsulates history network specific data
/// and logic.
#[derive(Clone)]
Expand All @@ -39,7 +43,7 @@ impl HistoryNetwork {
let config = OverlayConfig {
bootnode_enrs,
disable_poke: portal_config.disable_poke,
gossip_dropped: portal_config.gossip_dropped,
gossip_dropped: GOSSIP_DROPPED,
utp_transfer_limit: portal_config.utp_transfer_limit,
..Default::default()
};
Expand Down

0 comments on commit 11d5c3a

Please sign in to comment.