Skip to content

Conversation

@pinebit
Copy link
Collaborator

@pinebit pinebit commented Oct 30, 2025

New builder registration mechanism. Check CoPilot's summary for details.

category: refactor
ticket: none

@codecov
Copy link

codecov bot commented Oct 30, 2025

Codecov Report

❌ Patch coverage is 74.50980% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.24%. Comparing base (5ae4203) to head (767cf43).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
app/app.go 0.00% 6 Missing ⚠️
core/scheduler/scheduler.go 89.47% 2 Missing and 2 partials ⚠️
core/validatorapi/validatorapi.go 0.00% 2 Missing ⚠️
core/bcast/bcast.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4060      +/-   ##
==========================================
+ Coverage   54.84%   56.24%   +1.40%     
==========================================
  Files         242      241       -1     
  Lines       31038    30861     -177     
==========================================
+ Hits        17023    17359     +336     
+ Misses      11776    11230     -546     
- Partials     2239     2272      +33     

☔ View full report in Codecov by Sentry.
📢 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.

@pinebit pinebit marked this pull request as ready for review October 30, 2025 12:30
@ObolNetwork ObolNetwork deleted a comment from sonarqubecloud bot Oct 30, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR redesigns the builder registration flow in Charon. Previously, validator clients submitted registrations through the validator API which went through consensus. Now, the Scheduler component directly submits pre-generated builder registrations to the beacon node at startup and at the first slot of every epoch, bypassing the consensus workflow entirely.

Key changes:

  • Builder registrations are now submitted directly by the Scheduler instead of going through the validator API and consensus workflow
  • The /eth/v1/validator/register_validator endpoint now returns 200 OK without processing
  • Removed the Recaster component which previously handled registration rebroadcasting

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
core/scheduler/scheduler.go Added submitValidatorRegistrations() method that submits builder registrations at epoch boundaries
core/validatorapi/validatorapi.go SubmitValidatorRegistrations() now returns immediately without processing
core/validatorapi/router.go Registration endpoint handler simplified to return success without processing
testutil/validatormock/component.go Added case for DutyBuilderRegistration with no action needed
testutil/integration/simnet_test.go Commented out builder registration tests pending redesign
core/bcast/recast.go Removed entire Recaster component
core/bcast/bcast.go Removed registration broadcasting logic
app/app.go Removed wireRecaster() and updated to use builderRegistrations instead of corePubkeys
core/scheduler/metrics.go Added new metrics for registration submission
docs/metrics.md Updated metrics documentation
docs/architecture.md Documented the redesign and migration considerations
testutil/beaconmock/options.go Added BuilderRegistrationSetA test data and MustBytesFromHex() helper
core/scheduler/scheduler_test.go Updated tests to use builder registrations and added TestSubmitValidatorRegistrations()
core/validatorapi/validatorapi_test.go Removed tests for registration submission
core/validatorapi/eth2types.go Removed signedValidatorRegistrations type and unmarshal methods
core/bcast/metrics.go Removed recast-related metrics
core/bcast/bcast_test.go Removed registration broadcasting test
app/health/checks.go Updated health check to use new metric name
app/health/checks_internal_test.go Updated test to use new metric name

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pinebit pinebit requested a review from Copilot October 30, 2025 12:58
if err != nil {
submitRegistrationErrors.Add(1)

log.Error(ctx, "Failed to submit validator registrations", err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

BTW, something interesting to keep in mind and we have no influence on:
MEV-boost will report success on registrations to the BN (and hence to us) if at least 1 succeeds. This is weird behaviour IMO as it should result in failure if at least 1 fails.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We should start talking to MEV directly...

Copy link
Collaborator

Choose a reason for hiding this comment

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

It won't solve our issue here though. As it's the aggregator (MEV-boost) that is returning an OK response.

And I really don't fancy signing up for doing MEV-boost's job ourselves and talking directly to the relays.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud
Copy link

@pinebit pinebit added the merge when ready Indicates bulldozer bot may merge when all checks pass label Oct 30, 2025
@obol-bulldozer obol-bulldozer bot merged commit 91adbf5 into main Oct 30, 2025
12 checks passed
@obol-bulldozer obol-bulldozer bot deleted the pinebit/submit-val-reg branch October 30, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge when ready Indicates bulldozer bot may merge when all checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants