Conversation
|
Claude finished @iamquang95's task in 3m 31s —— View job Code Review —
|
| Component | Go | Rust | Match | Notes |
|---|---|---|---|---|
--data-dir flag |
✓ CHARON_DATA_DIR |
✓ | ✓ | |
--definition-file flag |
✓ CHARON_DEFINITION_FILE |
✓ | ✓ | |
--no-verify flag |
✓ CHARON_NO_VERIFY |
✓ | ✓ | |
--timeout flag (default 1m) |
✓ | ✓ | ✓ | |
--publish-timeout (default 30s) |
✓ | ✓ | ✓ | |
--shutdown-delay (default 1s) |
✓ | ✓ | ✓ | |
--keymanager-address |
✓ | ✓ | ✓ | |
--keymanager-auth-token |
✓ | ✓ | ✓ | |
--p2p-relays |
✓ | ✓ | ✓ | |
--zipped flag |
✓ | ✓ | ✓ | |
--publish flag |
✓ | ✓ | ✓ | |
--execution-client-rpc-endpoint |
✓ | ✓ | ✓ | |
| Keymanager validation error strings | ✓ | ✓ | ✓ | exact match |
| validateKeymanager: trim() behavior | strips nothing | strips whitespace | ✗ | minor edge case |
| Operation order: validate → load | load → validate | validate → load | ✗ | intentional early-exit |
HasTestConfig guard |
4 fields | 1 field (def) |
partial | other fields not yet ported |
checkClearDataDir logic |
✓ | ✓ | ✓ | |
checkWrites logic |
✓ | ✓ | ✓ | |
| Private key lock file | ✓ | ✗ | ✗ | expected stub gap |
| Definition version check | ✓ | ✗ | ✗ | expected stub gap |
EthClient no-op on empty addr |
✓ (via noop runner) | ✓ | ✓ |
Tests
Tests observed in the diff — not executed locally (no cargo test run in this review):
dkg_is_registered_as_top_level_subcommand— sanity-checks CLI wiring ✓dkg_defaults_match_go— validates all default values against Go ✓invalid_duration_fails_during_parse— clap parse-time validation ✓dkg_args_expose_expected_env_bindings— env var contract check ✓config_mapping_preserves_fields— round-trip CLI → Config ✓run_passes_config_and_token_to_runner— runner receives correct config ✓run_rejects_mismatched_keymanager_flags/run_executes_preflight_*/run_surfaces_data_dir_*— coverage ofdkg::runpreflight ✓empty_address_returns_noop_client— eth1wrap no-op path ✓
Test coverage is strong for the stub scope.
Open Questions / Assumptions
- The
log-formatargument (console/logfmt/json) — is there a planned issue to wire this intoTracingConfig? Both relay and DKG have the same TODO. AppendConfig(Go's merge-two-DKG-ceremonies feature) — expected to remain absent until that feature is ported?- When adding the backend, will
TestConfigbe extended with callbacks (StoreKeysFunc,SyncCallback, etc.) at that point, or earlier?
|
Claude finished @iamquang95's task in 2m 53s —— View job Code Review —
|
| Issue | Resolution |
|---|---|
Operation order deviation (load_definition vs validate_keymanager_flags) |
Fixed — now matches Go order |
DEFAULT_RELAYS duplicated across two crates |
Fixed — all callers reference pluto_p2p::config::DEFAULT_RELAYS |
warn_for_insecure_relays used raw string prefix instead of parsed multiaddr |
Fixed — now parses via parse_relay_addr and checks Protocol::Http |
validate_keymanager_flags trimmed whitespace (Go does not) |
Fixed — .trim() removed |
has_test_config() missing TODO for future fields |
Fixed — TODO comment added |
Remaining Findings
-
[Medium]
--log-formatsilently ignored
DkgLogArgs.formatis parsed from the CLI and stored, butinto_config()only passeslevelandcolortobuild_console_tracing_config. A user passing--log-format=jsongets console output with no warning. This affects the relay command equally (sameTODOinbuild_console_tracing_config).
Evidence:crates/cli/src/commands/dkg.rs:126,crates/cli/src/commands/common.rs:39-41
Recommendation: WireformatintoTracingConfigwhen supported, or emit awarn!if a non-console format is requested. Track via an issue if not planned for this PR. -
[Medium, New] Missing keymanager connectivity verification
Go callscl.VerifyConnection(ctx)whenKeymanagerAddr != ""(Go:dkg.go:174-179) to confirm the keymanager is reachable before proceeding. The Rust preflight only validates the URL format (url::Url::parse).pluto_eth2util::keymanager::Client::verify_connection()already exists (crates/eth2util/src/keymanager.rs:111) — it does a 2-second TCP dial to the keymanager host:port. This is a silent behavioral divergence: Go fails fast with a clear "verify keymanager address" error; Rust proceeds into DKG and fails later.
Recommendation: Addverify_connection()to the preflight aftervalidate_keymanager_flags, or add a// TODOwith a reference to the Go code if deferring. Fix this → -
[Low]
run_executes_preflight_before_reaching_backend_boundaryassertsis_panic()
The test spawns a task and asserts.is_panic()to verify theunimplemented!()boundary is reached. This will need to be replaced or removed when the backend is implemented. A// TODOcomment would signal this is intentionally temporary.
Evidence:crates/dkg/src/dkg.rs:287-289 -
[Low] Triple relay parsing in
into_config
Relay strings are parsed three times: once invalidate_p2p_args, once insidewarn_for_insecure_relays(both called frominto_configbefore the relay loop), and once in the relay-building loop at line 130-133. Theexpectinwarn_for_insecure_relaysis sound becausevalidate_p2p_argsruns first, but the redundancy is a minor maintenance hazard.
Evidence:crates/cli/src/commands/dkg.rs:123-133
Recommendation: Pass the already-parsedVec<Multiaddr>towarn_for_insecure_relaysinstead of re-parsing from strings. This matches howrelay.rsdoes it (parse once in the relay loop, warn inline).
Parity Matrix (updated)
| Component | Go | Rust | Match | Notes |
|---|---|---|---|---|
--data-dir, --definition-file, --no-verify |
✓ | ✓ | ✓ | |
--timeout, --publish-timeout, --shutdown-delay |
✓ | ✓ | ✓ | |
--keymanager-address, --keymanager-auth-token |
✓ | ✓ | ✓ | |
--p2p-relays (shared constant) |
✓ | ✓ | ✓ | |
--zipped, --publish, --execution-client-rpc-endpoint |
✓ | ✓ | ✓ | |
| Keymanager validation error strings | exact match | exact match | ✓ | |
validateKeymanager trim behavior |
no trim | no trim | ✓ | fixed |
Operation order: loadDefinition → validateKeymanager |
✓ | ✓ | ✓ | fixed |
HasTestConfig guard on checkClearDataDir |
✓ | ✓ | ✓ | |
checkClearDataDir / checkWrites logic |
✓ | ✓ | ✓ | |
Keymanager VerifyConnection check |
✓ (before preflight) | ✗ | ✗ | method exists, not called |
--log-format wired into tracing |
✓ | ✗ | ✗ | silently ignored |
HasTestConfig completeness |
4 fields | 1 field (def) |
partial | TODO comment added |
| Private key lock file | ✓ | ✗ | ✗ | expected stub gap |
Definition version check (v1.6.0+) |
✓ | ✗ | ✗ | expected stub gap |
AppendConfig merge |
✓ | ✗ | ✗ | expected stub gap |
Overall
The preflight stub is clean and well-tested for its scope. The two medium items — --log-format and missing verify_connection — are the most notable gaps relative to Go behavior. The rest are low-priority polish. Happy to approve once those are tracked (either fixed or captured as TODOs/issues).
Should address: #314
This covers only the entry point of
pluto dkg, not the full implementation ofdkg.