diff --git a/beacon_chain/conf.nim b/beacon_chain/conf.nim index 48beb9e4f..1f7da4032 100644 --- a/beacon_chain/conf.nim +++ b/beacon_chain/conf.nim @@ -367,24 +367,22 @@ type name: "status-bar-contents" .}: string rpcEnabled* {. + # Deprecated > 1.7.0 hidden - desc: "Enable the JSON-RPC server (deprecated for removal)" - defaultValue: false - name: "rpc" .}: bool + desc: "Deprecated for removal" + name: "rpc" .}: Option[bool] rpcPort* {. + # Deprecated > 1.7.0 hidden - desc: "HTTP port for the JSON-RPC service (deprecated for removal)" - defaultValue: 9190 - defaultValueDesc: "9190" - name: "rpc-port" .}: Port + desc: "Deprecated for removal" + name: "rpc-port" .}: Option[Port] rpcAddress* {. + # Deprecated > 1.7.0 hidden - desc: "Listening address of the RPC server (deprecated for removal)" - defaultValue: defaultAdminListenAddress - defaultValueDesc: $defaultAdminListenAddressDesc - name: "rpc-address" .}: ValidIpAddress + desc: "Deprecated for removal" + name: "rpc-address" .}: Option[ValidIpAddress] restEnabled* {. desc: "Enable the REST server" @@ -538,13 +536,11 @@ type defaultValue: false name: "validator-monitor-totals" .}: bool - # https://github.com/ethereum/consensus-specs/blob/v1.2.0/sync/optimistic.md#fork-choice-poisoning safeSlotsToImportOptimistically* {. + # Never unhidden or documented, and deprecated > 22.9.1 hidden - desc: "Modify SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY" - # https://github.com/ethereum/consensus-specs/blob/v1.2.0/sync/optimistic.md#constants - defaultValue: 128 - name: "safe-slots-to-import-optimistically" .}: uint16 + desc: "Deprecated for removal" + name: "safe-slots-to-import-optimistically" .}: Option[uint16] # Same option as appears in Lighthouse and Prysm # https://lighthouse-book.sigmaprime.io/suggested-fee-recipient.html diff --git a/beacon_chain/consensus_object_pools/block_pools_types.nim b/beacon_chain/consensus_object_pools/block_pools_types.nim index 9d166c5e6..50972120b 100644 --- a/beacon_chain/consensus_object_pools/block_pools_types.nim +++ b/beacon_chain/consensus_object_pools/block_pools_types.nim @@ -233,7 +233,7 @@ type ## committee messages will be rejected optimisticRoots*: HashSet[Eth2Digest] - ## https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.3/sync/optimistic.md#helpers + ## https://github.com/ethereum/consensus-specs/blob/v1.2.0/sync/optimistic.md#helpers EpochKey* = object ## The epoch key fully determines the shuffling for proposers and diff --git a/beacon_chain/consensus_object_pools/spec_cache.nim b/beacon_chain/consensus_object_pools/spec_cache.nim index c0167d9a8..49b2a3ebe 100644 --- a/beacon_chain/consensus_object_pools/spec_cache.nim +++ b/beacon_chain/consensus_object_pools/spec_cache.nim @@ -213,7 +213,7 @@ func makeAttestationData*( doAssert current_epoch == epochRef.epoch - # https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/phase0/validator.md#attestation-data + # https://github.com/ethereum/consensus-specs/blob/v1.2.0/specs/phase0/validator.md#attestation-data AttestationData( slot: slot, index: committee_index.asUInt64, diff --git a/beacon_chain/gossip_processing/block_processor.nim b/beacon_chain/gossip_processing/block_processor.nim index b70098b38..1fbec28f6 100644 --- a/beacon_chain/gossip_processing/block_processor.nim +++ b/beacon_chain/gossip_processing/block_processor.nim @@ -70,7 +70,6 @@ type dumpEnabled: bool dumpDirInvalid: string dumpDirIncoming: string - safeSlotsToImportOptimistically: uint16 # Producers # ---------------------------------------------------------------- @@ -100,8 +99,7 @@ proc new*(T: type BlockProcessor, rng: ref HmacDrbgContext, taskpool: TaskPoolPtr, consensusManager: ref ConsensusManager, validatorMonitor: ref ValidatorMonitor, - getBeaconTime: GetBeaconTimeFn, - safeSlotsToImportOptimistically: uint16): ref BlockProcessor = + getBeaconTime: GetBeaconTimeFn): ref BlockProcessor = (ref BlockProcessor)( dumpEnabled: dumpEnabled, dumpDirInvalid: dumpDirInvalid, @@ -110,7 +108,6 @@ proc new*(T: type BlockProcessor, consensusManager: consensusManager, validatorMonitor: validatorMonitor, getBeaconTime: getBeaconTime, - safeSlotsToImportOptimistically: safeSlotsToImportOptimistically, verifier: BatchVerifier(rng: rng, taskpool: taskpool) ) @@ -513,7 +510,7 @@ proc runQueueProcessingLoop*(self: ref BlockProcessor) {.async.} = # - MUST NOT optimistically import the block. # - MUST NOT apply the block to the fork choice store. # - MAY queue the block for later processing. - # https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.3/sync/optimistic.md#execution-engine-errors + # https://github.com/ethereum/consensus-specs/blob/v1.2.0/sync/optimistic.md#execution-engine-errors template reEnqueueBlock: untyped = await sleepAsync(chronos.seconds(1)) self[].addBlock( diff --git a/beacon_chain/gossip_processing/eth2_processor.nim b/beacon_chain/gossip_processing/eth2_processor.nim index a6734dcb0..9164204be 100644 --- a/beacon_chain/gossip_processing/eth2_processor.nim +++ b/beacon_chain/gossip_processing/eth2_processor.nim @@ -566,7 +566,7 @@ proc processSignedContributionAndProof*( err(v.error()) -# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.3/specs/altair/light-client/sync-protocol.md#process_light_client_finality_update +# https://github.com/ethereum/consensus-specs/blob/v1.2.0/specs/altair/light-client/sync-protocol.md#process_light_client_finality_update proc processLightClientFinalityUpdate*( self: var Eth2Processor, src: MsgSource, finality_update: altair.LightClientFinalityUpdate diff --git a/beacon_chain/gossip_processing/light_client_processor.nim b/beacon_chain/gossip_processing/light_client_processor.nim index 77ebeb3d4..7b90a5efb 100644 --- a/beacon_chain/gossip_processing/light_client_processor.nim +++ b/beacon_chain/gossip_processing/light_client_processor.nim @@ -444,7 +444,7 @@ proc processLightClientFinalityUpdate*( self.latestFinalityUpdate = finality_update.toOptimistic v -# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.3/specs/altair/light-client/sync-protocol.md#process_light_client_finality_update +# https://github.com/ethereum/consensus-specs/blob/v1.2.0/specs/altair/light-client/sync-protocol.md#process_light_client_finality_update proc processLightClientOptimisticUpdate*( self: var LightClientProcessor, src: MsgSource, optimistic_update: altair.LightClientOptimisticUpdate diff --git a/beacon_chain/nimbus_beacon_node.nim b/beacon_chain/nimbus_beacon_node.nim index 211713f82..3f92342a3 100644 --- a/beacon_chain/nimbus_beacon_node.nim +++ b/beacon_chain/nimbus_beacon_node.nim @@ -297,8 +297,7 @@ proc initFullNode( config.defaultFeeRecipient) blockProcessor = BlockProcessor.new( config.dumpEnabled, config.dumpDirInvalid, config.dumpDirIncoming, - rng, taskpool, consensusManager, node.validatorMonitor, getBeaconTime, - config.safeSlotsToImportOptimistically) + rng, taskpool, consensusManager, node.validatorMonitor, getBeaconTime) blockVerifier = proc(signedBlock: ForkedSignedBeaconBlock): Future[Result[void, BlockError]] = # The design with a callback for block verification is unusual compared @@ -646,7 +645,7 @@ proc init*(T: type BeaconNode, optJwtSecret, ttdReached = not dag.loadExecutionBlockRoot(dag.finalizedHead.blck).isZero) - if config.rpcEnabled: + if config.rpcEnabled.isSome: warn "Nimbus's JSON-RPC server has been removed. This includes the --rpc, --rpc-port, and --rpc-address configuration options. https://nimbus.guide/rest-api.html shows how to enable and configure the REST Beacon API server which replaces it." let restServer = if config.restEnabled: @@ -1811,6 +1810,7 @@ proc doRunBeaconNode(config: var BeaconNodeConf, rng: ref HmacDrbgContext) {.rai warn "Config option is deprecated", option = config.option.get ignoreDeprecatedOption requireEngineAPI + ignoreDeprecatedOption safeSlotsToImportOptimistically createPidFile(config.dataDir.string / "beacon_node.pid") diff --git a/beacon_chain/spec/beacon_time.nim b/beacon_chain/spec/beacon_time.nim index 78b661742..fd4061346 100644 --- a/beacon_chain/spec/beacon_time.nim +++ b/beacon_chain/spec/beacon_time.nim @@ -217,7 +217,7 @@ iterator slots*(epoch: Epoch): Slot = for slot in start_slot ..< start_slot + SLOTS_PER_EPOCH: yield slot -# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/altair/validator.md#sync-committee +# https://github.com/ethereum/consensus-specs/blob/v1.2.0/specs/altair/validator.md#sync-committee template sync_committee_period*(epoch: Epoch): SyncCommitteePeriod = if epoch == FAR_FUTURE_EPOCH: FAR_FUTURE_PERIOD else: SyncCommitteePeriod(epoch div EPOCHS_PER_SYNC_COMMITTEE_PERIOD) diff --git a/beacon_chain/spec/datatypes/altair.nim b/beacon_chain/spec/datatypes/altair.nim index 97d49a2fe..fc6dfabcd 100644 --- a/beacon_chain/spec/datatypes/altair.nim +++ b/beacon_chain/spec/datatypes/altair.nim @@ -166,7 +166,7 @@ type ## Current sync committee corresponding to `header` current_sync_committee_branch*: CurrentSyncCommitteeBranch - # https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.3/specs/altair/light-client/sync-protocol.md#lightclientupdate + # https://github.com/ethereum/consensus-specs/blob/v1.2.0/specs/altair/light-client/sync-protocol.md#lightclientupdate LightClientUpdate* = object attested_header*: BeaconBlockHeader ## The beacon block header that is attested to by the sync committee diff --git a/beacon_chain/spec/helpers.nim b/beacon_chain/spec/helpers.nim index 88b4394dd..9fe75de0f 100644 --- a/beacon_chain/spec/helpers.nim +++ b/beacon_chain/spec/helpers.nim @@ -225,7 +225,7 @@ func get_safety_threshold*(store: LightClientStore): uint64 = store.current_max_active_participants ) div 2 -# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.3/specs/altair/light-client/sync-protocol.md#is_better_update +# https://github.com/ethereum/consensus-specs/blob/v1.2.0/specs/altair/light-client/sync-protocol.md#is_better_update type LightClientUpdateMetadata* = object attested_slot*, finalized_slot*, signature_slot*: Slot has_sync_committee*, has_finality*: bool diff --git a/beacon_chain/spec/state_transition.nim b/beacon_chain/spec/state_transition.nim index 18e71f294..2dfe16026 100644 --- a/beacon_chain/spec/state_transition.nim +++ b/beacon_chain/spec/state_transition.nim @@ -295,7 +295,7 @@ proc state_transition*( state_transition_block( cfg, state, signedBlock, cache, flags, rollback) -# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/phase0/validator.md#preparing-for-a-beaconblock +# https://github.com/ethereum/consensus-specs/blob/v1.2.0/specs/phase0/validator.md#preparing-for-a-beaconblock template partialBeaconBlock( cfg: RuntimeConfig, state: var phase0.HashedBeaconState, diff --git a/beacon_chain/validators/validator_duties.nim b/beacon_chain/validators/validator_duties.nim index db3e1cf2c..d4b3041c1 100644 --- a/beacon_chain/validators/validator_duties.nim +++ b/beacon_chain/validators/validator_duties.nim @@ -1156,7 +1156,7 @@ proc signAndSendAggregate( return # https://github.com/ethereum/consensus-specs/blob/v1.2.0/specs/phase0/validator.md#construct-aggregate - # https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/phase0/validator.md#aggregateandproof + # https://github.com/ethereum/consensus-specs/blob/v1.2.0/specs/phase0/validator.md#aggregateandproof var msg = SignedAggregateAndProof( message: AggregateAndProof( diff --git a/beacon_chain/validators/validator_pool.nim b/beacon_chain/validators/validator_pool.nim index 344a98867..2744015dc 100644 --- a/beacon_chain/validators/validator_pool.nim +++ b/beacon_chain/validators/validator_pool.nim @@ -371,7 +371,7 @@ proc getSyncCommitteeSelectionProof*(v: AttachedValidator, fork: Fork, ) await v.signData(request) -# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/specs/altair/validator.md#broadcast-sync-committee-contribution +# https://github.com/ethereum/consensus-specs/blob/v1.2.0/specs/altair/validator.md#broadcast-sync-committee-contribution proc getContributionAndProofSignature*(v: AttachedValidator, fork: Fork, genesis_validators_root: Eth2Digest, contribution_and_proof: ContributionAndProof diff --git a/tests/test_block_processor.nim b/tests/test_block_processor.nim index 9d12c458b..24a0ea41d 100644 --- a/tests/test_block_processor.nim +++ b/tests/test_block_processor.nim @@ -54,7 +54,7 @@ suite "Block processor" & preset(): getTimeFn = proc(): BeaconTime = b2.message.slot.start_beacon_time() processor = BlockProcessor.new( false, "", "", keys.newRng(), taskpool, consensusManager, - validatorMonitor, getTimeFn, safeSlotsToImportOptimistically = 128) + validatorMonitor, getTimeFn) test "Reverse order block add & get" & preset(): let missing = processor[].storeBlock(