-
Notifications
You must be signed in to change notification settings - Fork 797
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
[Merged by Bors] - Optimise head block root API #4799
Conversation
0d82c26
to
2f1dc24
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. Seems to be some formatting issues but I'm down with the concept.
Fixed the formatting and also pushed a change to optimise the actual implementation. Should be ready for review now. Timings for head block roots are down from a few ms, to a few hundred microseconds: With v4.5.0:
With this branch:
|
Priority::P1 | ||
}; | ||
task_spawner.blocking_json_task(priority, move || { | ||
let (block_root, execution_optimistic, finalized) = block_id.root(&chain)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I'm guessing this also improve other block id queries as we don't necessary need to load blinded blocks from the store for the block roots.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, by-slot queries in particular should be a lot faster, as they can just load the block root directly. It also removes the hashing of the block, which is sometimes substantial (at least a few ms)
bors r+ |
## Issue Addressed We've had a report of sync committee performance suffering with the beacon processor HTTP API prioritisations. ## Proposed Changes Increase the priority of `/eth/v1/beacon/blocks/head/root` requests, which are used by the validator client to form sync committee messages, here: https://github.com/sigp/lighthouse/blob/441fc1691b69f9edc4bbdc6665f3efab16265c9b/validator_client/src/sync_committee_service.rs#L181-L188 Additionally, avoid loading the blinded block in all but the `block_id=block_root` case. I'm not sure why we were doing this previously, I suspect it was just an oversight during the implementation of the `finalized` status on API requests. ## Additional Info I think this change should have minimal negative impact as: - The block root endpoint is quick to compute (a few ms max). - Only the priority of `head` requests is increased. Analytical processes that are making lots of block root requests for past slots are unable to DoS the beacon processor, as their requests will still be processed after attestations.
Pull request successfully merged into unstable. Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page.
|
## Issue Addressed We've had a report of sync committee performance suffering with the beacon processor HTTP API prioritisations. ## Proposed Changes Increase the priority of `/eth/v1/beacon/blocks/head/root` requests, which are used by the validator client to form sync committee messages, here: https://github.com/sigp/lighthouse/blob/441fc1691b69f9edc4bbdc6665f3efab16265c9b/validator_client/src/sync_committee_service.rs#L181-L188 Additionally, avoid loading the blinded block in all but the `block_id=block_root` case. I'm not sure why we were doing this previously, I suspect it was just an oversight during the implementation of the `finalized` status on API requests. ## Additional Info I think this change should have minimal negative impact as: - The block root endpoint is quick to compute (a few ms max). - Only the priority of `head` requests is increased. Analytical processes that are making lots of block root requests for past slots are unable to DoS the beacon processor, as their requests will still be processed after attestations.
Issue Addressed
We've had a report of sync committee performance suffering with the beacon processor HTTP API prioritisations.
Proposed Changes
Increase the priority of
/eth/v1/beacon/blocks/head/root
requests, which are used by the validator client to form sync committee messages, here:lighthouse/validator_client/src/sync_committee_service.rs
Lines 181 to 188 in 441fc16
Additionally, avoid loading the blinded block in all but the
block_id=block_root
case. I'm not sure why we were doing this previously, I suspect it was just an oversight during the implementation of thefinalized
status on API requests.Additional Info
I think this change should have minimal negative impact as:
head
requests is increased. Analytical processes that are making lots of block root requests for past slots are unable to DoS the beacon processor, as their requests will still be processed after attestations.