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

Handle unknown head during attestation publishing #5010

Merged
merged 8 commits into from
Feb 15, 2024

Conversation

michaelsproul
Copy link
Member

@michaelsproul michaelsproul commented Dec 14, 2023

Issue Addressed

Closes #4699

Proposed Changes

Reprocess attestations received via HTTP which reference unknown blocks. This should reduce false positive logs on BNs used in multi-BN setups, where the VC might send our BN an attestation from another BN before we've finished processing the head block. This applies both to Vouch and the Lighthouse v4.6.0+ VC using --broadcast attestations.

In order to avoid blocking a beacon processor thread waiting for the reprocessing to complete, the implementation does the first round of processing in the beacon processor, then uses a join to wait for the reprocess futures from the Tokio executor. In practice this should be efficient, as Tokio will park the task until all its reprocess futures are ready, and the beacon processor can continue to churn through work.

@dong77
Copy link

dong77 commented Feb 7, 2024

Waiting for this to be released as I'm seeing a lot of related errors.

@michaelsproul
Copy link
Member Author

michaelsproul commented Feb 9, 2024

@dong77 While this error is annoying, fixing it will only marginally improve performance. If you see this, it means one of your BNs (the one that created the attestation) is ahead of one of your other BNs in terms of blocks imported. If you broadcast the attestation to both of them, then the one that created the attestation (which is "ahead") will process and publish the attestation just fine, while the other one (which is "behind") will log this error. With the change from this PR, both will process and publish and no errors will be logged. So it's just a bit of redundancy during publishing.

@michaelsproul michaelsproul added ready-for-review The code is ready for review v5.0.0 Q1 2024 and removed work-in-progress PR is a work-in-progress do-not-merge labels Feb 9, 2024
Copy link
Member

@jimmygchen jimmygchen left a comment

Choose a reason for hiding this comment

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

The changes looks good to me! Just a few minor questions and an annoying unused beta compiler error to fix!

@michaelsproul michaelsproul added v5.1.0 Q2 2024 v5.0.0 Q1 2024 and removed v5.0.0 Q1 2024 v5.1.0 Q2 2024 labels Feb 14, 2024
@michaelsproul
Copy link
Member Author

Ignore previous comment (now deleted). I commented on the wrong issue.

@dong77
Copy link

dong77 commented Feb 14, 2024

@dong77 While this error is annoying, fixing it will only marginally improve performance. If you see this, it means one of your BNs (the one that created the attestation) is ahead of one of your other BNs in terms of blocks imported. If you broadcast the attestation to both of them, then the one that created the attestation (which is "ahead") will process and publish the attestation just fine, while the other one (which is "behind") will log this error. With the change from this PR, both will process and publish and no errors will be logged. So it's just a bit of redundancy during publishing.

Is there a way to disable/hide this error?

@michaelsproul
Copy link
Member Author

Is there a way to disable/hide this error?

No

Copy link
Member

@jimmygchen jimmygchen left a comment

Choose a reason for hiding this comment

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

LGTM!

@jimmygchen jimmygchen added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Feb 15, 2024
@jimmygchen
Copy link
Member

@mergify queue

Copy link

mergify bot commented Feb 15, 2024

queue

🛑 The pull request has been removed from the queue default

Pull request #5010 has been dequeued by a dequeue command.

You can take a look at Queue: Embarked in merge queue check runs for more details.

In case of a failure due to a flaky test, you should first retrigger the CI.
Then, re-embark the pull request into the merge queue by posting the comment
@mergifyio refresh on the pull request.

@jimmygchen
Copy link
Member

@mergify unqueue

Copy link

mergify bot commented Feb 15, 2024

unqueue

✅ The pull request has been removed from the queue default

@jimmygchen
Copy link
Member

@michaelsproul did you want to include this in the next release? just saw your comment in the description regarding needing further testing, so I've unqueued this for now

@michaelsproul
Copy link
Member Author

@jimmygchen I'd like to include it. I think the current test demonstrates that it's working, and we'll get a few days to observe on testnets once we've merged

@michaelsproul
Copy link
Member Author

@Mergifyio requeue

Copy link

mergify bot commented Feb 15, 2024

requeue

✅ This pull request will be re-embarked automatically

The followup queue command will be automatically executed to re-embark the pull request

Copy link

mergify bot commented Feb 15, 2024

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at f17fb29

mergify bot added a commit that referenced this pull request Feb 15, 2024
mergify bot added a commit that referenced this pull request Feb 15, 2024
@mergify mergify bot merged commit f17fb29 into sigp:unstable Feb 15, 2024
29 checks passed
@michaelsproul michaelsproul deleted the queue-http-attestations branch February 20, 2024 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request HTTP-API optimization Something to make Lighthouse run more efficiently. ready-for-merge This PR is ready to merge. v5.0.0 Q1 2024
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants