Repository navigation
Optimise no-op PATCH ops in VC HTTP API - #5064
Merged
Merged
Conversation
Member
Author
|
When spamming requests,
Spam script is something like: #!/usr/bin/env bash
while [ true ]
do
curl -s -X PATCH --data '{"builder_proposals": false}' -H "Content-Type: application/json" -H "Authorization: Bearer api-token-0x02430fd0af4a262df8be03e2f2fad494162d1d22488720fc8254639d7371b2ff7b" "http://localhost:5062/lighthouse/validators/0x90e3b075e5261c4ba40e0d33480ae16251f9383e30e1b541bd8ddfb3b04a5e64965fb5d3cabc7ff9bf52a2b028c3b9a5"
done |
macladson
approved these changes
Feb 26, 2024
macladson
left a comment
Member
There was a problem hiding this comment.
Seems good to me and I see no reason not to do it, but I also agree that some kind of map seems like a natural solution for the long term (although I'm not sure about the implications of such a change).
dapplion
approved these changes
Feb 27, 2024
Member
Author
|
@Mergifyio queue |
✅ The pull request has been merged automaticallyDetailsThe pull request has been merged automatically at 88b37a1 |
This was referenced Feb 28, 2024
8 tasks done
pawanjay176
pushed a commit
to pawanjay176/lighthouse
that referenced
this pull request
Mar 5, 2024
* Optimise no-op changes in VC API * Handle another no-op case * Merge remote-tracking branch 'origin/unstable' into opt-vc-patch-api
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Issue Addressed
Closes #4936
Proposed Changes
Optimise
PATCH /lighthouse/validators/{validator_pubkey}so that it is faster when processing redundant changes. I suspect this will help VCs running thousands of keys from becoming overwhelmed when processing lots of these API queries.Longer-term we should still think about optimising the key cache and API more for actual changes. I suspect the
O(n)loop over the validators for each request is part of the problem, here:lighthouse/validator_client/src/initialized_validators.rs
Line 782 in 441fc16
Addressing this by using a persistent map would both make the API faster, and help to resolve atomicity issues like #4984.