Skip to content

fix(validator): start with a relative --validators-dir - #962

Merged
pablodeymo merged 1 commit into
release/v2.0.0from
backport/v2.0.0-pr-950
Dec 2, 2026
Merged

pablodeymo merged 1 commit into
release/v2.0.0from
backport/v2.0.0-pr-950

Conversation

@pablodeymo

Copy link
Copy Markdown
Collaborator

🗒️ Description / Motivation

Backport of #950 (edec5f86 on main) to release/v2.0.0, for v2.0.0-rc.2.

What Changed

git cherry-pick -x edec5f86 on top of release/v2.0.0 (7d5e9f22). It applied without conflicts, and the patch is identical to the one merged on main (same git patch-id). Nothing was edited by hand.

Tests Added / Run

Run on the four backports together (#950, #951, #955, #952 on top of 7d5e9f22; that tree is the same one a merge of main at 64ba9d51 into the release branch gives):

This branch alone was not built locally; CI covers it.

Related Issues / PRs

## 🗒️ Description / Motivation

`ethlambda validator` does not start when `--validators-dir` (or
`--secrets-dir`) is a relative path and there is no
`validator_definitions.yml` yet:

```
Error: keys/keys/0x…/voting-keystore.json: No such file or directory (os error 2)
```

Keystore discovery writes each path into the definitions file as it
found it, so relative to the working directory. The loader reads a
relative path in that file against the validators directory, so the
directory is applied twice. The file is written before the failure, so
every later start fails the same way.

## What Changed

- `crates/validator/src/keys/definitions.rs`: `discover_if_absent`
writes `voting_keystore_path` and `voting_keystore_password_path` as
absolute paths (`std::path::absolute`, which does not touch the
filesystem).

## Correctness / Behavior Guarantees

- Absolute directories behave as before: the paths written are
unchanged.
- The loader's rule is unchanged: a relative path in the file is still
read against the validators directory, which is what hand-written and
Lighthouse-written files rely on.
- A file an affected start already wrote still names the wrong paths. It
has to be removed (the keystores are then discovered again) or corrected
by hand.

## Tests Added / Run

- New:
`keystores_discovered_under_relative_directories_are_written_absolute`,
with directories relative to the working directory.
- On this branch: `cargo fmt --all -- --check`, `cargo test -p
ethlambda-validator --profile release-fast` (1035 passed), `cargo clippy
-p ethlambda-validator --all-targets -- -D warnings`. CI ran the
workspace-wide lint and test suites on this PR, and every check passes.
- By hand: a client started with `--validators-dir node0/keys
--secrets-dir node0/secrets` and no definitions file wrote absolute
paths, loaded its 64 keys and ran. The same command failed as above
before the change.

## Related Issues / PRs

- Found while running #874 behind Charon; not related to distributed
mode.

## ✅ Verification Checklist

- [x] Ran `make fmt` — clean
- [x] `make lint` (clippy with `-D warnings`) — clean in CI; run locally
for `ethlambda-validator`
- [x] `make test` — all passing in CI; run locally for
`ethlambda-validator`

(cherry picked from commit edec5f8)
@pablodeymo

Copy link
Copy Markdown
Collaborator Author

/review

@pablodeymo

Copy link
Copy Markdown
Collaborator Author

Antigravity check:

PR #962 (e78a973) is an exact, clean backport of PR #950 (edec5f8).
──────

  1. Backport Fidelity & Correctness

• Identical git patch-id & blob SHA:
• git patch-id --stable is 9cfcc541444e72e14c5418290e6d394c4410cf34 on both edec5f8 (#950) and e78a973 (#962).
• Only crates/validator/src/keys/definitions.rs changes (+67 -2), with the exact same before/after Git blob SHAs (db0770e7 ->
3fda9f79) on release/v2.0.0 as on main.
• Conflict-free: Merges cleanly (git merge-tree --write-tree) with current origin/release/v2.0.0 (ded3fcc) and has zero file overlap
with #954, #965, or #968.
• Implementation check:
• std::path::absolute resolves discovered voting_keystore_path and voting_keystore_password_path lexically against current_dir()
without requiring the password file to exist on disk during discovery or dereferencing symlinks.
• Keeps ValidatorStore::load's resolve(validators_dir, path) behavior intact so hand-written and Lighthouse-generated relative
paths in validator_definitions.yml still resolve against validators_dir.

@pablodeymo
pablodeymo merged commit e57d04d into release/v2.0.0 Dec 2, 2026
@pablodeymo
pablodeymo deleted the backport/v2.0.0-pr-950 branch December 2, 2026 19:13
pablodeymo added a commit that referenced this pull request Dec 2, 2026
…they are sent (#968)

## 🗒️ Description / Motivation

Backport of #956 to `release/v2.0.0`, for `v2.0.0-rc.2`.

#956 is approved and not merged on `main` yet, so this is taken from its
head (`36232dcf`) and not from a squash commit on `main`. If #956
changes before it merges, this branch has to be refreshed from the new
head.

## What Changed

The ten commits of #956 as one commit on top of `release/v2.0.0`
(`3ed99c86`): the diff from its branch point on `main` (`e48246f8`) to
its head (`36232dcf`), applied with `git apply --3way`. It applied
without conflicts and nothing was edited by hand. That includes #958,
the by-root counterpart, which was merged into #956's branch.

What it does, from #956:

- An `execution_payload_envelopes_by_range` answer stops once 16 MiB of
SSZ has gone out, always carrying the first envelope its window has.
Before, one request could make the node load and send about 1 GiB.
- Envelopes are read as they are sent: the codec reads each row just
before writing its chunk, and a row that fails to read or decode ends
the answer where it is.
- The requester asks the same peer again after an answer that stops
short, for up to 30 s.
- `execution_payload_envelopes_by_root` answers are bounded and read the
same way (#958).

## Tests Added / Run

On this branch:

- `cargo fmt --all -- --check` and `make lint`: clean.
- `cargo test -p ethlambda-p2p --profile release-fast --lib`: 587
passed, 0 failed, 1 ignored.
- `cargo test -p ethlambda-storage --profile release-fast --features
rocksdb`: 256 passed, 0 failed, 2 ignored.

Not run locally: the rest of `make test`.

## Related Issues / PRs

- Original: #956 (closes #895 on `main`), with #958.
- The other PRs open against the release branch: #954, #962 (backport of
#950) and #965 (backport of #952). This one merges with each of them
without conflicts (checked with `git merge-tree`), though it shares
`crates/net/p2p/src/lib.rs`, `CLAUDE.md` and `docs/beacon_wire.md` with
some of them.
- Release checklist: #943.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants