-
Notifications
You must be signed in to change notification settings - Fork 799
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] - Share reqwest::Client
between validators when using Web3Signer
#3335
Closed
Conversation
This file contains 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
macladson
added
work-in-progress
PR is a work-in-progress
val-client
Relates to the validator client binary
optimization
Something to make Lighthouse run more efficiently.
labels
Jul 15, 2022
bors bot
pushed a commit
that referenced
this pull request
Jul 15, 2022
## Proposed Changes Adds some improvements I found when playing around with local testnets in #3335: - When trying to kill processes, do not exit on a failure. (If a node fails to start due to a bug, the PID associated with it no longer exists. When trying to tear down the testnets, an error will be raised when it tries that PID and then will not try any PIDs following it. This change means it will continue and tear down the rest of the network. - When starting the testnet, set `ulimit` to a high number. This allows the VCs to import 1000s of validators without running into limitations.
macladson
added
ready-for-review
The code is ready for review
and removed
work-in-progress
PR is a work-in-progress
labels
Jul 15, 2022
michaelsproul
requested changes
Jul 15, 2022
michaelsproul
added
waiting-on-author
The reviewer has suggested changes and awaits thier implementation.
and removed
ready-for-review
The code is ready for review
labels
Jul 15, 2022
macladson
added
ready-for-review
The code is ready for review
work-in-progress
PR is a work-in-progress
and removed
waiting-on-author
The reviewer has suggested changes and awaits thier implementation.
ready-for-review
The code is ready for review
labels
Jul 18, 2022
macladson
added
ready-for-review
The code is ready for review
and removed
work-in-progress
PR is a work-in-progress
labels
Jul 19, 2022
michaelsproul
approved these changes
Jul 19, 2022
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.
LGTM!
I have just one stylistic suggestion, but happy to merge with or without that
michaelsproul
added
ready-for-merge
This PR is ready to merge.
and removed
ready-for-review
The code is ready for review
labels
Jul 19, 2022
bors r+ |
bors bot
pushed a commit
that referenced
this pull request
Jul 19, 2022
## Issue Addressed #3302 ## Proposed Changes Move the `reqwest::Client` from being initialized per-validator, to being initialized per distinct Web3Signer. This is done by placing the `Client` into a `HashMap` keyed by the definition of the Web3Signer as specified by the `ValidatorDefintion`. This will allow multiple Web3Signers to be used with a single VC and also maintains backwards compatibility. ## Additional Info This was done to reduce the memory used by the VC when connecting to a Web3Signer. I set up a local testnet using [a custom script](https://github.com/macladson/lighthouse/tree/web3signer-local-test/scripts/local_testnet_web3signer) and ran a VC with 200 validator keys: VC with Web3Signer: - `unstable`: ~200MB - With fix: ~50MB VC with Local Signer: - `unstable`: ~35MB - With fix: ~35MB > I'm seeing some fragmentation with the VC using the Web3Signer, but not when using a local signer (this is most likely due to making lots of http requests and dealing with lots of JSON objects). I tested the above using `MALLOC_ARENA_MAX=1` to try to reduce the fragmentation. Without it, the values are around +50MB for both `unstable` and the fix.
bors
bot
changed the title
Share
[Merged by Bors] - Share Jul 19, 2022
reqwest::Client
between validators when using Web3Signerreqwest::Client
between validators when using Web3Signer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
optimization
Something to make Lighthouse run more efficiently.
ready-for-merge
This PR is ready to merge.
val-client
Relates to the validator client binary
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
#3302
Proposed Changes
Move the
reqwest::Client
from being initialized per-validator, to being initialized per distinct Web3Signer.This is done by placing the
Client
into aHashMap
keyed by the definition of the Web3Signer as specified by theValidatorDefintion
. This will allow multiple Web3Signers to be used with a single VC and also maintains backwards compatibility.Additional Info
This was done to reduce the memory used by the VC when connecting to a Web3Signer.
I set up a local testnet using a custom script and ran a VC with 200 validator keys:
VC with Web3Signer:
unstable
: ~200MBVC with Local Signer:
unstable
: ~35MB