Skip to content

Commit 12bf793

Browse files
committed
Review comments and fixes
1 parent 8c50107 commit 12bf793

File tree

8 files changed

+324
-68
lines changed

8 files changed

+324
-68
lines changed

modules/peer_network_interface/config.default.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ peer-sharing-timeout-secs = 10
4242
connect-timeout-secs = 15
4343
# Accept IPv6 peer addresses from peer-sharing (set true on dual-stack hosts)
4444
ipv6-enabled = false
45+
# Accept loopback/private/link-local peer addresses from peer-sharing (useful for local testnets)
46+
allow-non-public-peer-addrs = true

modules/peer_network_interface/src/block_flow_consensus_scenarios_tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ async fn make_harness() -> TestHarness {
115115
peer_sharing_timeout_secs: 10,
116116
connect_timeout_secs: 15,
117117
ipv6_enabled: false,
118+
allow_non_public_peer_addrs: true,
118119
};
119120

120121
let flow = BlockFlowHandler::new(

modules/peer_network_interface/src/configuration.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ pub struct InterfaceConfig {
4242
pub connect_timeout_secs: u64,
4343
#[serde(default = "default_ipv6_enabled")]
4444
pub ipv6_enabled: bool,
45+
#[serde(default = "default_allow_non_public_peer_addrs")]
46+
pub allow_non_public_peer_addrs: bool,
4547
}
4648

4749
fn default_consensus_topic() -> String {
@@ -80,6 +82,10 @@ fn default_ipv6_enabled() -> bool {
8082
false
8183
}
8284

85+
fn default_allow_non_public_peer_addrs() -> bool {
86+
true
87+
}
88+
8389
impl InterfaceConfig {
8490
pub fn try_load(config: &Config) -> Result<Self> {
8591
let full_config = Config::builder()

0 commit comments

Comments
 (0)