Skip to content

core/scheduler: refactor builder registration - #4271

Merged
obol-bulldozer[bot] merged 3 commits into
mainfrom
diogo/refactor-builder-registration
Feb 4, 2026
Merged

obol-bulldozer[bot] merged 3 commits into
mainfrom
diogo/refactor-builder-registration

Conversation

@DiogoSantoss

Copy link
Copy Markdown
Contributor

Refactor builder registration to be asynchronous.

category: feature
ticket: #4254

@codecov

codecov Bot commented Feb 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.05128% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.65%. Comparing base (e1f4b2f) to head (cef4714).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
core/scheduler/scheduler.go 82.05% 5 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4271      +/-   ##
==========================================
+ Coverage   56.64%   56.65%   +0.01%     
==========================================
  Files         237      237              
  Lines       31332    31357      +25     
==========================================
+ Hits        17748    17766      +18     
- Misses      11311    11316       +5     
- Partials     2273     2275       +2     

☔ 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.

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

This PR refactors builder registration to be asynchronous, decoupling it from the proposer duty flow to avoid blocking duty triggering. The changes implement the requirements from issue #4254 to improve performance and reduce load on the beacon node.

Changes:

  • Builder registrations are now submitted asynchronously in separate goroutines instead of blocking the duty scheduling flow
  • Registrations are submitted once on Charon startup to ensure they're available before the first proposal opportunity
  • Epoch registrations are delayed to 75% through slot 0 to reduce beacon node load during the high-activity epoch boundary
  • Thread-safe access to submittedRegistrationEpoch is implemented using a mutex with getter/setter methods

Reviewed changes

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

File Description
core/scheduler/scheduler.go Adds async builder registration with mutex-protected state tracking, startup submission, and delayed slot 0 submissions
core/scheduler/scheduler_test.go Updates test synchronization to handle async registration submissions with a signal channel

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

Comment thread core/scheduler/scheduler.go Resolved
Comment thread core/scheduler/scheduler.go Resolved
@DiogoSantoss DiogoSantoss self-assigned this Feb 3, 2026
@sonarqubecloud

sonarqubecloud Bot commented Feb 3, 2026

Copy link
Copy Markdown

Comment on lines +811 to +812
// Fall back to immediate submission
s.submitValidatorRegistrations(ctx, slot.Epoch())

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice!

@DiogoSantoss DiogoSantoss added the merge when ready Indicates bulldozer bot may merge when all checks pass label Feb 4, 2026
@obol-bulldozer
obol-bulldozer Bot merged commit 2b2a029 into main Feb 4, 2026
12 checks passed
@obol-bulldozer
obol-bulldozer Bot deleted the diogo/refactor-builder-registration branch February 4, 2026 10:21
DiogoSantoss added a commit that referenced this pull request Feb 6, 2026
Refactor builder registration to be asynchronous.

category: feature
ticket: #4254
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