deprecate `--safe-slots-to-import-optimistically` (#4182)

This commit is contained in:
tersec 2022-09-29 06:29:49 +00:00 committed by GitHub
parent c9f69fc38e
commit c367b14ad9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 28 additions and 35 deletions

View File

@ -367,24 +367,22 @@ type
name: "status-bar-contents" .}: string name: "status-bar-contents" .}: string
rpcEnabled* {. rpcEnabled* {.
# Deprecated > 1.7.0
hidden hidden
desc: "Enable the JSON-RPC server (deprecated for removal)" desc: "Deprecated for removal"
defaultValue: false name: "rpc" .}: Option[bool]
name: "rpc" .}: bool
rpcPort* {. rpcPort* {.
# Deprecated > 1.7.0
hidden hidden
desc: "HTTP port for the JSON-RPC service (deprecated for removal)" desc: "Deprecated for removal"
defaultValue: 9190 name: "rpc-port" .}: Option[Port]
defaultValueDesc: "9190"
name: "rpc-port" .}: Port
rpcAddress* {. rpcAddress* {.
# Deprecated > 1.7.0
hidden hidden
desc: "Listening address of the RPC server (deprecated for removal)" desc: "Deprecated for removal"
defaultValue: defaultAdminListenAddress name: "rpc-address" .}: Option[ValidIpAddress]
defaultValueDesc: $defaultAdminListenAddressDesc
name: "rpc-address" .}: ValidIpAddress
restEnabled* {. restEnabled* {.
desc: "Enable the REST server" desc: "Enable the REST server"
@ -538,13 +536,11 @@ type
defaultValue: false defaultValue: false
name: "validator-monitor-totals" .}: bool name: "validator-monitor-totals" .}: bool
# https://github.com/ethereum/consensus-specs/blob/v1.2.0/sync/optimistic.md#fork-choice-poisoning
safeSlotsToImportOptimistically* {. safeSlotsToImportOptimistically* {.
# Never unhidden or documented, and deprecated > 22.9.1
hidden hidden
desc: "Modify SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY" desc: "Deprecated for removal"
# https://github.com/ethereum/consensus-specs/blob/v1.2.0/sync/optimistic.md#constants name: "safe-slots-to-import-optimistically" .}: Option[uint16]
defaultValue: 128
name: "safe-slots-to-import-optimistically" .}: uint16
# Same option as appears in Lighthouse and Prysm # Same option as appears in Lighthouse and Prysm
# https://lighthouse-book.sigmaprime.io/suggested-fee-recipient.html # https://lighthouse-book.sigmaprime.io/suggested-fee-recipient.html

View File

@ -233,7 +233,7 @@ type
## committee messages will be rejected ## committee messages will be rejected
optimisticRoots*: HashSet[Eth2Digest] 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 EpochKey* = object
## The epoch key fully determines the shuffling for proposers and ## The epoch key fully determines the shuffling for proposers and

View File

@ -213,7 +213,7 @@ func makeAttestationData*(
doAssert current_epoch == epochRef.epoch 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( AttestationData(
slot: slot, slot: slot,
index: committee_index.asUInt64, index: committee_index.asUInt64,

View File

@ -70,7 +70,6 @@ type
dumpEnabled: bool dumpEnabled: bool
dumpDirInvalid: string dumpDirInvalid: string
dumpDirIncoming: string dumpDirIncoming: string
safeSlotsToImportOptimistically: uint16
# Producers # Producers
# ---------------------------------------------------------------- # ----------------------------------------------------------------
@ -100,8 +99,7 @@ proc new*(T: type BlockProcessor,
rng: ref HmacDrbgContext, taskpool: TaskPoolPtr, rng: ref HmacDrbgContext, taskpool: TaskPoolPtr,
consensusManager: ref ConsensusManager, consensusManager: ref ConsensusManager,
validatorMonitor: ref ValidatorMonitor, validatorMonitor: ref ValidatorMonitor,
getBeaconTime: GetBeaconTimeFn, getBeaconTime: GetBeaconTimeFn): ref BlockProcessor =
safeSlotsToImportOptimistically: uint16): ref BlockProcessor =
(ref BlockProcessor)( (ref BlockProcessor)(
dumpEnabled: dumpEnabled, dumpEnabled: dumpEnabled,
dumpDirInvalid: dumpDirInvalid, dumpDirInvalid: dumpDirInvalid,
@ -110,7 +108,6 @@ proc new*(T: type BlockProcessor,
consensusManager: consensusManager, consensusManager: consensusManager,
validatorMonitor: validatorMonitor, validatorMonitor: validatorMonitor,
getBeaconTime: getBeaconTime, getBeaconTime: getBeaconTime,
safeSlotsToImportOptimistically: safeSlotsToImportOptimistically,
verifier: BatchVerifier(rng: rng, taskpool: taskpool) verifier: BatchVerifier(rng: rng, taskpool: taskpool)
) )
@ -513,7 +510,7 @@ proc runQueueProcessingLoop*(self: ref BlockProcessor) {.async.} =
# - MUST NOT optimistically import the block. # - MUST NOT optimistically import the block.
# - MUST NOT apply the block to the fork choice store. # - MUST NOT apply the block to the fork choice store.
# - MAY queue the block for later processing. # - 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 = template reEnqueueBlock: untyped =
await sleepAsync(chronos.seconds(1)) await sleepAsync(chronos.seconds(1))
self[].addBlock( self[].addBlock(

View File

@ -566,7 +566,7 @@ proc processSignedContributionAndProof*(
err(v.error()) 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*( proc processLightClientFinalityUpdate*(
self: var Eth2Processor, src: MsgSource, self: var Eth2Processor, src: MsgSource,
finality_update: altair.LightClientFinalityUpdate finality_update: altair.LightClientFinalityUpdate

View File

@ -444,7 +444,7 @@ proc processLightClientFinalityUpdate*(
self.latestFinalityUpdate = finality_update.toOptimistic self.latestFinalityUpdate = finality_update.toOptimistic
v 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*( proc processLightClientOptimisticUpdate*(
self: var LightClientProcessor, src: MsgSource, self: var LightClientProcessor, src: MsgSource,
optimistic_update: altair.LightClientOptimisticUpdate optimistic_update: altair.LightClientOptimisticUpdate

View File

@ -297,8 +297,7 @@ proc initFullNode(
config.defaultFeeRecipient) config.defaultFeeRecipient)
blockProcessor = BlockProcessor.new( blockProcessor = BlockProcessor.new(
config.dumpEnabled, config.dumpDirInvalid, config.dumpDirIncoming, config.dumpEnabled, config.dumpDirInvalid, config.dumpDirIncoming,
rng, taskpool, consensusManager, node.validatorMonitor, getBeaconTime, rng, taskpool, consensusManager, node.validatorMonitor, getBeaconTime)
config.safeSlotsToImportOptimistically)
blockVerifier = proc(signedBlock: ForkedSignedBeaconBlock): blockVerifier = proc(signedBlock: ForkedSignedBeaconBlock):
Future[Result[void, BlockError]] = Future[Result[void, BlockError]] =
# The design with a callback for block verification is unusual compared # The design with a callback for block verification is unusual compared
@ -646,7 +645,7 @@ proc init*(T: type BeaconNode,
optJwtSecret, optJwtSecret,
ttdReached = not dag.loadExecutionBlockRoot(dag.finalizedHead.blck).isZero) 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." 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: let restServer = if config.restEnabled:
@ -1811,6 +1810,7 @@ proc doRunBeaconNode(config: var BeaconNodeConf, rng: ref HmacDrbgContext) {.rai
warn "Config option is deprecated", warn "Config option is deprecated",
option = config.option.get option = config.option.get
ignoreDeprecatedOption requireEngineAPI ignoreDeprecatedOption requireEngineAPI
ignoreDeprecatedOption safeSlotsToImportOptimistically
createPidFile(config.dataDir.string / "beacon_node.pid") createPidFile(config.dataDir.string / "beacon_node.pid")

View File

@ -217,7 +217,7 @@ iterator slots*(epoch: Epoch): Slot =
for slot in start_slot ..< start_slot + SLOTS_PER_EPOCH: for slot in start_slot ..< start_slot + SLOTS_PER_EPOCH:
yield slot 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 = template sync_committee_period*(epoch: Epoch): SyncCommitteePeriod =
if epoch == FAR_FUTURE_EPOCH: FAR_FUTURE_PERIOD if epoch == FAR_FUTURE_EPOCH: FAR_FUTURE_PERIOD
else: SyncCommitteePeriod(epoch div EPOCHS_PER_SYNC_COMMITTEE_PERIOD) else: SyncCommitteePeriod(epoch div EPOCHS_PER_SYNC_COMMITTEE_PERIOD)

View File

@ -166,7 +166,7 @@ type
## Current sync committee corresponding to `header` ## Current sync committee corresponding to `header`
current_sync_committee_branch*: CurrentSyncCommitteeBranch 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 LightClientUpdate* = object
attested_header*: BeaconBlockHeader attested_header*: BeaconBlockHeader
## The beacon block header that is attested to by the sync committee ## The beacon block header that is attested to by the sync committee

View File

@ -225,7 +225,7 @@ func get_safety_threshold*(store: LightClientStore): uint64 =
store.current_max_active_participants store.current_max_active_participants
) div 2 ) 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 type LightClientUpdateMetadata* = object
attested_slot*, finalized_slot*, signature_slot*: Slot attested_slot*, finalized_slot*, signature_slot*: Slot
has_sync_committee*, has_finality*: bool has_sync_committee*, has_finality*: bool

View File

@ -295,7 +295,7 @@ proc state_transition*(
state_transition_block( state_transition_block(
cfg, state, signedBlock, cache, flags, rollback) 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( template partialBeaconBlock(
cfg: RuntimeConfig, cfg: RuntimeConfig,
state: var phase0.HashedBeaconState, state: var phase0.HashedBeaconState,

View File

@ -1156,7 +1156,7 @@ proc signAndSendAggregate(
return 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/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 var
msg = SignedAggregateAndProof( msg = SignedAggregateAndProof(
message: AggregateAndProof( message: AggregateAndProof(

View File

@ -371,7 +371,7 @@ proc getSyncCommitteeSelectionProof*(v: AttachedValidator, fork: Fork,
) )
await v.signData(request) 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, proc getContributionAndProofSignature*(v: AttachedValidator, fork: Fork,
genesis_validators_root: Eth2Digest, genesis_validators_root: Eth2Digest,
contribution_and_proof: ContributionAndProof contribution_and_proof: ContributionAndProof

View File

@ -54,7 +54,7 @@ suite "Block processor" & preset():
getTimeFn = proc(): BeaconTime = b2.message.slot.start_beacon_time() getTimeFn = proc(): BeaconTime = b2.message.slot.start_beacon_time()
processor = BlockProcessor.new( processor = BlockProcessor.new(
false, "", "", keys.newRng(), taskpool, consensusManager, false, "", "", keys.newRng(), taskpool, consensusManager,
validatorMonitor, getTimeFn, safeSlotsToImportOptimistically = 128) validatorMonitor, getTimeFn)
test "Reverse order block add & get" & preset(): test "Reverse order block add & get" & preset():
let missing = processor[].storeBlock( let missing = processor[].storeBlock(