Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions bin/portal-bridge/src/census/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ pub enum CensusError {
AlreadyInitialized,
}

/// The maximum number of enrs to return in a response,
/// limiting the number of OFFER requests spawned by the bridge
/// for each piece of content
pub const ENR_OFFER_LIMIT: usize = 2;

/// The census is responsible for maintaining a list of known peers in the network,
/// checking their liveness, updating their data radius, iterating through their
/// rfn to find new peers, and providing interested enrs for a given content id.
Expand Down
6 changes: 5 additions & 1 deletion bin/portal-bridge/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use url::Url;

use crate::{
bridge::e2hs::BlockRange,
census::ENR_OFFER_LIMIT,
constants::{DEFAULT_OFFER_LIMIT, DEFAULT_TOTAL_REQUEST_TIMEOUT},
types::mode::BridgeMode,
DEFAULT_BASE_CL_ENDPOINT, DEFAULT_BASE_EL_ENDPOINT, FALLBACK_BASE_CL_ENDPOINT,
Expand All @@ -33,6 +32,11 @@ use crate::{
pub const DEFAULT_SUBNETWORK: &str = "history";
pub const DEFAULT_EXECUTABLE_PATH: &str = "./target/debug/trin";

/// The maximum number of peers to send each piece of content.
///
/// This is used as a parameter in census, which selects the peers.
pub const ENR_OFFER_LIMIT: usize = 8;

#[derive(Parser, Debug, Clone)]
#[command(name = "Trin Bridge", about = "Feed the network")]
pub struct BridgeConfig {
Expand Down
4 changes: 2 additions & 2 deletions testing/ethportal-peertest/src/scenarios/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use ethportal_api::{
use portal_bridge::{
api::consensus::ConsensusApi,
bridge::beacon::BeaconBridge,
census::{Census, ENR_OFFER_LIMIT},
cli::{BridgeConfig, BridgeId, DEFAULT_EXECUTABLE_PATH, DEFAULT_SUBNETWORK},
census::Census,
cli::{BridgeConfig, BridgeId, DEFAULT_EXECUTABLE_PATH, DEFAULT_SUBNETWORK, ENR_OFFER_LIMIT},
constants::{DEFAULT_OFFER_LIMIT, DEFAULT_TOTAL_REQUEST_TIMEOUT},
types::mode::BridgeMode,
DEFAULT_BASE_CL_ENDPOINT, DEFAULT_BASE_EL_ENDPOINT, FALLBACK_BASE_CL_ENDPOINT,
Expand Down