c5c7476518
[EIP-3030]: https://eips.ethereum.org/EIPS/eip-3030 [Web3Signer]: https://consensys.github.io/web3signer/web3signer-eth2.html ## Issue Addressed Resolves #2498 ## Proposed Changes Allows the VC to call out to a [Web3Signer] remote signer to obtain signatures. ## Additional Info ### Making Signing Functions `async` To allow remote signing, I needed to make all the signing functions `async`. This caused a bit of noise where I had to convert iterators into `for` loops. In `duties_service.rs` there was a particularly tricky case where we couldn't hold a write-lock across an `await`, so I had to first take a read-lock, then grab a write-lock. ### Move Signing from Core Executor Whilst implementing this feature, I noticed that we signing was happening on the core tokio executor. I suspect this was causing the executor to temporarily lock and occasionally trigger some HTTP timeouts (and potentially SQL pool timeouts, but I can't verify this). Since moving all signing into blocking tokio tasks, I noticed a distinct drop in the "atttestations_http_get" metric on a Prater node: ![http_get_times](https://user-images.githubusercontent.com/6660660/132143737-82fd3836-2e7e-445b-a143-cb347783baad.png) I think this graph indicates that freeing the core executor allows the VC to operate more smoothly. ### Refactor TaskExecutor I noticed that the `TaskExecutor::spawn_blocking_handle` function would fail to spawn tasks if it were unable to obtain handles to some metrics (this can happen if the same metric is defined twice). It seemed that a more sensible approach would be to keep spawning tasks, but without metrics. To that end, I refactored the function so that it would still function without metrics. There are no other changes made. ## TODO - [x] Restructure to support multiple signing methods. - [x] Add calls to remote signer from VC. - [x] Documentation - [x] Test all endpoints - [x] Test HTTPS certificate - [x] Allow adding remote signer validators via the API - [x] Add Altair support via [21.8.1-rc1](https://github.com/ConsenSys/web3signer/releases/tag/21.8.1-rc1) - [x] Create issue to start using latest version of web3signer. (See #2570) ## Notes - ~~Web3Signer doesn't yet support the Altair fork for Prater. See https://github.com/ConsenSys/web3signer/issues/423.~~ - ~~There is not yet a release of Web3Signer which supports Altair blocks. See https://github.com/ConsenSys/web3signer/issues/391.~~
73 lines
2.5 KiB
TOML
73 lines
2.5 KiB
TOML
[package]
|
|
name = "validator_client"
|
|
version = "0.3.5"
|
|
authors = ["Paul Hauner <paul@paulhauner.com>", "Age Manning <Age@AgeManning.com>", "Luke Anderson <luke@lukeanderson.com.au>"]
|
|
edition = "2018"
|
|
|
|
[lib]
|
|
name = "validator_client"
|
|
path = "src/lib.rs"
|
|
|
|
[dev-dependencies]
|
|
tokio = { version = "1.10.0", features = ["time", "rt-multi-thread", "macros"] }
|
|
deposit_contract = { path = "../common/deposit_contract" }
|
|
|
|
[dependencies]
|
|
eth2_ssz = "0.3.0"
|
|
eth2_config = { path = "../common/eth2_config" }
|
|
tree_hash = "0.3.0"
|
|
clap = "2.33.3"
|
|
eth2_interop_keypairs = { path = "../common/eth2_interop_keypairs" }
|
|
slashing_protection = { path = "./slashing_protection" }
|
|
slot_clock = { path = "../common/slot_clock" }
|
|
types = { path = "../consensus/types" }
|
|
safe_arith = { path = "../consensus/safe_arith" }
|
|
serde = "1.0.116"
|
|
serde_derive = "1.0.116"
|
|
bincode = "1.3.1"
|
|
serde_json = "1.0.58"
|
|
serde_yaml = "0.8.13"
|
|
slog = { version = "2.5.2", features = ["max_level_trace", "release_max_level_trace"] }
|
|
slog-async = "2.5.0"
|
|
slog-term = "2.6.0"
|
|
tokio = { version = "1.10.0", features = ["time"] }
|
|
futures = "0.3.7"
|
|
dirs = "3.0.1"
|
|
directory = { path = "../common/directory" }
|
|
lockfile = { path = "../common/lockfile" }
|
|
logging = { path = "../common/logging" }
|
|
environment = { path = "../lighthouse/environment" }
|
|
parking_lot = "0.11.0"
|
|
exit-future = "0.2.0"
|
|
filesystem = { path = "../common/filesystem" }
|
|
libc = "0.2.79"
|
|
eth2_ssz_derive = "0.2.1"
|
|
hex = "0.4.2"
|
|
deposit_contract = { path = "../common/deposit_contract" }
|
|
bls = { path = "../crypto/bls" }
|
|
eth2 = { path = "../common/eth2" }
|
|
tempfile = "3.1.0"
|
|
rayon = "1.4.1"
|
|
validator_dir = { path = "../common/validator_dir" }
|
|
clap_utils = { path = "../common/clap_utils" }
|
|
eth2_keystore = { path = "../crypto/eth2_keystore" }
|
|
account_utils = { path = "../common/account_utils" }
|
|
lighthouse_version = { path = "../common/lighthouse_version" }
|
|
warp_utils = { path = "../common/warp_utils" }
|
|
warp = { git = "https://github.com/paulhauner/warp ", branch = "cors-wildcard" }
|
|
hyper = "0.14.4"
|
|
eth2_serde_utils = "0.1.0"
|
|
libsecp256k1 = "0.6.0"
|
|
ring = "0.16.19"
|
|
rand = "0.7.3"
|
|
scrypt = { version = "0.7.0", default-features = false }
|
|
lighthouse_metrics = { path = "../common/lighthouse_metrics" }
|
|
lazy_static = "1.4.0"
|
|
fallback = { path = "../common/fallback" }
|
|
itertools = "0.10.0"
|
|
monitoring_api = { path = "../common/monitoring_api" }
|
|
sensitive_url = { path = "../common/sensitive_url" }
|
|
task_executor = { path = "../common/task_executor" }
|
|
reqwest = { version = "0.11.0", features = ["json","stream"] }
|
|
url = "2.2.2"
|