feat(core): implement validatorapi node_version and proposer_duties handlers#449
Open
varex83 wants to merge 5 commits into
Open
feat(core): implement validatorapi node_version and proposer_duties handlers#449varex83 wants to merge 5 commits into
varex83 wants to merge 5 commits into
Conversation
Threads the Handler through Axum state via AppState<H> + with_state, wires the node_version route to the real handler, and adds a TestHandler mock that future PRs will extend per-endpoint.
4 tasks
emlautarom1
requested changes
May 28, 2026
Collaborator
There was a problem hiding this comment.
Small stuff:
- The added DTOs already exist in
eth2api: https://ethereum.github.io/beacon-APIs/#/Node/getNodeVersion - The type parameters could get tricky down the road so we could use
Box<dyn ...>instead.
Comment on lines
+3
to
+17
| use serde::Serialize; | ||
|
|
||
| /// Wire body for `GET /eth/v1/node/version`. | ||
| #[derive(Debug, Clone, Serialize)] | ||
| pub struct NodeVersionResponse { | ||
| /// Version payload. | ||
| pub data: NodeVersionData, | ||
| } | ||
|
|
||
| /// `data` field of [`NodeVersionResponse`]. | ||
| #[derive(Debug, Clone, Serialize)] | ||
| pub struct NodeVersionData { | ||
| /// Node version string. | ||
| pub version: String, | ||
| } |
Collaborator
There was a problem hiding this comment.
Already exists under eth2api as GetNodeVersionRequest and associated types.
Re-uses the auto-generated pluto_eth2api envelopes (GetProposerDutiesResponseResponse, GetVersionResponseResponse) as the on-the-wire shape rather than hand-rolling parallel types. node_version is migrated to the same pattern; the body.rs hand-rolled wrapper module is removed.
emlautarom1
approved these changes
May 28, 2026
Drops the per-handler generic parameter and routes through Arc<dyn Handler> via AppState. The Handler trait is object-safe (Send + Sync + 'static + async_trait-generated methods), so this is a pure type change with no surface impact.
Adds the Handler impl that the router has been calling through.
node_version returns the obolnetwork/pluto/{version}-{commit}/{arch}-{os}
identity string; proposer_duties calls the upstream beacon node and
rewrites known DV root public keys to this node's public share so the
validator client sees keys matching its keystore. The remaining 17
trait methods are unimplemented!() stubs that land per-PR as their
router handlers are ported.
3 tasks
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
First two slices of the validatorapi port. Lands the router state plumbing and two handlers end-to-end so the next handler PRs can drop straight in.
AppState<H>+Arc<AppState<H>>threaded throughnew_routerviawith_state.node_versionandproposer_dutiesroutes implemented against theHandlertrait.pluto_eth2apienvelopes (GetVersionResponseResponse,GetProposerDutiesResponseResponse) as the on-the-wire shape — no hand-rolled parallel types. Thevalidatorapi/types.rsmodule re-exports them under shorter names (NodeVersionResponse,ProposerDutiesResponse,ProposerDuty).testutils.rswithTestHandler— implements all 19Handlermethods (2 real, 17unimplemented!()stubs); future handler PRs override the relevant method to drive their unit test.This sets the pattern for the remaining handler PRs: each method returns its endpoint's spec-precise auto-gen envelope rather than the generic
EthResponse<T>wrapper, which will be retired per-PR as handlers land. Middleware (timeout, content-type validation, metrics) and the reverse-proxy fallback come in their own PRs after a few more handlers land.Test plan
cargo check -p pluto-core --testscargo clippy -p pluto-core --all-targets --all-features -- -D warningscargo +nightly fmt --all -- --checkcargo test -p pluto-core validatorapi::router::tests—node_version_wraps_handler_valueandproposer_duties_wraps_handler_valuepass