From 1af053792c4ed445a76a2de7e93271e288329131 Mon Sep 17 00:00:00 2001 From: tersec Date: Mon, 27 Jun 2022 20:23:49 +0000 Subject: [PATCH 01/11] bump merge-testnets for new sepolia TTD (#3811) --- vendor/merge-testnets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/merge-testnets b/vendor/merge-testnets index 15c7c3936..f8f2318fd 160000 --- a/vendor/merge-testnets +++ b/vendor/merge-testnets @@ -1 +1 @@ -Subproject commit 15c7c3936aedcdf43ea6767cf7643806429c2c7a +Subproject commit f8f2318fd3b5c4441c410d00b928a57d0b5a2d46 From c01341851d0d17ee41f577ce6a071852256deac4 Mon Sep 17 00:00:00 2001 From: zah Date: Tue, 28 Jun 2022 23:56:17 +0300 Subject: [PATCH 02/11] Backticks in Github Actions YAML need escaping --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3b1e5ebe9..92c7d3ed3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -288,11 +288,11 @@ jobs: ## Urgency guidelines - `low-urgency`: update at your own convenience, sometime within our normal update cycle of two weeks + \`low-urgency\`: update at your own convenience, sometime within our normal update cycle of two weeks - `medium-urgency`: may contain an important stability fix, it is better to update sooner rather than later + \`medium-urgency\`: may contain an important stability fix, it is better to update sooner rather than later - `high-urgency`: update as soon as you can, this is a critical update required for Nimbus to function correctly + \`high-urgency\`: update as soon as you can, this is a critical update required for Nimbus to function correctly ## SHA512 checksums From 2d2cda735beea3ded6998e2b70835086251394de Mon Sep 17 00:00:00 2001 From: tersec Date: Tue, 28 Jun 2022 20:56:48 +0000 Subject: [PATCH 03/11] bump nim-eth to fix Nim 1.6 warnings (#3818) --- vendor/nim-eth | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/nim-eth b/vendor/nim-eth index 1b516682b..6e813353e 160000 --- a/vendor/nim-eth +++ b/vendor/nim-eth @@ -1 +1 @@ -Subproject commit 1b516682bdef195174e632bc1772a75c97950e2f +Subproject commit 6e813353ebe3ccd9e9003f3e5d7d0512b3b7ae1b From 5a44f347bce865d69abadd23b59525f99b303802 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Tue, 21 Jun 2022 00:06:29 +0300 Subject: [PATCH 04/11] Correct a typo in the release notes --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae22d34df..8370e258c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ 2022-06-20 v22.6.0 ================== -Nimbus `v22.6.0` brings support for the merge testnets Ropsten and Sepolia (please stay tuned for TTD announcements for tha later) and a lot of polish where we've taken the time to address a long list of UX improvements and minor bug fixes suggested or reported by our users. We are deeply grateful to everybody who contributed valuable feedback for this release. +Nimbus `v22.6.0` brings support for the merge testnets Ropsten and Sepolia (please stay tuned for TTD announcements for the latter) and a lot of polish where we've taken the time to address a long list of UX improvements and bug fixes suggested or reported by our users. We are deeply grateful to everybody who contributed valuable feedback for this release. ### Improvements From 3514d39fd24312f3717554a3799e8ff1f1f4dfe2 Mon Sep 17 00:00:00 2001 From: tersec Date: Tue, 21 Jun 2022 21:09:29 +0000 Subject: [PATCH 05/11] bump nim-web3 for eth_chainId support (#3785) --- vendor/nim-web3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/nim-web3 b/vendor/nim-web3 index 755b6dc92..7a15892a4 160000 --- a/vendor/nim-web3 +++ b/vendor/nim-web3 @@ -1 +1 @@ -Subproject commit 755b6dc92b1545d6c9eb242c551e8188e35ffe5d +Subproject commit 7a15892a4e55774524ae0782ccc9e32a541fa841 From baf38c341617dd29c3f5339c1a8dcbc482163349 Mon Sep 17 00:00:00 2001 From: tersec Date: Wed, 22 Jun 2022 15:44:00 +0000 Subject: [PATCH 06/11] 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 549233a6f..1eac467b1 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: From b1789992252940faa8e7144443e744575896a0a2 Mon Sep 17 00:00:00 2001 From: tersec Date: Mon, 27 Jun 2022 15:02:12 +0000 Subject: [PATCH 07/11] use eth_chainId instead of net_version (#3804) * use eth_chainId instead of net_version * Update beacon_chain/eth1/eth1_monitor.nim Co-authored-by: Etan Kissling * fix logging for Quantity types Co-authored-by: Etan Kissling --- beacon_chain/eth1/eth1_monitor.nim | 47 +++++++++++++++++++----------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/beacon_chain/eth1/eth1_monitor.nim b/beacon_chain/eth1/eth1_monitor.nim index b84758d5c..688774b5b 100644 --- a/beacon_chain/eth1/eth1_monitor.nim +++ b/beacon_chain/eth1/eth1_monitor.nim @@ -1060,8 +1060,7 @@ proc detectPrimaryProviderComingOnline(m: Eth1Monitor) {.async.} = # Use one of the get/request-type methods from # https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.9/src/engine/specification.md#underlying-protocol # which does nit take parameters and returns a small structure, to ensure - # this works with engine API endpoints. Either eth_chainId or eth_syncing - # works for this purpose. + # this works with engine API endpoints. let testRequest = tempProvider.web3.provider.eth_syncing() yield testRequest or sleepAsync(web3Timeouts) @@ -1342,18 +1341,28 @@ proc startEth1Syncing(m: Eth1Monitor, delayBeforeStart: Duration) {.async.} = contract = $m.depositContractAddress if isFirstRun and m.eth1Network.isSome: - let - providerNetwork = awaitWithRetries m.dataProvider.web3.provider.net_version() - expectedNetwork = case m.eth1Network.get - of mainnet: "1" - of ropsten: "3" - of rinkeby: "4" - of goerli: "5" - of sepolia: "11155111" - if expectedNetwork != providerNetwork: - fatal "The specified web3 provider serves data for a different network", - expectedNetwork, providerNetwork - quit 1 + try: + let + providerChain = + awaitWithRetries m.dataProvider.web3.provider.eth_chainId() + + # https://eips.ethereum.org/EIPS/eip-155#list-of-chain-ids + expectedChain = case m.eth1Network.get + of mainnet: 1.Quantity + of ropsten: 3.Quantity + of rinkeby: 4.Quantity + of goerli: 5.Quantity + of sepolia: 11155111.Quantity # https://chainid.network/ + if expectedChain != providerChain: + fatal "The specified Web3 provider serves data for a different chain", + expectedChain = distinctBase(expectedChain), + providerChain = distinctBase(providerChain) + quit 1 + except CatchableError as exc: + # Typically because it's not synced through EIP-155, assuming this Web3 + # endpoint has been otherwise working. + debug "startEth1Syncing: eth_chainId failed: ", + error = exc.msg var mustUsePolling = m.forcePolling or web3Url.startsWith("http://") or @@ -1525,8 +1534,6 @@ proc testWeb3Provider*(web3Url: Uri, web3 = mustSucceed "connect to web3 provider": await newWeb3( $web3Url, getJsonRpcRequestHeaders(jwtSecret)) - networkVersion = mustSucceed "get network version": - awaitWithRetries web3.provider.net_version() latestBlock = mustSucceed "get latest block": awaitWithRetries web3.provider.eth_getBlockByNumber(blockId("latest"), false) syncStatus = mustSucceed "get sync status": @@ -1542,13 +1549,19 @@ proc testWeb3Provider*(web3Url: Uri, awaitWithRetries web3.provider.eth_mining() echo "Client Version: ", clientVersion - echo "Network Version: ", networkVersion echo "Network Peers: ", peers echo "Syncing: ", syncStatus echo "Latest block: ", latestBlock.number.uint64 echo "Last Known Nonce: ", web3.lastKnownNonce echo "Mining: ", mining + try: + let chainId = awaitWithRetries web3.provider.eth_chainId() + echo "Chain ID: ", chainId.uint64 + except DataProviderFailure as exc: + # Typically because it's not synced through EIP-155. + echo "Web3 provider does not provide chain ID: " & exc.msg + let ns = web3.contractSender(DepositContract, depositContractAddress) try: let depositRoot = awaitWithRetries( From 725b120bc372c3e3b0c4431ad018d6556ee66753 Mon Sep 17 00:00:00 2001 From: Eugene Kabanov Date: Tue, 28 Jun 2022 13:21:16 +0300 Subject: [PATCH 08/11] Fix proper timing check for bellatrix epoch. (#3807) --- .../block_pools_types.nim | 29 ++++---- .../consensus_object_pools/blockchain_dag.nim | 15 +--- beacon_chain/nimbus_beacon_node.nim | 71 +++++++++++++------ beacon_chain/rpc/rest_node_api.nim | 2 +- beacon_chain/rpc/rest_utils.nim | 4 +- beacon_chain/rpc/rest_validator_api.nim | 10 ++- 6 files changed, 79 insertions(+), 52 deletions(-) diff --git a/beacon_chain/consensus_object_pools/block_pools_types.nim b/beacon_chain/consensus_object_pools/block_pools_types.nim index 7f271f3a3..f83b69eb2 100644 --- a/beacon_chain/consensus_object_pools/block_pools_types.nim +++ b/beacon_chain/consensus_object_pools/block_pools_types.nim @@ -335,6 +335,15 @@ func shortLog*(v: EpochKey): string = template setFinalizationCb*(dag: ChainDAGRef, cb: OnFinalizedCallback) = dag.onFinHappened = cb +template setBlockCb*(dag: ChainDAGRef, cb: OnBlockCallback) = + dag.onBlockAdded = cb + +template setHeadCb*(dag: ChainDAGRef, cb: OnHeadCallback) = + dag.onHeadChanged = cb + +template setReorgCb*(dag: ChainDAGRef, cb: OnReorgCallback) = + dag.onReorgHappened = cb + func shortLog*(v: EpochRef): string = # epoch:root when logging epoch, root:slot when logging slot! if v.isNil(): @@ -363,40 +372,36 @@ func blockRef*(key: KeyedBlockRef): BlockRef = func init*(t: typedesc[HeadChangeInfoObject], slot: Slot, blockRoot: Eth2Digest, stateRoot: Eth2Digest, epochTransition: bool, - previousDutyDepRoot: Eth2Digest, currentDutyDepRoot: Eth2Digest, - optimistic: Option[bool]): HeadChangeInfoObject = + previousDutyDepRoot: Eth2Digest, + currentDutyDepRoot: Eth2Digest): HeadChangeInfoObject = HeadChangeInfoObject( slot: slot, block_root: blockRoot, state_root: stateRoot, epoch_transition: epochTransition, previous_duty_dependent_root: previousDutyDepRoot, - current_duty_dependent_root: currentDutyDepRoot, - optimistic: optimistic + current_duty_dependent_root: currentDutyDepRoot ) func init*(t: typedesc[ReorgInfoObject], slot: Slot, depth: uint64, oldHeadBlockRoot: Eth2Digest, newHeadBlockRoot: Eth2Digest, - oldHeadStateRoot: Eth2Digest, newHeadStateRoot: Eth2Digest, - optimistic: Option[bool]): ReorgInfoObject = + oldHeadStateRoot: Eth2Digest, + newHeadStateRoot: Eth2Digest): ReorgInfoObject = ReorgInfoObject( slot: slot, depth: depth, old_head_block: oldHeadBlockRoot, new_head_block: newHeadBlockRoot, old_head_state: oldHeadStateRoot, - new_head_state: newHeadStateRoot, - optimistic: optimistic + new_head_state: newHeadStateRoot ) func init*(t: typedesc[FinalizationInfoObject], blockRoot: Eth2Digest, - stateRoot: Eth2Digest, epoch: Epoch, - optimistic: Option[bool]): FinalizationInfoObject = + stateRoot: Eth2Digest, epoch: Epoch): FinalizationInfoObject = FinalizationInfoObject( block_root: blockRoot, state_root: stateRoot, - epoch: epoch, - optimistic: optimistic + epoch: epoch ) func init*(t: typedesc[EventBeaconBlockObject], diff --git a/beacon_chain/consensus_object_pools/blockchain_dag.nim b/beacon_chain/consensus_object_pools/blockchain_dag.nim index 2caa301be..7bc4b46f4 100644 --- a/beacon_chain/consensus_object_pools/blockchain_dag.nim +++ b/beacon_chain/consensus_object_pools/blockchain_dag.nim @@ -1624,13 +1624,10 @@ proc updateHead*( if not(isNil(dag.onReorgHappened)): let # TODO (cheatfate): Proper implementation required - optimistic = - if dag.getHeadStateMergeComplete(): some(false) else: none[bool]() data = ReorgInfoObject.init(dag.head.slot, uint64(ancestorDepth), lastHead.root, newHead.root, lastHeadStateRoot, - getStateRoot(dag.headState), - optimistic) + getStateRoot(dag.headState)) dag.onReorgHappened(data) # A reasonable criterion for "reorganizations of the chain" @@ -1652,12 +1649,10 @@ proc updateHead*( prevDepRoot = withState(dag.headState): state.attester_dependent_root epochTransition = (finalizedHead != dag.finalizedHead) # TODO (cheatfate): Proper implementation required - optimistic = - if dag.getHeadStateMergeComplete(): some(false) else: none[bool]() data = HeadChangeInfoObject.init(dag.head.slot, dag.head.root, getStateRoot(dag.headState), epochTransition, depRoot, - prevDepRoot, optimistic) + prevDepRoot) dag.onHeadChanged(data) withState(dag.headState): @@ -1717,12 +1712,8 @@ proc updateHead*( else: Eth2Digest() # The thing that finalized was >8192 blocks old? # TODO (cheatfate): Proper implementation required - let optimistic = - if dag.getHeadStateMergeComplete(): some(false) else: none[bool]() - let data = FinalizationInfoObject.init( - dag.finalizedHead.blck.root, stateRoot, dag.finalizedHead.slot.epoch, - optimistic) + dag.finalizedHead.blck.root, stateRoot, dag.finalizedHead.slot.epoch) dag.onFinHappened(dag, data) proc isInitialized*(T: type ChainDAGRef, db: BeaconChainDB): Result[void, cstring] = diff --git a/beacon_chain/nimbus_beacon_node.nim b/beacon_chain/nimbus_beacon_node.nim index 1eac467b1..47b9959b4 100644 --- a/beacon_chain/nimbus_beacon_node.nim +++ b/beacon_chain/nimbus_beacon_node.nim @@ -152,21 +152,8 @@ proc loadChainDag( eventBus: EventBus, validatorMonitor: ref ValidatorMonitor, networkGenesisValidatorsRoot: Option[Eth2Digest]): ChainDAGRef = - var dag: ChainDAGRef info "Loading block DAG from database", path = config.databaseDir - proc onBlockAdded(data: ForkedTrustedSignedBeaconBlock) = - # TODO (cheatfate): Proper implementation required - let optimistic = - if isNil(dag): - none[bool]() - else: - if dag.getHeadStateMergeComplete(): some(false) else: none[bool]() - eventBus.blocksQueue.emit(EventBeaconBlockObject.init(data, optimistic)) - proc onHeadChanged(data: HeadChangeInfoObject) = - eventBus.headQueue.emit(data) - proc onChainReorg(data: ReorgInfoObject) = - eventBus.reorgQueue.emit(data) proc onLightClientFinalityUpdate(data: altair.LightClientFinalityUpdate) = eventBus.finUpdateQueue.emit(data) proc onLightClientOptimisticUpdate(data: altair.LightClientOptimisticUpdate) = @@ -183,16 +170,14 @@ proc loadChainDag( if config.lightClientDataServe.get: onLightClientOptimisticUpdate else: nil - dag = ChainDAGRef.init( - cfg, db, validatorMonitor, chainDagFlags, config.eraDir, - onBlockAdded, onHeadChanged, onChainReorg, - onLCFinalityUpdateCb = onLightClientFinalityUpdateCb, - onLCOptimisticUpdateCb = onLightClientOptimisticUpdateCb, - lightClientDataServe = config.lightClientDataServe.get, - lightClientDataImportMode = config.lightClientDataImportMode.get, - vanityLogs = getPandas(detectTTY(config.logStdout))) + dag = ChainDAGRef.init( + cfg, db, validatorMonitor, chainDagFlags, config.eraDir, + onLCFinalityUpdateCb = onLightClientFinalityUpdateCb, + onLCOptimisticUpdateCb = onLightClientOptimisticUpdateCb, + lightClientDataServe = config.lightClientDataServe.get, + lightClientDataImportMode = config.lightClientDataImportMode.get, + vanityLogs = getPandas(detectTTY(config.logStdout))) - let databaseGenesisValidatorsRoot = getStateField(dag.headState, genesis_validators_root) @@ -235,6 +220,35 @@ proc initFullNode( node.eventBus.contribQueue.emit(data) proc onVoluntaryExitAdded(data: SignedVoluntaryExit) = node.eventBus.exitQueue.emit(data) + proc onBlockAdded(data: ForkedTrustedSignedBeaconBlock) = + # TODO (cheatfate): Proper implementation required + let optimistic = + if node.currentSlot().epoch() >= dag.cfg.BELLATRIX_FORK_EPOCH: + some(false) + else: + none[bool]() + node.eventBus.blocksQueue.emit( + EventBeaconBlockObject.init(data, optimistic)) + proc onHeadChanged(data: HeadChangeInfoObject) = + # TODO (cheatfate): Proper implementation required + let eventData = + if node.currentSlot().epoch() >= dag.cfg.BELLATRIX_FORK_EPOCH: + var res = data + res.optimistic = some(false) + res + else: + data + node.eventBus.headQueue.emit(eventData) + proc onChainReorg(data: ReorgInfoObject) = + # TODO (cheatfate): Proper implementation required + let eventData = + if node.currentSlot().epoch() >= dag.cfg.BELLATRIX_FORK_EPOCH: + var res = data + res.optimistic = some(false) + res + else: + data + node.eventBus.reorgQueue.emit(eventData) proc makeOnFinalizationCb( # This `nimcall` functions helps for keeping track of what # needs to be captured by the onFinalization closure. @@ -248,7 +262,15 @@ proc initFullNode( finalizedEpochRef.eth1_data, finalizedEpochRef.eth1_deposit_index) node.updateLightClientFromDag() - eventBus.finalQueue.emit(data) + # TODO (cheatfate): Proper implementation required + let eventData = + if node.currentSlot().epoch() >= dag.cfg.BELLATRIX_FORK_EPOCH: + var res = data + res.optimistic = some(false) + res + else: + data + eventBus.finalQueue.emit(eventData) func getLocalHeadSlot(): Slot = dag.head.slot @@ -305,6 +327,9 @@ proc initFullNode( getFrontfillSlot, dag.backfill.slot, blockVerifier, maxHeadAge = 0) dag.setFinalizationCb makeOnFinalizationCb(node.eventBus, node.eth1Monitor) + dag.setBlockCb(onBlockAdded) + dag.setHeadCb(onHeadChanged) + dag.setReorgCb(onChainReorg) node.dag = dag node.quarantine = quarantine diff --git a/beacon_chain/rpc/rest_node_api.nim b/beacon_chain/rpc/rest_node_api.nim index c6ea0a2da..2e76882ea 100644 --- a/beacon_chain/rpc/rest_node_api.nim +++ b/beacon_chain/rpc/rest_node_api.nim @@ -263,7 +263,7 @@ proc installNodeApiHandlers*(router: var RestRouter, node: BeaconNode) = else: node.syncManager.inProgress isOptimistic = - if node.dag.getHeadStateMergeComplete(): + if node.currentSlot().epoch() >= node.dag.cfg.BELLATRIX_FORK_EPOCH: # TODO (cheatfate): Proper implementation required some(false) else: diff --git a/beacon_chain/rpc/rest_utils.nim b/beacon_chain/rpc/rest_utils.nim index 3cf616510..cac09c310 100644 --- a/beacon_chain/rpc/rest_utils.nim +++ b/beacon_chain/rpc/rest_utils.nim @@ -274,7 +274,7 @@ proc getRouter*(allowedOrigin: Option[string]): RestRouter = proc getStateOptimistic*(node: BeaconNode, state: ForkedHashedBeaconState): Option[bool] = - if node.dag.getHeadStateMergeComplete(): + if node.currentSlot().epoch() >= node.dag.cfg.BELLATRIX_FORK_EPOCH: case state.kind of BeaconStateFork.Phase0, BeaconStateFork.Altair: some[bool](false) @@ -287,7 +287,7 @@ proc getStateOptimistic*(node: BeaconNode, proc getBlockOptimistic*(node: BeaconNode, blck: ForkedTrustedSignedBeaconBlock | ForkedSignedBeaconBlock): Option[bool] = - if node.dag.getHeadStateMergeComplete(): + if node.currentSlot().epoch() >= node.dag.cfg.BELLATRIX_FORK_EPOCH: case blck.kind of BeaconBlockFork.Phase0, BeaconBlockFork.Altair: some[bool](false) diff --git a/beacon_chain/rpc/rest_validator_api.nim b/beacon_chain/rpc/rest_validator_api.nim index f089a8b0c..b0030ee29 100644 --- a/beacon_chain/rpc/rest_validator_api.nim +++ b/beacon_chain/rpc/rest_validator_api.nim @@ -99,7 +99,10 @@ proc installValidatorApiHandlers*(router: var RestRouter, node: BeaconNode) = # TODO (cheatfate): Proper implementation required let optimistic = - if node.dag.getHeadStateMergeComplete(): some(false) else: none[bool]() + if node.currentSlot().epoch() >= node.dag.cfg.BELLATRIX_FORK_EPOCH: + some(false) + else: + none[bool]() return RestApiResponse.jsonResponseWRoot( duties, epochRef.attester_dependent_root, optimistic) @@ -150,7 +153,10 @@ proc installValidatorApiHandlers*(router: var RestRouter, node: BeaconNode) = # TODO (cheatfate): Proper implementation required let optimistic = - if node.dag.getHeadStateMergeComplete(): some(false) else: none[bool]() + if node.currentSlot().epoch() >= node.dag.cfg.BELLATRIX_FORK_EPOCH: + some(false) + else: + none[bool]() return RestApiResponse.jsonResponseWRoot( duties, epochRef.proposer_dependent_root, optimistic) From fa7d7fcc42c2c8145539a5a27235a3a38381fb70 Mon Sep 17 00:00:00 2001 From: zah Date: Tue, 28 Jun 2022 23:50:40 +0300 Subject: [PATCH 09/11] Avoid overflow in the initial 'nextExchangeTransitionConfTime' calculation (#3809) --- beacon_chain/nimbus_beacon_node.nim | 14 +++++++++++--- vendor/nim-chronos | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/beacon_chain/nimbus_beacon_node.nim b/beacon_chain/nimbus_beacon_node.nim index 47b9959b4..e3794d7b1 100644 --- a/beacon_chain/nimbus_beacon_node.nim +++ b/beacon_chain/nimbus_beacon_node.nim @@ -712,11 +712,19 @@ proc init*(T: type BeaconNode, else: nil - bellatrixEpochTime = - genesisTime + cfg.BELLATRIX_FORK_EPOCH * SLOTS_PER_EPOCH * SECONDS_PER_SLOT + maxSecondsInMomentType = Moment.high.epochSeconds + # If the Bellatrix epoch is above this value, the calculation + # below will overflow. This happens in practice for networks + # where the `BELLATRIX_FORK_EPOCH` is not yet specified. + maxSupportedBellatrixEpoch = (maxSecondsInMomentType.uint64 - genesisTime) div + (SLOTS_PER_EPOCH * SECONDS_PER_SLOT) + bellatrixEpochTime = if cfg.BELLATRIX_FORK_EPOCH < maxSupportedBellatrixEpoch: + int64(genesisTime + cfg.BELLATRIX_FORK_EPOCH * SLOTS_PER_EPOCH * SECONDS_PER_SLOT) + else: + maxSecondsInMomentType nextExchangeTransitionConfTime = - max(Moment.init(int64 bellatrixEpochTime, Second), + max(Moment.init(bellatrixEpochTime, Second), Moment.now) let node = BeaconNode( diff --git a/vendor/nim-chronos b/vendor/nim-chronos index 2a5095505..a5bc5ca99 160000 --- a/vendor/nim-chronos +++ b/vendor/nim-chronos @@ -1 +1 @@ -Subproject commit 2a5095505f771610f9559d2e774b2a9561f01101 +Subproject commit a5bc5ca996ab72c1c5dda7d5b922b536f39f603e From 2444e9948f0f950219b6c32cd2b17cabf40a4e6b Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Wed, 29 Jun 2022 01:08:56 +0300 Subject: [PATCH 10/11] Version 22.6.1 --- CHANGELOG.md | 22 ++++++++++++++++++++++ beacon_chain/version.nim | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8370e258c..21e5f8b7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,25 @@ +2022-06-29 v22.6.1 +================== + +Nimbus `v22.6.1` is a `low-urgency` release which comes pre-configured with the correct TTD value for the Sepolia network and improves the behavior of Nimbus in merge testnets. + +### Improvement + +* Allow testing the Engine API JWT credentials even before the merge. + https://github.com/status-im/nimbus-eth2/pull/3786 + +### Fixes + +* Lack of detection of the connected execution client's network when attached to the Engine API port. + https://github.com/status-im/nimbus-eth2/pull/3804 + +* Logic error leading to a premature start of the `exchange transition configuration` Engine API requests. + https://github.com/status-im/nimbus-eth2/pull/3809 + +* Inappropriate inclusion of the `execution_optimistic` field in REST responses before the merge. + https://github.com/status-im/nimbus-eth2/pull/3807 + + 2022-06-20 v22.6.0 ================== diff --git a/beacon_chain/version.nim b/beacon_chain/version.nim index f940a5c79..3be48d877 100644 --- a/beacon_chain/version.nim +++ b/beacon_chain/version.nim @@ -15,7 +15,7 @@ when not defined(nimscript): const versionMajor* = 22 versionMinor* = 6 - versionBuild* = 0 + versionBuild* = 1 versionBlob* = "stateofus" # Single word - ends up in the default graffiti From 31772a2ac27f080054e322923dcf97bc13584499 Mon Sep 17 00:00:00 2001 From: tersec Date: Wed, 29 Jun 2022 07:36:22 +0000 Subject: [PATCH 11/11] don't use JWT if one hasn't set up a JWT secret (#3822) --- scripts/launch_local_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/launch_local_testnet.sh b/scripts/launch_local_testnet.sh index 9c0d0dad5..52b602667 100755 --- a/scripts/launch_local_testnet.sh +++ b/scripts/launch_local_testnet.sh @@ -865,6 +865,7 @@ for NUM_NODE in $(seq 0 $(( NUM_NODES - 1 ))); do WEB3_ARG="--web3-url=http://127.0.0.1:${EL_RPC_PORTS[${NUM_NODE}]}" fi + # TODO re-add --jwt-secret ${BEACON_NODE_COMMAND} \ --config-file="${CLI_CONF_FILE}" \ --tcp-port=$(( BASE_PORT + NUM_NODE )) \ @@ -879,7 +880,6 @@ for NUM_NODE in $(seq 0 $(( NUM_NODES - 1 ))); do --light-client-enable=on \ --light-client-data-serve=on \ --light-client-data-import-mode=only-new \ - --jwt-secret=/tmp/jwtsecret \ ${EXTRA_ARGS} \ &> "${DATA_DIR}/log${NUM_NODE}.txt" &