lighthouse/testing
Mac L 7dbc59efeb Share reqwest::Client between validators when using Web3Signer (#3335)
## 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.
2022-07-19 05:48:05 +00:00
..
antithesis Optimized Docker images (#2966) 2022-01-31 22:55:03 +00:00
ef_tests Bump the MSRV to 1.62 and using #[derive(Default)] on enums (#3304) 2022-07-15 07:31:19 +00:00
eth1_test_rig Unify execution layer endpoints (#3214) 2022-06-29 09:07:09 +00:00
execution_engine_integration Don't create a execution payload with same timestamp as terminal block (#3331) 2022-07-18 23:15:41 +00:00
node_test_rig Add merge support to simulator (#3292) 2022-07-18 23:15:40 +00:00
simulator Add merge support to simulator (#3292) 2022-07-18 23:15:40 +00:00
state_transition_vectors Use async code when interacting with EL (#3244) 2022-07-03 05:36:50 +00:00
test-test_logger Update to Rust 1.59 and 2021 edition (#3038) 2022-02-25 00:10:17 +00:00
web3signer_tests Share reqwest::Client between validators when using Web3Signer (#3335) 2022-07-19 05:48:05 +00:00