Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions packages/validator/src/services/proposerPreferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ type SubmittedAtEpoch = {dependentRoot: RootHex; slots: Set<Slot>};
* dependent root for an epoch shifts (e.g. after a reorg) — detected by comparing the cached
* `dependentRoot` reported by `BlockDutiesService` against the one we last submitted under.
*
* No-op pre-gloas.
* Proposers should broadcast their preferences before the fork so the proposer preference caches
* of beacon nodes and builders are warm for the first Gloas slots. We start submitting
* as soon as a duty's proposal slot is in Gloas, which is up to `SUBMIT_BEFORE_PROPOSAL_SLOTS`
* before the fork, so only the first few Gloas slots are affected by this pre-fork submission.
*/
export class ProposerPreferencesService {
private readonly submitted = new Map<Epoch, SubmittedAtEpoch>();
Expand All @@ -47,7 +50,10 @@ export class ProposerPreferencesService {
}

private runProposerPreferencesTask = async (slot: Slot): Promise<void> => {
if (!isForkPostGloas(this.config.getForkName(slot))) {
// Start running once the submission window (`slot + SUBMIT_BEFORE_PROPOSAL_SLOTS`) reaches
// Gloas, i.e. already in the epoch before the fork. This allows builders to prepare and
// submit bids for the first Gloas slots.
if (!isForkPostGloas(this.config.getForkName(slot + SUBMIT_BEFORE_PROPOSAL_SLOTS))) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Refresh upcoming Gloas duties before pre-fork submissions

Once this pre-fork path is enabled, the task consumes getProposersAtEpoch(currentEpoch + 1) while the clock is still in the final pre-Gloas epoch. I checked BlockDutiesService.onNewHead: in the pre-Gloas branch it only refetches currentEpoch, so if a reorg changes the dependent root for the upcoming Gloas epoch after the epoch-start prefetch, the cached Gloas duties remain under the old root. In that scenario these early submissions are signed with a stale dependentRoot, causing the beacon node to ignore/reject them and leaving builders without valid preferences for the first Gloas slots.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

but I don't think this edge case is worth handling, a reorg in the last SUBMIT_BEFORE_PROPOSAL_SLOTS of the pre-gloas epoch is very unlikely and we will still submit correctly at slot 0 of gloas

return;
}

Expand Down Expand Up @@ -82,6 +88,7 @@ export class ProposerPreferencesService {
for (const duty of dutiesAtEpoch.data) {
if (duty.slot <= slot) continue;
if (duty.slot > slot + SUBMIT_BEFORE_PROPOSAL_SLOTS) continue;
if (!isForkPostGloas(this.config.getForkName(duty.slot))) continue;
if (submission.slots.has(duty.slot)) continue;

try {
Expand Down
Loading