From 4908ba7c132ea9bed7328fb5f8c123afeb1e003d Mon Sep 17 00:00:00 2001 From: tersec Date: Wed, 22 Jun 2022 15:44:00 +0000 Subject: [PATCH] use JWT when and only when the user specifies a JWT secret explicitly (#3786) --- beacon_chain/nimbus_beacon_node.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/beacon_chain/nimbus_beacon_node.nim b/beacon_chain/nimbus_beacon_node.nim index a9a06cb17..2e150555f 100644 --- a/beacon_chain/nimbus_beacon_node.nim +++ b/beacon_chain/nimbus_beacon_node.nim @@ -435,7 +435,9 @@ proc init*(T: type BeaconNode, quit 1 let optJwtSecret = - if cfg.BELLATRIX_FORK_EPOCH != FAR_FUTURE_EPOCH: + # Some Web3 endpoints aren't compatible with JWT, but if explicitly chosen, + # use it regardless. + if config.jwtSecret.isSome: let jwtSecret = rng[].checkJwtSecret( string(config.dataDir), config.jwtSecret) if jwtSecret.isErr: