Skip to content

Fix race condition between validator duties service and proposer preferences#9309

Open
eserilev wants to merge 2 commits into
sigp:unstablefrom
eserilev:gloas-proposer-preferences-duty-fix
Open

Fix race condition between validator duties service and proposer preferences#9309
eserilev wants to merge 2 commits into
sigp:unstablefrom
eserilev:gloas-proposer-preferences-duty-fix

Conversation

@eserilev
Copy link
Copy Markdown
Member

@eserilev eserilev commented May 16, 2026

Issue Addressed

The proposer preferences service was attempting to publish preferences at the start of each epoch. This caused it to race with the validator duties service, it wouldn't calculate validator duties in time for the proposer preference service.

This PR first updates the validator duties service to calculate proposer duties for the current epoch and the next epoch. After Fulu we have the ability to look ahead one epoch for proposer duties, but we never updated the vc to leverage this feature.

This PR also updates the proposer preferences service to fire at every slot. We have an (Epoch, DependentRoot) map that prevents us from publishing the same preferences twice.

The changes here should prevent the race condition between the two services and make the proposer preferences service more robust in general.

@eserilev eserilev added gloas ready-for-review The code is ready for review val-client Relates to the validator client binary labels May 16, 2026
@mergify
Copy link
Copy Markdown

mergify Bot commented May 16, 2026

Some required checks have failed. Could you please take a look @eserilev? 🙏

@mergify mergify Bot added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels May 16, 2026
@mergify mergify Bot added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels May 21, 2026
&validator_metrics::DUTIES_SERVICE_TIMES,
&[validator_metrics::PROPOSER_DUTIES_HTTP_GET],
);
beacon_node.get_validator_duties_proposer(epoch).await
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ideally we should use get_validator_duties_proposer_v2 here to avoid the issues with the dependent root in the v1 API being wrong. Using v1 we're going to get a bunch of false positive Proposer duties re-org (the dependent root will change but the shuffling won't).

Problem is, the v2 endpoint was only added recently, so using it would be a breaking change. Maybe we could try v2 and fallback to v1 if it's not available? I always hate writing that sort of logic though and it's prone to introduce timeout issues. Maybe using v2 by default and having a flag to disable it is cleaner and easier (and we can delete the flag eventually after Gloas).

@michaelsproul michaelsproul added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gloas val-client Relates to the validator client binary waiting-on-author The reviewer has suggested changes and awaits thier implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants