mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-02 09:46:26 +00:00
Adjust remote signer idle connection timeout defaults. (#4779)
* Adjust remote signer idle connection timeout defaults. * Address review comments.
This commit is contained in:
parent
c31fbc3977
commit
9e5c19eba5
@ -27,6 +27,12 @@ export
|
||||
|
||||
const
|
||||
WEB3_SIGNER_DELAY_TOLERANCE = 3.seconds
|
||||
WEB3_SIGNER_DEFAULT_TIMEOUT = (int64(SECONDS_PER_SLOT) + 1).seconds
|
||||
# This timeout value should not be greater than default value specified at:
|
||||
# https://docs.web3signer.consensys.net/Reference/CLI/CLI-Syntax#idle-connection-timeout-seconds
|
||||
WEB3_SIGNER_CHECKING_PERIOD = ((int64(SECONDS_PER_SLOT) + 1) div 3).seconds
|
||||
# Host often connection pool will collect/destroy connections which are
|
||||
# expired.
|
||||
|
||||
declareGauge validators,
|
||||
"Number of validators attached to the beacon node"
|
||||
@ -174,7 +180,11 @@ proc addRemoteValidator(pool: var ValidatorPool,
|
||||
block:
|
||||
var res: seq[(RestClientRef, RemoteSignerInfo)]
|
||||
for remote in keystore.remotes:
|
||||
let client = RestClientRef.new($remote.url, prestoFlags, httpFlags)
|
||||
let client = RestClientRef.new(
|
||||
$remote.url, prestoFlags, httpFlags,
|
||||
idleTimeout = WEB3_SIGNER_DEFAULT_TIMEOUT,
|
||||
idlePeriod = WEB3_SIGNER_CHECKING_PERIOD,
|
||||
)
|
||||
if client.isErr():
|
||||
# TODO keep trying in case of temporary network failure
|
||||
warn "Unable to resolve distributed signer address",
|
||||
|
Loading…
x
Reference in New Issue
Block a user