Repository navigation
feat(node,cli): surface operator eth address in decdn node status (#1906) - #1907
Merged
Merged
Conversation
…1906) `decdn node status` reports the node's iroh `node_id` but not the operator Ethereum address — the wallet the node is funded, bonded, registered, and paid under. The daemon already resolves it at bring-up (the binding check), so the only way to read it off a running node is grepping the daemon's JSON logs. Surface it instead. - Add `operator_address: Option<String>` to `StatusResponse`, an EIP-55 checksummed `0x…`. `None` when no operator is wired (unit tests, cache-only nodes), matching how `bound_node_id` degrades. - Wire `AdminState::with_operator_address` from the loaded eth signer's address at bring-up — the same value the binding check derives, sampled once, no extra chain round-trip. - Print `operator_address=…` in `decdn node status` human output (an explicit `(unknown)` sentinel when absent) and include it in `--json`. Only the public address is added — never key material. Co-Authored-By: Claude Opus 4.8 <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped, consistently wired through node→wire→CLI with solid unit/integration/e2e coverage, with only a minor test maintainability nit identified.
Pull request overview
This PR extends the node’s admin status surface (admin_v1_status) to include the operator Ethereum address (EIP-55 checksummed), and then exposes it in decdn node status for both human-readable and --json output. This improves operator visibility into which wallet a running daemon is funded/bonded/paid under without log-scraping.
Changes:
- Add
operator_address: Option<String>toStatusResponsewire type and cover it with serde round-trip tests. - Wire the operator address into the node’s
AdminStateat runtime bring-up and return it fromadmin_v1_status. - Print
operator_address=…indecdn node statusoutput (with an explicit(unknown)sentinel when absent) and add unit/integration/e2e assertions.
File summaries
| File | Description |
|---|---|
| crates/node/src/runtime/mod.rs | Wires the loaded eth signer’s address into AdminState during admin server bring-up. |
| crates/node/src/admin.rs | Stores operator Address in AdminState, exposes it via status() as an EIP-55 string, and adds unit coverage. |
| crates/common/src/admin.rs | Extends StatusResponse with operator_address and updates serde round-trip tests. |
| crates/cli/src/commands/node.rs | Renders operator_address in decdn node status human output (and exercises rendering in tests). |
| crates/cli/tests/admin_rpc.rs | Adds an end-to-end HTTP round-trip assertion that the operator address survives serde + generated bindings. |
| crates/e2e/tests/g_node_01_onboarding.rs | Adds onboarding journey assertion that status.operator_address matches the node’s operator wallet. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Coverage reportTotal: 82.85% (was 82.84%, ▲ +0.01%) — 73090/88221 lines
History
|
…iew) Bind the checksummed operator address to a local `String` in the G-NODE-01 onboarding assertion instead of comparing against a borrow of a temporary, so the expression reads plainly and does not rely on temporary lifetime extension. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
decdn node statusreports the node's irohnode_idbut not the operator Ethereum address — the wallet the node is funded, bonded, registered, and paid under. The daemon already resolves it at bring-up (the binding check logs it), so today the only first-party way to read it off a running node is grepping the daemon's JSON logs. This surfaces it instatusinstead.Closes #1906.
Changes
crates/common/src/admin.rs): addoperator_address: Option<String>toStatusResponse— an EIP-55 checksummed0x….Nonewhen no operator is wired (unwiredAdminStatein unit tests / cache-only nodes), mirroring howbound_node_iddegrades. Only the public address is added — never key material.crates/node/src/admin.rs,runtime/mod.rs):AdminState::with_operator_address, wired at bring-up from the loaded eth signer's address — the same value the binding check derives. Sampled once, no extra chain round-trip;status()renders it viaAddress's EIP-55Display, the same rendering the lane snapshots use.crates/cli/src/commands/node.rs): printoperator_address=…in thedecdn node statushuman output (explicit(unknown)sentinel when absent, so scripts always find the field) and include it in--json.Testing
crates/node/src/admin.rs— unit test: wired address reports the EIP-55 checksum; unwired reportsNone.crates/common/src/admin.rs—StatusResponseserde round-trip covers the new field.crates/cli/src/commands/node.rs— human render carries the address; aNonerenders the(unknown)sentinel.crates/cli/tests/admin_rpc.rs— end-to-end over real HTTP: the address survives serde + generated client bindings as an EIP-55 checksum.crates/e2e/tests/g_node_01_onboarding.rs— the onboarding journey assertsstatus.operator_addressequals the wallet the node bonded and registered under.cargo build,cargo clippy --all-targets --all-features,cargo fmt --check, and the affected unit + integration tests all pass; thedecdn-e2ecrate compiles under--features anvil-e2e.🤖 Generated with Claude Code