Skip to content

Apply proposer boost if dependent roots match#5306

Merged
jtraglia merged 4 commits into
ethereum:masterfrom
mkalinin:pb-dep-root
Jun 1, 2026
Merged

Apply proposer boost if dependent roots match#5306
jtraglia merged 4 commits into
ethereum:masterfrom
mkalinin:pb-dep-root

Conversation

@mkalinin

@mkalinin mkalinin commented May 28, 2026

Copy link
Copy Markdown
Contributor

Follow up to #5300.

Switches from proposer_index to dependent_root check when applying proposer boost. There is an edge case where proposer_index is the same on the two competing chains with different dependent roots, in this case applying PB to the diverged chain can be exploited. This PR is a fix for that edge case.

There are two ways how dependent_root can be computed: 1) with the block tree, root and store time 2) with the post-state of a block. (1) since we do this computation in the FC context.

Might worth making get_dependent_root an outer function.
UPD: made get_dependent_root a top-level function.

Comment thread specs/gloas/fork-choice.md Outdated

@michaelsproul michaelsproul 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.

Looks correct 👌

@jihoonsong jihoonsong left a comment

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.

Looks good!

Comment thread specs/phase0/fork-choice.md
@jtraglia jtraglia changed the title Apply PB if dependent roots match Apply proposer boost if dependent roots match May 28, 2026

@jtraglia jtraglia left a comment

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.

Nice, I like this too. We'll need more client approvals before this can be merged though.

@jtraglia

Copy link
Copy Markdown
Member

@mkalinin we should remove the following function & update the gossip condition to use the one introduced here.

```python
def get_proposer_dependent_root(state: BeaconState, epoch: Epoch) -> Root:
"""
Return the dependent root for the proposer lookahead at ``epoch``.
"""
return get_block_root_at_slot(
state, Slot(compute_start_slot_at_epoch(Epoch(epoch - MIN_SEED_LOOKAHEAD)) - 1)
)
```

@jihoonsong

Copy link
Copy Markdown
Member

I think it's better to handle the deprecation of get_proposer_dependent_root() in the Gloas executable p2p PR, which has more context around its usage. See my comment. @jtraglia

@jtraglia

Copy link
Copy Markdown
Member

I think it's better to handle the deprecation of get_proposer_dependent_root() in the Gloas executable p2p PR

Okay yeah, that works too!

@mkalinin

Copy link
Copy Markdown
Contributor Author

I think it's better to handle the deprecation of get_proposer_dependent_root() in the Gloas executable p2p PR, which has more context around its usage. See my comment. @jtraglia

Note that get_dependent_root will be returning Root() for the first two epochs. It might be important for devnets that are starting from Gloas. So, builders will need to use that function to construct bids which is reasonable, but need to be kept in mind

@jtraglia

Copy link
Copy Markdown
Member

@mkalinin happy to merge this whenever you feel it's appropriate. I think we should probably get more reviews from clients. But I have a feeling this will be universally accepted as a good change.

@jihoonsong

Copy link
Copy Markdown
Member

I think it's better to handle the deprecation of get_proposer_dependent_root() in the Gloas executable p2p PR, which has more context around its usage. See my #5294 (comment). @jtraglia

Note that get_dependent_root will be returning Root() for the first two epochs. It might be important for devnets that are starting from Gloas. So, builders will need to use that function to construct bids which is reasonable, but need to be kept in mind

Good point. Note that get_proposer_dependent_root() will underflow for the first two epochs.

@jtraglia

jtraglia commented Jun 1, 2026

Copy link
Copy Markdown
Member

Going to merge this. This was originally @potuz's idea here, @michaelsproul expressed support here, and @nflaig has expressed support via private chats. This is good enough for me. I don't expect this to be controversial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants