Files
lighthouse/common
Rahul Barman d814c029bb Fix checkpoint sync 401 with trailing-slash path-embedded API keys (#9548)
Closes #9545


  `BeaconNodeHttpClient::eth_path` clones the configured server URL and pushes path segments onto it. When the base URL ends with a slash (such as a QuickNode-style endpoint that embeds the API key in the path, `https://<host>/<api-key>/`), the URL already carries an empty trailing segment, so pushing `eth` yields a double slash:

```
https://<host>/<api-key>//eth/v2/debug/beacon/states/finalized
```

The provider responds to the `//` form with a `307` redirect to a normalized path that drops the key segment, so the redirected request arrives unauthenticated and checkpoint sync fails with `Error loading checkpoint state from remote: StatusCode(401)`.

This PR calls `pop_if_empty()` before pushing segments, the standard `url`-crate idiom for trailing-slash-tolerant joining, so a trailing slash no longer changes the resulting path. The fix is applied in `eth_path` (the shared prefix builder that every `/eth/vX` endpoint derives from) and in `post_lighthouse_liveness`, the only other builder that extends the base URL directly.


Co-Authored-By: rahulbarman <itsrahulbarman1@gmail.com>
2026-06-29 09:16:37 +00:00
..
2026-03-06 23:09:31 +00:00
2025-11-04 00:34:47 +00:00
2026-03-09 18:52:18 +11:00
2026-06-12 19:36:47 +00:00
2026-04-09 08:41:02 +00:00

eth2

Common crates containing eth2-specific logic.