Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not check parent weight on early FCU #13683

Merged
merged 1 commit into from
Mar 5, 2024
Merged

Conversation

potuz
Copy link
Contributor

@potuz potuz commented Mar 4, 2024

When a late block arrives and the beacon is proposing the next block, we perform several checks to allow for the next block to reorg the incoming late block.

Among those checks, we check that the parent block has been heavily attested (currently 160% of the committee size).

We perform this check in these circumstances:

  • When the late block arrives
  • At 10 seconds into the slot
  • At 0 seconds into the next slot (at proposing time)

The problem is that for blocks that arrive between 4 seconds and 10 seconds, the parent block will not have yet this expected weight since attestations from the current committee were not imported yet, and thus Prysm will send an FCU with payload attributes anyway at this time.

What happens is that Prysm keeps the EL building different blocks based on different parents at the same time, when later in the next slot it calls to propose, it will reorg the late block anyway and the EL would have been computing a second payload uselessly.

This PR enables this check only when calling ShouldOverrideFCU after 10 seconds into the slot which we do only after having imported the current attestations. We may want to actually remove this check entirely from ShouldOverrideFCU and only keep it in ProposerHead.

Shout out to Anthithesis for reporting an issue that led to this discoverly.

When a late block arrives and the beacon is proposing the next block, we
perform several checks to allow for the next block to reorg the incoming
late block.

Among those checks, we check that the parent block has been heavily
attested (currently 160% of the committee size).

We perform this check in these circumstances:
- When the late block arrives
- At 10 seconds into the slot
- At 0 seconds into the next slot (at proposing time)

The problem is that for blocks that arrive between 4 seconds and 10
seconds, the parent block will not have yet this expected weight since
attestations from the current committee were not imported yet, and thus
Prysm will send an FCU with payload attributes anyway at this time.

What happens is that Prysm keeps the EL building different blocks based
on different parents at the same time, when later in the next slot it
calls to propose, it will reorg the late block anyway and the EL would
have been computing a second payload uselessly.

This PR enables this check only when calling `ShouldOverrideFCU` after
10 seconds into the slot which we do only after having imported the
current attestations. We may want to actually remove this check entirely
from `ShouldOverrideFCU` and only keep it in `ProposerHead`.

Shout out to Anthithesis for reporting an issue that led to this
discoverly.
@potuz potuz added the Bug Something isn't working label Mar 4, 2024
@potuz potuz requested a review from a team as a code owner March 4, 2024 13:17
@potuz potuz enabled auto-merge March 4, 2024 13:20
@potuz potuz added this pull request to the merge queue Mar 5, 2024
Merged via the queue into develop with commit b6ce6c2 Mar 5, 2024
17 checks passed
@potuz potuz deleted the dont_check_parent_weight_fcu branch March 5, 2024 15:29
prestonvanloon pushed a commit that referenced this pull request Mar 5, 2024
When a late block arrives and the beacon is proposing the next block, we
perform several checks to allow for the next block to reorg the incoming
late block.

Among those checks, we check that the parent block has been heavily
attested (currently 160% of the committee size).

We perform this check in these circumstances:
- When the late block arrives
- At 10 seconds into the slot
- At 0 seconds into the next slot (at proposing time)

The problem is that for blocks that arrive between 4 seconds and 10
seconds, the parent block will not have yet this expected weight since
attestations from the current committee were not imported yet, and thus
Prysm will send an FCU with payload attributes anyway at this time.

What happens is that Prysm keeps the EL building different blocks based
on different parents at the same time, when later in the next slot it
calls to propose, it will reorg the late block anyway and the EL would
have been computing a second payload uselessly.

This PR enables this check only when calling `ShouldOverrideFCU` after
10 seconds into the slot which we do only after having imported the
current attestations. We may want to actually remove this check entirely
from `ShouldOverrideFCU` and only keep it in `ProposerHead`.

Shout out to Anthithesis for reporting an issue that led to this
discoverly.

(cherry picked from commit b6ce6c2)
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants