Give the metrics server its own bind address

Open
#817 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 6 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
53/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
api, backend

Research direction

Start with the --http-address definition in bin/ethlambda/src/cli.rs:37-38 and start_http_servers in crates/net/rpc/src/lib.rs:118-138; then inspect Options::validate_ports and the RPC documentation. Add the separate metrics bind address with the stated default and address-aware port rule, then update the flag table and trust section in docs/rpc.md. The optional pprof flag is explicitly optional; done means the API and metrics servers can bind separately while existing setups keep working.

Written by the indexing model from the issue text.

Description

Problem. Both HTTP servers bind the one --http-address. The flag is defined at bin/ethlambda/src/cli.rs:37-38, and start_http_servers binds both servers to it at crates/net/rpc/src/lib.rs:118-138. So an operator whose Prometheus scrapes from another host has to move the API off loopback as well. That API is the one lambdaclass/ethlambda#778's "What the servers trust" section says must not be exposed, since anyone reaching it can:

  • redirect fee recipients;
  • join subnets;
  • trigger payload builds.

The only thing left keeping the two apart is a per-port firewall rule. The metrics server also carries the jemalloc heap-profile endpoints (/debug/pprof/allocs), which a default Linux build serves.

Why it is out of scope. lambdaclass/ethlambda#778 is docs-only. It documents the shared address and does not change the CLI.

Fix. Add --metrics-address, defaulting to --http-address's value so existing setups keep working, and serve metrics_app on it in start_http_servers. Equal ports would then merge only when the two addresses are equal too, and Options::validate_ports would need the same rule. Optionally, put /debug/pprof/* behind an opt-in flag, so a scrape-only exposure does not also serve heap profiles. Update the flag table and the trust section in docs/rpc.md.

Dominant language
Rust
Stars
86
Forks
34
Avg merge
9d 20h
Merged PRs (30d)
77

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lambdaclass/ethlambda

All issues in lambdaclass/ethlambda

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.