Skip to content

Commit

Permalink
Fixed config.
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoffranca committed Sep 24, 2024
1 parent 284e8a1 commit 89d0483
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions core/lib/protobuf_config/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ impl ProtoRepr for proto::Config {
.context("gossip_static_outbound")?,
genesis_spec: read_optional_repr(&self.genesis_spec),
rpc: read_optional_repr(&self.rpc_config),
debug_page_addr: required(&self.debug_page_addr)
.and_then(|x| Ok(x.parse()?))
.context("debug_page_addr")?,
})
}

Expand All @@ -195,6 +198,7 @@ impl ProtoRepr for proto::Config {
.collect(),
genesis_spec: this.genesis_spec.as_ref().map(ProtoRepr::build),
rpc_config: this.rpc.as_ref().map(ProtoRepr::build),
debug_page_addr: Some(this.debug_page_addr.to_string()),
}
}
}
4 changes: 4 additions & 0 deletions core/lib/protobuf_config/src/proto/core/consensus.proto
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,9 @@ message Config {
// RPC rate limits configuration.
// If missing, defaults are used.
optional RpcConfig rpc_config = 9; // optional

// IP:port to expose the debug page.
// Use `127.0.0.1:<port>` to only allow local access to the page.
optional string debug_page_addr = 11; // required; IpAddr
}

5 changes: 4 additions & 1 deletion core/node/consensus/src/testonly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ fn make_config(
config::ConsensusConfig {
server_addr: *cfg.server_addr,
public_addr: config::Host(cfg.public_addr.0.clone()),
debug_page_addr: std::net::SocketAddr::V4(()),
debug_page_addr: std::net::SocketAddr::new(
std::net::IpAddr::V4(std::net::Ipv4Addr::new(127, 0, 0, 1)),
8080,
),
max_payload_size: usize::MAX,
max_batch_size: usize::MAX,
gossip_dynamic_inbound_limit: cfg.gossip.dynamic_inbound_limit,
Expand Down

0 comments on commit 89d0483

Please sign in to comment.