Skip to content

core/validatorapi: serve ptc duties - #4669

Merged
KaloyanTanev merged 1 commit into
gloasfrom
kalo/gloas-ptc-duties
Aug 26, 2026
Merged

core/validatorapi: serve ptc duties#4669
KaloyanTanev merged 1 commit into
gloasfrom
kalo/gloas-ptc-duties

Conversation

@KaloyanTanev

Copy link
Copy Markdown
Collaborator

Serve POST /eth/v1/validator/duties/ptc/{epoch} from the validator API instead of reverse-proxying it, replacing the DV root public keys with the local public shares so validator clients recognise their keys and schedule the duty. Mirrors the attesterDuties handler including dependent_root/execution_optimistic metadata.

category: feature
ticket: #4324

@KaloyanTanev KaloyanTanev self-assigned this Aug 26, 2026
@github-actions github-actions Bot added the branch-invalid PR raised against invalid branch. Not a main or release branch. label Aug 26, 2026
@KaloyanTanev
KaloyanTanev requested a lite review from Copilot August 26, 2026 14:15
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class support in Charon’s validator API for serving Payload Timeliness Committee (PTC) duties via POST /eth/v1/validator/duties/ptc/{epoch}. This removes reliance on reverse-proxying for that endpoint and ensures validator clients receive duties keyed by their local public shares (so they can recognize/schedule duties), while preserving Beacon API metadata fields (dependent_root, execution_optimistic) in the HTTP response.

Changes:

  • Implement Component.PTCDuties to fetch PTC duties from the beacon node and replace DV root pubkeys with local pubshares.
  • Register the new /eth/v1/validator/duties/ptc/{epoch} POST route and shape its response to include dependent_root and execution_optimistic.
  • Extend mocks and add unit/router tests covering pubshare mapping and response metadata behavior.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
core/validatorapi/validatorapi.go Adds PTCDuties component method that maps duty pubkeys from DV root keys to local pubshares.
core/validatorapi/validatorapi_test.go Adds a component-level test ensuring PTC duty pubkeys are rewritten to pubshares.
core/validatorapi/router.go Adds the ptc_duties route and handler, returning Beacon API-style metadata and non-null data.
core/validatorapi/router_internal_test.go Adds router-level test validating the PTC duties endpoint wiring and metadata passthrough.
core/validatorapi/mocks/handler.go Updates the generated handler mock to include PTCDuties.
core/validatorapi/eth2types.go Adds ptcDutiesResponse response struct for JSON encoding with dependent root + execution optimistic metadata.
Files not reviewed (1)
  • core/validatorapi/mocks/handler.go: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.70588% with 18 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (gloas@6e58d4c). Learn more about missing BASE report.

Files with missing lines Patch % Lines
core/validatorapi/router.go 64.70% 6 Missing and 6 partials ⚠️
core/validatorapi/validatorapi.go 64.70% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             gloas    #4669   +/-   ##
========================================
  Coverage         ?   58.78%           
========================================
  Files            ?      246           
  Lines            ?    34697           
  Branches         ?        0           
========================================
  Hits             ?    20398           
  Misses           ?    11761           
  Partials         ?     2538           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@KaloyanTanev
KaloyanTanev requested a review from pinebit August 26, 2026 15:08
@KaloyanTanev
KaloyanTanev merged commit f3b27b7 into gloas Aug 26, 2026
10 checks passed
@KaloyanTanev
KaloyanTanev deleted the kalo/gloas-ptc-duties branch August 26, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch-invalid PR raised against invalid branch. Not a main or release branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants