Repository navigation
fix(validator): start with a relative --validators-dir - #962
Conversation
## 🗒️ 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)
|
/review |
|
Antigravity check: PR #962 (e78a973) is an exact, clean backport of PR #950 (edec5f8).
• Identical git patch-id & blob SHA: |
…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.
🗒️ Description / Motivation
Backport of #950 (
edec5f86onmain) torelease/v2.0.0, forv2.0.0-rc.2.What Changed
git cherry-pick -x edec5f86on top ofrelease/v2.0.0(7d5e9f22). It applied without conflicts, and the patch is identical to the one merged onmain(samegit 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 ofmainat64ba9d51into the release branch gives):cargo fmt --all -- --checkandmake lint: clean.cargo test -p ethlambda-validator -p ethlambda-blockchain -p ethlambda-p2p --profile release-fast: 2,043 passed, 0 failed, including the tests fix(validator): start with a relative --validators-dir #950 added.This branch alone was not built locally; CI covers it.
Related Issues / PRs