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
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

View File

@ -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

View File

@ -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,

View File

@ -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(

View File

@ -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

View File

@ -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

View File

@ -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")

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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,

View File

@ -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(

View File

@ -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

View File

@ -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(