Adds the Spedina testnet; Upgrades the spec presets to spec v0.12.3
Other changes: * Removed all references to Altona * Refactored the Makefile to avoid code duplication
This commit is contained in:
parent
f8733a4fb6
commit
10cfd1ec37
193
Makefile
193
Makefile
|
@ -187,147 +187,142 @@ testnet0 testnet1: | beacon_node signing_process
|
|||
--data-dir=build/data/$@_$(NODE_ID) \
|
||||
$(GOERLI_TESTNETS_PARAMS) $(NODE_PARAMS)
|
||||
|
||||
medalla: | beacon_node signing_process
|
||||
mkdir -p build/data/shared_medalla_$(NODE_ID)
|
||||
define connect_to_network
|
||||
mkdir -p build/data/shared_$(1)_$(NODE_ID)
|
||||
|
||||
scripts/make_prometheus_config.sh \
|
||||
--nodes 1 \
|
||||
--base-metrics-port $$(($(BASE_METRICS_PORT) + $(NODE_ID))) \
|
||||
--config-file "build/data/shared_medalla_$(NODE_ID)/prometheus.yml"
|
||||
--config-file "build/data/shared_$(1)_$(NODE_ID)/prometheus.yml"
|
||||
|
||||
$(CPU_LIMIT_CMD) build/beacon_node \
|
||||
--network=medalla \
|
||||
--network=$(1) \
|
||||
--log-level="$(LOG_LEVEL)" \
|
||||
--log-file=build/data/shared_medalla_$(NODE_ID)/nbc_bn_$$(date +"%Y%m%d%H%M%S").log \
|
||||
--data-dir=build/data/shared_medalla_$(NODE_ID) \
|
||||
--log-file=build/data/shared_$(1)_$(NODE_ID)/nbc_bn_$$(date +"%Y%m%d%H%M%S").log \
|
||||
--data-dir=build/data/shared_$(1)_$(NODE_ID) \
|
||||
$(GOERLI_TESTNETS_PARAMS) $(NODE_PARAMS)
|
||||
endef
|
||||
|
||||
medalla-vc: | beacon_node signing_process validator_client
|
||||
# if launching a VC as well - send the BN looking nowhere for validators/secrets
|
||||
mkdir -p build/data/shared_medalla_$(NODE_ID)/empty_dummy_folder
|
||||
define connect_to_network_in_dev_mode
|
||||
mkdir -p build/data/shared_$(1)_$(NODE_ID)
|
||||
|
||||
scripts/make_prometheus_config.sh \
|
||||
--nodes 1 \
|
||||
--base-metrics-port $$(($(BASE_METRICS_PORT) + $(NODE_ID))) \
|
||||
--config-file "build/data/shared_medalla_$(NODE_ID)/prometheus.yml"
|
||||
--config-file "build/data/shared_$(1)_$(NODE_ID)/prometheus.yml"
|
||||
|
||||
$(CPU_LIMIT_CMD) build/beacon_node \
|
||||
--network=medalla \
|
||||
--network=$(1) \
|
||||
--log-level="DEBUG; TRACE:discv5,networking; REQUIRED:none; DISABLED:none" \
|
||||
--data-dir=build/data/shared_$(1)_$(NODE_ID) \
|
||||
$(GOERLI_TESTNETS_PARAMS) --dump $(NODE_PARAMS)
|
||||
endef
|
||||
|
||||
define connect_to_network_with_validator_client
|
||||
# if launching a VC as well - send the BN looking nowhere for validators/secrets
|
||||
mkdir -p build/data/shared_$(1)_$(NODE_ID)/empty_dummy_folder
|
||||
|
||||
scripts/make_prometheus_config.sh \
|
||||
--nodes 1 \
|
||||
--base-metrics-port $$(($(BASE_METRICS_PORT) + $(NODE_ID))) \
|
||||
--config-file "build/data/shared_$(1)_$(NODE_ID)/prometheus.yml"
|
||||
|
||||
$(CPU_LIMIT_CMD) build/beacon_node \
|
||||
--network=$(1) \
|
||||
--log-level="$(LOG_LEVEL)" \
|
||||
--log-file=build/data/shared_medalla_$(NODE_ID)/nbc_bn_$$(date +"%Y%m%d%H%M%S").log \
|
||||
--data-dir=build/data/shared_medalla_$(NODE_ID) \
|
||||
--validators-dir=build/data/shared_medalla_$(NODE_ID)/empty_dummy_folder \
|
||||
--secrets-dir=build/data/shared_medalla_$(NODE_ID)/empty_dummy_folder \
|
||||
--log-file=build/data/shared_$(1)_$(NODE_ID)/nbc_bn_$$(date +"%Y%m%d%H%M%S").log \
|
||||
--data-dir=build/data/shared_$(1)_$(NODE_ID) \
|
||||
--validators-dir=build/data/shared_$(1)_$(NODE_ID)/empty_dummy_folder \
|
||||
--secrets-dir=build/data/shared_$(1)_$(NODE_ID)/empty_dummy_folder \
|
||||
$(GOERLI_TESTNETS_PARAMS) $(NODE_PARAMS) &
|
||||
|
||||
sleep 4
|
||||
|
||||
build/validator_client \
|
||||
--log-level="$(LOG_LEVEL)" \
|
||||
--log-file=build/data/shared_medalla_$(NODE_ID)/nbc_vc_$$(date +"%Y%m%d%H%M%S").log \
|
||||
--data-dir=build/data/shared_medalla_$(NODE_ID) \
|
||||
--log-file=build/data/shared_$(1)_$(NODE_ID)/nbc_vc_$$(date +"%Y%m%d%H%M%S").log \
|
||||
--data-dir=build/data/shared_$(1)_$(NODE_ID) \
|
||||
--rpc-port=$$(( $(BASE_RPC_PORT) +$(NODE_ID) ))
|
||||
endef
|
||||
|
||||
define make_deposit_data
|
||||
build/beacon_node deposits create \
|
||||
--network=$(1) \
|
||||
--new-wallet-file=build/data/shared_$(1)_$(NODE_ID)/wallet.json \
|
||||
--out-validators-dir=build/data/shared_$(1)_$(NODE_ID)/validators \
|
||||
--out-secrets-dir=build/data/shared_$(1)_$(NODE_ID)/secrets \
|
||||
--out-deposits-file=$(1)-deposits_data-$$(date +"%Y%m%d%H%M%S").json \
|
||||
--count=$(VALIDATORS)
|
||||
endef
|
||||
|
||||
define make_deposit
|
||||
build/beacon_node deposits create \
|
||||
--network=$(1) \
|
||||
--out-deposits-file=nbc-$(1)-deposits.json \
|
||||
--new-wallet-file=build/data/shared_$(1)_$(NODE_ID)/wallet.json \
|
||||
--out-validators-dir=build/data/shared_$(1)_$(NODE_ID)/validators \
|
||||
--out-secrets-dir=build/data/shared_$(1)_$(NODE_ID)/secrets \
|
||||
--count=$(VALIDATORS)
|
||||
|
||||
build/deposit_contract sendDeposits \
|
||||
--web3-url=$(GOERLI_WEB3_URL) \
|
||||
--deposit-contract=$$(cat vendor/eth2-testnets/shared/$(1)/deposit_contract.txt) \
|
||||
--deposits-file=nbc-$(1)-deposits.json \
|
||||
--min-delay=$(DEPOSITS_DELAY) \
|
||||
--ask-for-key
|
||||
endef
|
||||
|
||||
define clean-network
|
||||
rm -rf build/data/shared_$(1)*/db
|
||||
rm -rf build/data/shared_$(1)*/dump
|
||||
rm -rf build/data/shared_$(1)*/*.log
|
||||
endef
|
||||
|
||||
medalla: | beacon_node signing_process
|
||||
$(call connect_to_network,medalla)
|
||||
|
||||
medalla-vc: | beacon_node signing_process validator_client
|
||||
$(call connect_to_network_with_validator_client,medalla)
|
||||
|
||||
ifneq ($(LOG_LEVEL), TRACE)
|
||||
medalla-dev:
|
||||
+ "$(MAKE)" LOG_LEVEL=TRACE $@
|
||||
else
|
||||
medalla-dev: | beacon_node signing_process
|
||||
mkdir -p build/data/shared_medalla_$(NODE_ID)
|
||||
|
||||
scripts/make_prometheus_config.sh \
|
||||
--nodes 1 \
|
||||
--base-metrics-port $$(($(BASE_METRICS_PORT) + $(NODE_ID))) \
|
||||
--config-file "build/data/shared_medalla_$(NODE_ID)/prometheus.yml"
|
||||
|
||||
$(CPU_LIMIT_CMD) build/beacon_node \
|
||||
--network=medalla \
|
||||
--log-level="DEBUG; TRACE:discv5,networking; REQUIRED:none; DISABLED:none" \
|
||||
--data-dir=build/data/shared_medalla_$(NODE_ID) \
|
||||
$(GOERLI_TESTNETS_PARAMS) --dump $(NODE_PARAMS)
|
||||
$(call connect_to_network_in_dev_mode,medalla)
|
||||
endif
|
||||
|
||||
medalla-deposit-data: | beacon_node signing_process deposit_contract
|
||||
build/beacon_node deposits create \
|
||||
--network=medalla \
|
||||
--new-wallet-file=build/data/shared_medalla_$(NODE_ID)/wallet.json \
|
||||
--out-validators-dir=build/data/shared_medalla_$(NODE_ID)/validators \
|
||||
--out-secrets-dir=build/data/shared_medalla_$(NODE_ID)/secrets \
|
||||
--out-deposits-file=medalla-deposits_data-$$(date +"%Y%m%d%H%M%S").json \
|
||||
--count=$(VALIDATORS)
|
||||
$(call made_deposit_data,medalla)
|
||||
|
||||
medalla-deposit: | beacon_node signing_process deposit_contract
|
||||
build/beacon_node deposits create \
|
||||
--network=medalla \
|
||||
--out-deposits-file=nbc-medalla-deposits.json \
|
||||
--new-wallet-file=build/data/shared_medalla_$(NODE_ID)/wallet.json \
|
||||
--out-validators-dir=build/data/shared_medalla_$(NODE_ID)/validators \
|
||||
--out-secrets-dir=build/data/shared_medalla_$(NODE_ID)/secrets \
|
||||
--count=$(VALIDATORS)
|
||||
|
||||
build/deposit_contract sendDeposits \
|
||||
--web3-url=$(GOERLI_WEB3_URL) \
|
||||
--deposit-contract=$$(cat vendor/eth2-testnets/shared/medalla/deposit_contract.txt) \
|
||||
--deposits-file=nbc-medalla-deposits.json \
|
||||
--min-delay=$(DEPOSITS_DELAY) \
|
||||
--ask-for-key
|
||||
$(call made_deposit,medalla)
|
||||
|
||||
clean-medalla:
|
||||
rm -rf build/data/shared_medalla*/db
|
||||
rm -rf build/data/shared_medalla*/dump
|
||||
rm -rf build/data/shared_medalla*/*.log
|
||||
$(call clean_network,medalla)
|
||||
|
||||
altona: | beacon_node signing_process
|
||||
$(CPU_LIMIT_CMD) build/beacon_node \
|
||||
--network=altona \
|
||||
--log-level="$(LOG_LEVEL)" \
|
||||
--log-file=build/data/shared_altona_$(NODE_ID)/nbc_bn_$$(date +"%Y%m%d%H%M%S").log \
|
||||
--data-dir=build/data/shared_altona_$(NODE_ID) \
|
||||
$(GOERLI_TESTNETS_PARAMS) $(NODE_PARAMS)
|
||||
spadina: | beacon_node signing_process
|
||||
$(call connect_to_network,spadina)
|
||||
|
||||
altona-vc: | beacon_node signing_process validator_client
|
||||
# if launching a VC as well - send the BN looking nowhere for validators/secrets
|
||||
mkdir -p build/data/shared_altona_$(NODE_ID)/empty_dummy_folder
|
||||
$(CPU_LIMIT_CMD) build/beacon_node \
|
||||
--network=altona \
|
||||
--log-level="$(LOG_LEVEL)" \
|
||||
--log-file=build/data/shared_altona_$(NODE_ID)/nbc_bn_$$(date +"%Y%m%d%H%M%S").log \
|
||||
--data-dir=build/data/shared_altona_$(NODE_ID) \
|
||||
--validators-dir=build/data/shared_altona_$(NODE_ID)/empty_dummy_folder \
|
||||
--secrets-dir=build/data/shared_altona_$(NODE_ID)/empty_dummy_folder \
|
||||
$(GOERLI_TESTNETS_PARAMS) $(NODE_PARAMS) &
|
||||
sleep 4
|
||||
build/validator_client \
|
||||
--log-level="$(LOG_LEVEL)" \
|
||||
--log-file=build/data/shared_altona_$(NODE_ID)/nbc_vc_$$(date +"%Y%m%d%H%M%S").log \
|
||||
--data-dir=build/data/shared_altona_$(NODE_ID) \
|
||||
--rpc-port=$$(( $(BASE_RPC_PORT) +$(NODE_ID) ))
|
||||
spadina-vc: | beacon_node signing_process validator_client
|
||||
$(call connect_to_network_with_validator_client,spadina)
|
||||
|
||||
altona-dev: | beacon_node signing_process
|
||||
$(CPU_LIMIT_CMD) build/beacon_node \
|
||||
--network=altona \
|
||||
--log-level="DEBUG; TRACE:discv5,networking; REQUIRED:none; DISABLED:none" \
|
||||
--data-dir=build/data/shared_altona_$(NODE_ID) \
|
||||
$(GOERLI_TESTNETS_PARAMS) --dump $(NODE_PARAMS)
|
||||
ifneq ($(LOG_LEVEL), TRACE)
|
||||
spadina-dev:
|
||||
+ "$(MAKE)" LOG_LEVEL=TRACE $@
|
||||
else
|
||||
spadina-dev: | beacon_node signing_process
|
||||
$(call connect_to_network_in_dev_mode,spadina)
|
||||
endif
|
||||
|
||||
altona-deposit: | beacon_node signing_process deposit_contract
|
||||
build/beacon_node deposits create \
|
||||
--network=altona \
|
||||
--out-deposits-file=nbc-altona-deposits.json \
|
||||
--new-wallet-file=build/data/shared_altona_$(NODE_ID)/wallet.json \
|
||||
--out-deposits-dir=build/data/shared_altona_$(NODE_ID)/validators \
|
||||
--out-secrets-dir=build/data/shared_altona_$(NODE_ID)/secrets \
|
||||
--count=$(VALIDATORS)
|
||||
spadina-deposit-data: | beacon_node signing_process deposit_contract
|
||||
$(call make_deposit_data,spadina)
|
||||
|
||||
build/deposit_contract sendDeposits \
|
||||
--web3-url=$(GOERLI_WEB3_URL) \
|
||||
--deposit-contract=$$(cat vendor/eth2-testnets/shared/altona/deposit_contract.txt) \
|
||||
--deposits-file=nbc-altona-deposits.json \
|
||||
--min-delay=$(DEPOSITS_DELAY) \
|
||||
--ask-for-key
|
||||
spadina-deposit: | beacon_node signing_process deposit_contract
|
||||
$(call made_deposit,spadina)
|
||||
|
||||
clean-altona:
|
||||
rm -rf build/data/shared_altona*
|
||||
clean-spadina:
|
||||
$(call clean_network,spadina)
|
||||
|
||||
ctail: | build deps
|
||||
mkdir -p vendor/.nimble/bin/
|
||||
|
|
|
@ -157,18 +157,14 @@ const
|
|||
incompatibilityDesc: "This build is compiled with the " & const_preset & " const preset. " &
|
||||
"It's not compatible with mainnet")
|
||||
|
||||
template eth2testnet(path: string): Eth2NetworkMetadata =
|
||||
loadEth2NetworkMetadata(currentSourcePath.parentDir / ".." / "vendor" / "eth2-testnets" / path)
|
||||
|
||||
const
|
||||
altonaMetadata* = loadEth2NetworkMetadata(
|
||||
currentSourcePath.parentDir / ".." / "vendor" / "eth2-testnets" / "shared" / "altona")
|
||||
|
||||
medallaMetadata* = loadEth2NetworkMetadata(
|
||||
currentSourcePath.parentDir / ".." / "vendor" / "eth2-testnets" / "shared" / "medalla")
|
||||
|
||||
testnet0Metadata* = loadEth2NetworkMetadata(
|
||||
currentSourcePath.parentDir / ".." / "vendor" / "eth2-testnets" / "nimbus" / "testnet0")
|
||||
|
||||
testnet1Metadata* = loadEth2NetworkMetadata(
|
||||
currentSourcePath.parentDir / ".." / "vendor" / "eth2-testnets" / "nimbus" / "testnet1")
|
||||
medallaMetadata* = eth2testnet "shared/medalla"
|
||||
spadinaMetadata* = eth2testnet "shared/spadina"
|
||||
testnet0Metadata* = eth2testnet "nimbus/testnet0"
|
||||
testnet1Metadata* = eth2testnet "nimbus/testnet1"
|
||||
|
||||
{.pop.} # the following pocedures raise more than just `Defect`
|
||||
|
||||
|
@ -177,10 +173,10 @@ proc getMetadataForNetwork*(networkName: string): Eth2NetworkMetadata =
|
|||
metadata = case toLowerAscii(networkName)
|
||||
of "mainnet":
|
||||
mainnetMetadata
|
||||
of "altona":
|
||||
altonaMetadata
|
||||
of "medalla":
|
||||
medallaMetadata
|
||||
of "spadina":
|
||||
spadinaMetadata
|
||||
of "testnet0":
|
||||
testnet0Metadata
|
||||
of "testnet1":
|
||||
|
|
|
@ -26,13 +26,13 @@ type
|
|||
HYSTERESIS_DOWNWARD_MULTIPLIER
|
||||
HYSTERESIS_QUOTIENT
|
||||
HYSTERESIS_UPWARD_MULTIPLIER
|
||||
PROPORTIONAL_SLASHING_MULTIPLIER
|
||||
INACTIVITY_PENALTY_QUOTIENT
|
||||
MAX_ATTESTATIONS
|
||||
MAX_ATTESTER_SLASHINGS
|
||||
MAX_COMMITTEES_PER_SLOT
|
||||
MAX_DEPOSITS
|
||||
MAX_EFFECTIVE_BALANCE
|
||||
MAX_EPOCHS_PER_CROSSLINK
|
||||
MAX_PROPOSER_SLASHINGS
|
||||
MAX_SEED_LOOKAHEAD
|
||||
MAX_VALIDATORS_PER_COMMITTEE
|
||||
|
|
|
@ -1,168 +0,0 @@
|
|||
# beacon_chain
|
||||
# Copyright (c) 2018-2020 Status Research & Development GmbH
|
||||
# Licensed and distributed under either of
|
||||
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
||||
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
||||
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
||||
|
||||
# This file contains constants that are part of the spec and thus subject to
|
||||
# serialization and spec updates.
|
||||
|
||||
import
|
||||
math
|
||||
|
||||
{.experimental: "codeReordering".} # SLOTS_PER_EPOCH is use before being defined in spec
|
||||
|
||||
const
|
||||
# Misc
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/mainnet/phase0.yaml#L6
|
||||
|
||||
MAX_COMMITTEES_PER_SLOT* {.intdefine.}: uint64 = 64
|
||||
|
||||
TARGET_COMMITTEE_SIZE*: uint64 = 128 ##\
|
||||
## Number of validators in the committee attesting to one shard
|
||||
## Per spec:
|
||||
## For the safety of crosslinks `TARGET_COMMITTEE_SIZE` exceeds
|
||||
## [the recommended minimum committee size of 111](https://vitalik.ca/files/Ithaca201807_Sharding.pdf);
|
||||
## with sufficient active validators (at least
|
||||
## `SLOTS_PER_EPOCH * TARGET_COMMITTEE_SIZE`), the shuffling algorithm ensures
|
||||
## committee sizes at least `TARGET_COMMITTEE_SIZE`. (Unbiasable randomness
|
||||
## with a Verifiable Delay Function (VDF) will improve committee robustness
|
||||
## and lower the safe minimum committee size.)
|
||||
|
||||
MAX_VALIDATORS_PER_COMMITTEE*: uint64 = 2048 ##\
|
||||
## votes
|
||||
|
||||
MIN_PER_EPOCH_CHURN_LIMIT*: uint64 = 4
|
||||
CHURN_LIMIT_QUOTIENT*: uint64 = 2'u64 ^ 16
|
||||
SHUFFLE_ROUND_COUNT*: uint64 = 90
|
||||
|
||||
HYSTERESIS_QUOTIENT*: uint64 = 4
|
||||
HYSTERESIS_DOWNWARD_MULTIPLIER*: uint64 = 1
|
||||
HYSTERESIS_UPWARD_MULTIPLIER*: uint64 = 5
|
||||
|
||||
# Gwei values
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/mainnet/phase0.yaml#L61
|
||||
|
||||
MIN_DEPOSIT_AMOUNT*: uint64 = 2'u64^0 * 10'u64^9 ##\
|
||||
## Minimum amounth of ETH that can be deposited in one call - deposits can
|
||||
## be used either to top up an existing validator or commit to a new one
|
||||
|
||||
MAX_EFFECTIVE_BALANCE*: uint64 = 2'u64^5 * 10'u64^9 ##\
|
||||
## Maximum amounth of ETH that can be deposited in one call
|
||||
|
||||
EJECTION_BALANCE*: uint64 = 2'u64^4 * 10'u64^9 ##\
|
||||
## Once the balance of a validator drops below this, it will be ejected from
|
||||
## the validator pool
|
||||
|
||||
EFFECTIVE_BALANCE_INCREMENT*: uint64 = 2'u64^0 * 10'u64^9
|
||||
|
||||
# Initial values
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/mainnet/phase0.yaml#L73
|
||||
BLS_WITHDRAWAL_PREFIX*: byte = 0
|
||||
|
||||
# Time parameters
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/mainnet/phase0.yaml#L80
|
||||
SECONDS_PER_SLOT* {.intdefine.}: uint64 = 12'u64 # Compile with -d:SECONDS_PER_SLOT=1 for 12x faster slots
|
||||
## TODO consistent time unit across projects, similar to C++ chrono?
|
||||
|
||||
MIN_ATTESTATION_INCLUSION_DELAY*: uint64 = 1 ##\
|
||||
## (12 seconds)
|
||||
## Number of slots that attestations stay in the attestation
|
||||
## pool before being added to a block.
|
||||
## The attestation delay exists so that there is time for attestations to
|
||||
## propagate before the block is created.
|
||||
## When creating an attestation, the validator will look at the best
|
||||
## information known to at that time, and may not revise it during the same
|
||||
## slot (see `is_double_vote`) - the delay gives the validator a chance to
|
||||
## wait towards the end of the slot and still have time to publish the
|
||||
## attestation.
|
||||
|
||||
SLOTS_PER_EPOCH* {.intdefine.}: uint64 = 32 ##\
|
||||
## (~6.4 minutes)
|
||||
## slots that make up an epoch, at the end of which more heavy
|
||||
## processing is done
|
||||
## Compile with -d:SLOTS_PER_EPOCH=4 for shorter epochs
|
||||
|
||||
MIN_SEED_LOOKAHEAD*: uint64 = 1 ##\
|
||||
## epochs (~6.4 minutes)
|
||||
|
||||
MAX_SEED_LOOKAHEAD*: uint64 = 4 ##\
|
||||
## epochs (~25.6 minutes)
|
||||
|
||||
EPOCHS_PER_ETH1_VOTING_PERIOD*: uint64 = 32 ##\
|
||||
## epochs (~3.4 hours)
|
||||
|
||||
SLOTS_PER_HISTORICAL_ROOT*: uint64 = 8192 ##\
|
||||
## slots (13 hours)
|
||||
|
||||
MIN_VALIDATOR_WITHDRAWABILITY_DELAY*: uint64 = 2'u64^8 ##\
|
||||
## epochs (~27 hours)
|
||||
|
||||
SHARD_COMMITTEE_PERIOD*: uint64 = 256 # epochs (~27 hours)
|
||||
|
||||
MAX_EPOCHS_PER_CROSSLINK*: uint64 = 2'u64^6 ##\
|
||||
## epochs (~7 hours)
|
||||
|
||||
MIN_EPOCHS_TO_INACTIVITY_PENALTY*: uint64 = 2'u64^2 ##\
|
||||
## epochs (25.6 minutes)
|
||||
|
||||
# State vector lengths
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/mainnet/phase0.yaml#L108
|
||||
|
||||
EPOCHS_PER_HISTORICAL_VECTOR*: uint64 = 65536 ##\
|
||||
## epochs (~0.8 years)
|
||||
|
||||
EPOCHS_PER_SLASHINGS_VECTOR*: uint64 = 8192 ##\
|
||||
## epochs (~36 days)
|
||||
|
||||
HISTORICAL_ROOTS_LIMIT*: uint64 = 16777216 ##\
|
||||
## epochs (~26,131 years)
|
||||
|
||||
VALIDATOR_REGISTRY_LIMIT*: uint64 = 1099511627776'u64
|
||||
|
||||
# Reward and penalty quotients
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/mainnet/phase0.yaml#L120
|
||||
BASE_REWARD_FACTOR*: uint64 = 2'u64^6
|
||||
WHISTLEBLOWER_REWARD_QUOTIENT*: uint64 = 2'u64^9
|
||||
PROPOSER_REWARD_QUOTIENT*: uint64 = 2'u64^3
|
||||
INACTIVITY_PENALTY_QUOTIENT*: uint64 = 2'u64^24
|
||||
MIN_SLASHING_PENALTY_QUOTIENT*: uint64 = 32 # 2^5
|
||||
|
||||
# Max operations per block
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/mainnet/phase0.yaml#L134
|
||||
MAX_PROPOSER_SLASHINGS*: uint64 = 2'u64 ^ 4
|
||||
MAX_ATTESTER_SLASHINGS*: uint64 = 2'u64 ^ 1
|
||||
MAX_ATTESTATIONS*: uint64 = 2'u64 ^ 7
|
||||
MAX_DEPOSITS*: uint64 = 2'u64 ^ 4
|
||||
MAX_VOLUNTARY_EXITS*: uint64 = 2'u64 ^ 4
|
||||
|
||||
# Fork choice
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/mainnet/phase0.yaml#L32
|
||||
SAFE_SLOTS_TO_UPDATE_JUSTIFIED*: uint64 = 8 # 96 seconds
|
||||
|
||||
# Validators
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/mainnet/phase0.yaml#L38
|
||||
ETH1_FOLLOW_DISTANCE* {.intdefine.}: uint64 = 1024 # blocks ~ 4 hours
|
||||
TARGET_AGGREGATORS_PER_COMMITTEE*: uint64 = 16 # validators
|
||||
RANDOM_SUBNETS_PER_VALIDATOR*: uint64 = 1 # subnet
|
||||
EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION*: uint64 = 256 # epochs ~ 27 hours
|
||||
SECONDS_PER_ETH1_BLOCK* {.intdefine.}: uint64 = 14 # (estimate from Eth1 mainnet)
|
||||
|
||||
# Deposit contract
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/mainnet/phase0.yaml#L52
|
||||
|
||||
# Ethereum PoW Mainnet
|
||||
# TODO These violate the spec (this is a temporary change to allow `make medalla` to work)
|
||||
DEPOSIT_CHAIN_ID* = 5
|
||||
DEPOSIT_NETWORK_ID* = 5
|
|
@ -1,146 +0,0 @@
|
|||
# beacon_chain
|
||||
# Copyright (c) 2018-2020 Status Research & Development GmbH
|
||||
# Licensed and distributed under either of
|
||||
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
||||
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
||||
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
||||
|
||||
# This file contains constants that are part of the spec and thus subject to
|
||||
# serialization and spec updates.
|
||||
|
||||
import
|
||||
math
|
||||
|
||||
{.experimental: "codeReordering".} # SLOTS_PER_EPOCH is use before being defined in spec
|
||||
|
||||
const
|
||||
# Misc
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/minimal/phase0.yaml#L4
|
||||
|
||||
# Changed
|
||||
MAX_COMMITTEES_PER_SLOT*: uint64 = 4
|
||||
TARGET_COMMITTEE_SIZE*: uint64 = 4
|
||||
|
||||
# Unchanged
|
||||
MAX_VALIDATORS_PER_COMMITTEE*: uint64 = 2048
|
||||
MIN_PER_EPOCH_CHURN_LIMIT*: uint64 = 4
|
||||
CHURN_LIMIT_QUOTIENT*: uint64 = 2'u64 ^ 16
|
||||
|
||||
# Changed
|
||||
SHUFFLE_ROUND_COUNT*: uint64 = 10
|
||||
|
||||
# Unchanged
|
||||
HYSTERESIS_QUOTIENT*: uint64 = 4
|
||||
HYSTERESIS_DOWNWARD_MULTIPLIER*: uint64 = 1
|
||||
HYSTERESIS_UPWARD_MULTIPLIER*: uint64 = 5
|
||||
|
||||
# Gwei values
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/minimal/phase0.yaml#L61
|
||||
|
||||
# Changed
|
||||
ETH1_FOLLOW_DISTANCE* {.intdefine.}: uint64 = 16 # blocks
|
||||
|
||||
# Unchanged
|
||||
MIN_DEPOSIT_AMOUNT*: uint64 = 2'u64^0 * 10'u64^9
|
||||
MAX_EFFECTIVE_BALANCE*: uint64 = 2'u64^5 * 10'u64^9
|
||||
EJECTION_BALANCE*: uint64 = 2'u64^4 * 10'u64^9
|
||||
EFFECTIVE_BALANCE_INCREMENT*: uint64 = 2'u64^0 * 10'u64^9
|
||||
|
||||
# Initial values
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/minimal/phase0.yaml#L73
|
||||
|
||||
BLS_WITHDRAWAL_PREFIX*: byte = 0
|
||||
|
||||
# Time parameters
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/minimal/phase0.yaml#L80
|
||||
# Changed: Faster to spin up testnets, but does not give validator
|
||||
# reasonable warning time for genesis
|
||||
|
||||
# Unchanged
|
||||
SECONDS_PER_SLOT*{.intdefine.}: uint64 = 6
|
||||
|
||||
# Unchanged
|
||||
MIN_ATTESTATION_INCLUSION_DELAY*: uint64 = 1
|
||||
|
||||
# Changed
|
||||
SLOTS_PER_EPOCH* {.intdefine.}: uint64 = 8
|
||||
|
||||
# Unchanged
|
||||
MIN_SEED_LOOKAHEAD*: uint64 = 1
|
||||
MAX_SEED_LOOKAHEAD*: uint64 = 4
|
||||
|
||||
# Changed
|
||||
EPOCHS_PER_ETH1_VOTING_PERIOD*: uint64 = 4
|
||||
SLOTS_PER_HISTORICAL_ROOT*: uint64 = 64
|
||||
|
||||
# Unchanged
|
||||
MIN_VALIDATOR_WITHDRAWABILITY_DELAY*: uint64 = 2'u64^8
|
||||
|
||||
SHARD_COMMITTEE_PERIOD*: uint64 = 64 # epochs
|
||||
|
||||
# Unchanged
|
||||
MAX_EPOCHS_PER_CROSSLINK*: uint64 = 4
|
||||
|
||||
# Changed
|
||||
MIN_EPOCHS_TO_INACTIVITY_PENALTY*: uint64 = 2'u64^2
|
||||
|
||||
# State vector lengths
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/minimal/phase0.yaml#L108
|
||||
|
||||
# Changed
|
||||
EPOCHS_PER_HISTORICAL_VECTOR*: uint64 = 64
|
||||
EPOCHS_PER_SLASHINGS_VECTOR*: uint64 = 64
|
||||
|
||||
# Unchanged
|
||||
HISTORICAL_ROOTS_LIMIT*: uint64 = 16777216
|
||||
VALIDATOR_REGISTRY_LIMIT*: uint64 = 1099511627776'u64
|
||||
|
||||
# Reward and penalty quotients
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/minimal/phase0.yaml#L120
|
||||
|
||||
BASE_REWARD_FACTOR*: uint64 = 2'u64^6
|
||||
WHISTLEBLOWER_REWARD_QUOTIENT*: uint64 = 2'u64^9
|
||||
PROPOSER_REWARD_QUOTIENT*: uint64 = 2'u64^3
|
||||
INACTIVITY_PENALTY_QUOTIENT*: uint64 = 2'u64^24
|
||||
MIN_SLASHING_PENALTY_QUOTIENT*: uint64 = 32 # 2^5
|
||||
|
||||
# Max operations per block
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/minimal/phase0.yaml#L134
|
||||
|
||||
MAX_PROPOSER_SLASHINGS*: uint64 = 2'u64 ^ 4
|
||||
MAX_ATTESTER_SLASHINGS*: uint64 = 2'u64 ^ 1
|
||||
MAX_ATTESTATIONS*: uint64 = 2'u64 ^ 7
|
||||
MAX_DEPOSITS*: uint64 = 2'u64 ^ 4
|
||||
MAX_VOLUNTARY_EXITS*: uint64 = 2'u64 ^ 4
|
||||
|
||||
# Deposit contract
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/minimal/phase0.yaml#L52
|
||||
|
||||
# Ethereum Goerli testnet
|
||||
DEPOSIT_CHAIN_ID* = 5
|
||||
DEPOSIT_NETWORK_ID* = 5
|
||||
|
||||
# Fork choice
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/minimal/phase0.yaml#L32
|
||||
|
||||
# Changed
|
||||
SAFE_SLOTS_TO_UPDATE_JUSTIFIED*: uint64 = 2
|
||||
|
||||
# Validators
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/minimal/phase0.yaml#L38
|
||||
|
||||
# Unchanged
|
||||
TARGET_AGGREGATORS_PER_COMMITTEE*: uint64 = 16 # validators
|
||||
RANDOM_SUBNETS_PER_VALIDATOR*: uint64 = 1 # subnet
|
||||
EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION*: uint64 = 256 # epochs ~ 27 hours
|
||||
SECONDS_PER_ETH1_BLOCK* {.intdefine.}: uint64 = 14 # estimate from Eth1 mainnet)
|
|
@ -16,7 +16,8 @@ import
|
|||
const
|
||||
# Misc
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/mainnet/phase0.yaml#L6
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/mainnet/phase0.yaml#L6
|
||||
CONFIG_NAME* = "mainnet"
|
||||
|
||||
MAX_COMMITTEES_PER_SLOT* {.intdefine.}: uint64 = 64
|
||||
|
||||
|
@ -42,11 +43,11 @@ const
|
|||
HYSTERESIS_DOWNWARD_MULTIPLIER*: uint64 = 1
|
||||
HYSTERESIS_UPWARD_MULTIPLIER*: uint64 = 5
|
||||
|
||||
PROPORTIONAL_SLASHING_MULTIPLIER* = 3
|
||||
PROPORTIONAL_SLASHING_MULTIPLIER*: uint64 = 3
|
||||
|
||||
# Gwei values
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/mainnet/phase0.yaml#L61
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/mainnet/phase0.yaml#L61
|
||||
|
||||
MIN_DEPOSIT_AMOUNT*: uint64 = 2'u64^0 * 10'u64^9 ##\
|
||||
## Minimum amounth of ETH that can be deposited in one call - deposits can
|
||||
|
@ -63,12 +64,12 @@ const
|
|||
|
||||
# Initial values
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/mainnet/phase0.yaml#L73
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/mainnet/phase0.yaml#L73
|
||||
BLS_WITHDRAWAL_PREFIX*: byte = 0
|
||||
|
||||
# Time parameters
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/mainnet/phase0.yaml#L80
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/mainnet/phase0.yaml#L80
|
||||
SECONDS_PER_SLOT* {.intdefine.}: uint64 = 12'u64 # Compile with -d:SECONDS_PER_SLOT=1 for 12x faster slots
|
||||
## TODO consistent time unit across projects, similar to C++ chrono?
|
||||
|
||||
|
@ -107,15 +108,12 @@ const
|
|||
|
||||
SHARD_COMMITTEE_PERIOD*: uint64 = 256 # epochs (~27 hours)
|
||||
|
||||
MAX_EPOCHS_PER_CROSSLINK*: uint64 = 2'u64^6 ##\
|
||||
## epochs (~7 hours)
|
||||
|
||||
MIN_EPOCHS_TO_INACTIVITY_PENALTY*: uint64 = 2'u64^2 ##\
|
||||
## epochs (25.6 minutes)
|
||||
|
||||
# State vector lengths
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/mainnet/phase0.yaml#L108
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/mainnet/phase0.yaml#L108
|
||||
|
||||
EPOCHS_PER_HISTORICAL_VECTOR*: uint64 = 65536 ##\
|
||||
## epochs (~0.8 years)
|
||||
|
@ -130,7 +128,7 @@ const
|
|||
|
||||
# Reward and penalty quotients
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/mainnet/phase0.yaml#L120
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/mainnet/phase0.yaml#L120
|
||||
BASE_REWARD_FACTOR*: uint64 = 2'u64^6
|
||||
WHISTLEBLOWER_REWARD_QUOTIENT*: uint64 = 2'u64^9
|
||||
PROPOSER_REWARD_QUOTIENT*: uint64 = 2'u64^3
|
||||
|
@ -139,7 +137,7 @@ const
|
|||
|
||||
# Max operations per block
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/mainnet/phase0.yaml#L134
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/mainnet/phase0.yaml#L134
|
||||
MAX_PROPOSER_SLASHINGS*: uint64 = 2'u64 ^ 4
|
||||
MAX_ATTESTER_SLASHINGS*: uint64 = 2'u64 ^ 1
|
||||
MAX_ATTESTATIONS*: uint64 = 2'u64 ^ 7
|
||||
|
@ -148,12 +146,12 @@ const
|
|||
|
||||
# Fork choice
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/mainnet/phase0.yaml#L32
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/mainnet/phase0.yaml#L32
|
||||
SAFE_SLOTS_TO_UPDATE_JUSTIFIED*: uint64 = 8 # 96 seconds
|
||||
|
||||
# Validators
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/mainnet/phase0.yaml#L38
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/mainnet/phase0.yaml#L38
|
||||
ETH1_FOLLOW_DISTANCE* {.intdefine.}: uint64 = 1024 # blocks ~ 4 hours
|
||||
TARGET_AGGREGATORS_PER_COMMITTEE*: uint64 = 16 # validators
|
||||
RANDOM_SUBNETS_PER_VALIDATOR*: uint64 = 1 # subnet
|
||||
|
@ -162,7 +160,7 @@ const
|
|||
|
||||
# Deposit contract
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/mainnet/phase0.yaml#L52
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/mainnet/phase0.yaml#L52
|
||||
|
||||
# Ethereum PoW Mainnet
|
||||
# TODO These violate the spec (this is a temporary change to allow `make medalla` to work)
|
||||
|
|
|
@ -16,7 +16,8 @@ import
|
|||
const
|
||||
# Misc
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/minimal/phase0.yaml#L4
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/minimal/phase0.yaml#L4
|
||||
CONFIG_NAME* = "minimal"
|
||||
|
||||
# Changed
|
||||
MAX_COMMITTEES_PER_SLOT*: uint64 = 4
|
||||
|
@ -35,11 +36,11 @@ const
|
|||
HYSTERESIS_DOWNWARD_MULTIPLIER*: uint64 = 1
|
||||
HYSTERESIS_UPWARD_MULTIPLIER*: uint64 = 5
|
||||
|
||||
PROPORTIONAL_SLASHING_MULTIPLIER* = 3
|
||||
PROPORTIONAL_SLASHING_MULTIPLIER*: uint64 = 3
|
||||
|
||||
# Gwei values
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/minimal/phase0.yaml#L61
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/minimal/phase0.yaml#L61
|
||||
|
||||
# Changed
|
||||
ETH1_FOLLOW_DISTANCE* {.intdefine.}: uint64 = 16 # blocks
|
||||
|
@ -52,13 +53,13 @@ const
|
|||
|
||||
# Initial values
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/minimal/phase0.yaml#L73
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/minimal/phase0.yaml#L73
|
||||
|
||||
BLS_WITHDRAWAL_PREFIX*: byte = 0
|
||||
|
||||
# Time parameters
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/minimal/phase0.yaml#L80
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/minimal/phase0.yaml#L80
|
||||
# Changed: Faster to spin up testnets, but does not give validator
|
||||
# reasonable warning time for genesis
|
||||
|
||||
|
@ -84,15 +85,12 @@ const
|
|||
|
||||
SHARD_COMMITTEE_PERIOD*: uint64 = 64 # epochs
|
||||
|
||||
# Unchanged
|
||||
MAX_EPOCHS_PER_CROSSLINK*: uint64 = 4
|
||||
|
||||
# Changed
|
||||
MIN_EPOCHS_TO_INACTIVITY_PENALTY*: uint64 = 2'u64^2
|
||||
|
||||
# State vector lengths
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/minimal/phase0.yaml#L108
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/minimal/phase0.yaml#L108
|
||||
|
||||
# Changed
|
||||
EPOCHS_PER_HISTORICAL_VECTOR*: uint64 = 64
|
||||
|
@ -104,7 +102,7 @@ const
|
|||
|
||||
# Reward and penalty quotients
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/minimal/phase0.yaml#L120
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/minimal/phase0.yaml#L120
|
||||
|
||||
BASE_REWARD_FACTOR*: uint64 = 2'u64^6
|
||||
WHISTLEBLOWER_REWARD_QUOTIENT*: uint64 = 2'u64^9
|
||||
|
@ -114,7 +112,7 @@ const
|
|||
|
||||
# Max operations per block
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/minimal/phase0.yaml#L134
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/minimal/phase0.yaml#L134
|
||||
|
||||
MAX_PROPOSER_SLASHINGS*: uint64 = 2'u64 ^ 4
|
||||
MAX_ATTESTER_SLASHINGS*: uint64 = 2'u64 ^ 1
|
||||
|
@ -124,7 +122,7 @@ const
|
|||
|
||||
# Deposit contract
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/minimal/phase0.yaml#L52
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/minimal/phase0.yaml#L52
|
||||
|
||||
# Ethereum Goerli testnet
|
||||
DEPOSIT_CHAIN_ID* = 5
|
||||
|
@ -132,14 +130,14 @@ const
|
|||
|
||||
# Fork choice
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/minimal/phase0.yaml#L32
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/minimal/phase0.yaml#L32
|
||||
|
||||
# Changed
|
||||
SAFE_SLOTS_TO_UPDATE_JUSTIFIED*: uint64 = 2
|
||||
|
||||
# Validators
|
||||
# ---------------------------------------------------------------
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/configs/minimal/phase0.yaml#L38
|
||||
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.3/configs/minimal/phase0.yaml#L38
|
||||
|
||||
# Unchanged
|
||||
TARGET_AGGREGATORS_PER_COMMITTEE*: uint64 = 16 # validators
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")/../.."
|
||||
|
||||
GROUP=0
|
||||
TOTAL=$(ls -d ../nimbus-private/altona_deposits/validators/* | wc -l)
|
||||
#echo "TOTAL=${TOTAL}"
|
||||
PER_GROUP=$((TOTAL / 4))
|
||||
#echo "PER_GROUP=${PER_GROUP}"
|
||||
for N in $(seq 6 9); do
|
||||
ssh node-0${N}.aws-eu-central-1a.nimbus.test.statusim.net "sudo rm -rf /docker/beacon-node-testnet2-1/data/nim-beacon-chain/build/data/shared_altona_0/secrets"
|
||||
ssh node-0${N}.aws-eu-central-1a.nimbus.test.statusim.net "sudo rm -rf /docker/beacon-node-testnet2-1/data/nim-beacon-chain/build/data/shared_altona_0/validators"
|
||||
#echo GROUP="${GROUP}"
|
||||
for TARGET in "validators" "secrets"; do
|
||||
DIR_NO=0
|
||||
ls -d ../nimbus-private/altona_deposits/${TARGET}/* | while read DIR; do
|
||||
if [[ $DIR_NO -ge $((GROUP * PER_GROUP)) && $DIR_NO -lt $(( (GROUP + 1) * PER_GROUP )) ]]; then
|
||||
#echo "DIR_NO=${DIR_NO}"
|
||||
#echo "$DIR"
|
||||
rsync -a -zz --rsync-path="sudo rsync" "$DIR" node-0${N}.aws-eu-central-1a.nimbus.test.statusim.net:/docker/beacon-node-testnet2-1/data/nim-beacon-chain/build/data/shared_altona_0/${TARGET}/
|
||||
fi
|
||||
DIR_NO=$((DIR_NO + 1))
|
||||
done
|
||||
done
|
||||
GROUP=$((GROUP + 1))
|
||||
|
||||
ssh node-0${N}.aws-eu-central-1a.nimbus.test.statusim.net "sudo chown -R dockremap:dockremap /docker/beacon-node-testnet2-1/data/nim-beacon-chain/build/data/shared_altona_0/secrets"
|
||||
ssh node-0${N}.aws-eu-central-1a.nimbus.test.statusim.net "sudo chown -R dockremap:dockremap /docker/beacon-node-testnet2-1/data/nim-beacon-chain/build/data/shared_altona_0/validators"
|
||||
done
|
||||
|
|
@ -17,7 +17,7 @@ OPTS="h"
|
|||
LONGOPTS="help,network:,build,run"
|
||||
|
||||
# default values
|
||||
NETWORK="altona"
|
||||
NETWORK="medalla"
|
||||
BUILD=0
|
||||
RUN=0
|
||||
|
||||
|
|
|
@ -9,19 +9,19 @@ cd "$(dirname "${BASH_SOURCE[0]}")/../.."
|
|||
|
||||
[[ -z "$1" ]] && { echo "Usage: $(basename $0) YOUR_ETH1_PRIVATE_GOERLI_KEY"; exit 1; }
|
||||
|
||||
echo -ne "About to delete \"build/data/shared_witti_0\".\nMake a backup, if you need to, then press Enter. >"
|
||||
echo -ne "About to delete \"build/data/shared_medalla_0\".\nMake a backup, if you need to, then press Enter. >"
|
||||
read TMP
|
||||
make clean-altona
|
||||
make clean-medalla
|
||||
make beacon_node
|
||||
|
||||
for N in $(seq 6 9); do
|
||||
build/beacon_node deposits create --deposit-private-key=$1 --dont-send && \
|
||||
ssh node-0${N}.aws-eu-central-1a.nimbus.test.statusim.net "sudo rm -rf /docker/beacon-node-testnet2-1/data/nim-beacon-chain/build/data/shared_witti_0/secrets" && \
|
||||
ssh node-0${N}.aws-eu-central-1a.nimbus.test.statusim.net "sudo rm -rf /docker/beacon-node-testnet2-1/data/nim-beacon-chain/build/data/shared_witti_0/validators" && \
|
||||
rsync -a -zz --rsync-path="sudo rsync" build/data/shared_witti_0/{secrets,validators} node-0${N}.aws-eu-central-1a.nimbus.test.statusim.net:/docker/beacon-node-testnet2-1/data/nim-beacon-chain/build/data/shared_witti_0/ && \
|
||||
ssh node-0${N}.aws-eu-central-1a.nimbus.test.statusim.net "sudo chown -R dockremap:dockremap /docker/beacon-node-testnet2-1/data/nim-beacon-chain/build/data/shared_witti_0/secrets" && \
|
||||
ssh node-0${N}.aws-eu-central-1a.nimbus.test.statusim.net "sudo chown -R dockremap:dockremap /docker/beacon-node-testnet2-1/data/nim-beacon-chain/build/data/shared_witti_0/validators"
|
||||
rm -rf build/data/shared_witti_0/{secrets,validators}
|
||||
ssh node-0${N}.aws-eu-central-1a.nimbus.test.statusim.net "sudo rm -rf /docker/beacon-node-testnet2-1/data/nim-beacon-chain/build/data/shared_medalla_0/secrets" && \
|
||||
ssh node-0${N}.aws-eu-central-1a.nimbus.test.statusim.net "sudo rm -rf /docker/beacon-node-testnet2-1/data/nim-beacon-chain/build/data/shared_medalla_0/validators" && \
|
||||
rsync -a -zz --rsync-path="sudo rsync" build/data/shared_medalla_0/{secrets,validators} node-0${N}.aws-eu-central-1a.nimbus.test.statusim.net:/docker/beacon-node-testnet2-1/data/nim-beacon-chain/build/data/shared_medalla_0/ && \
|
||||
ssh node-0${N}.aws-eu-central-1a.nimbus.test.statusim.net "sudo chown -R dockremap:dockremap /docker/beacon-node-testnet2-1/data/nim-beacon-chain/build/data/shared_medalla_0/secrets" && \
|
||||
ssh node-0${N}.aws-eu-central-1a.nimbus.test.statusim.net "sudo chown -R dockremap:dockremap /docker/beacon-node-testnet2-1/data/nim-beacon-chain/build/data/shared_medalla_0/validators"
|
||||
rm -rf build/data/shared_medalla_0/{secrets,validators}
|
||||
# if we're doing it too fast, we get {"code":-32000,"message":"replacement transaction underpriced"}
|
||||
# or {"code":-32000,"message":"nonce too low"}
|
||||
echo "Sleeping..."
|
||||
|
|
|
@ -12,10 +12,10 @@ There is currently no eth2 mainnet - all networks are testnets.
|
|||
|
||||
Though Nimbus can connect to any of the testnets published in the [eth2-clients/eth2-testnets repo](https://github.com/eth2-clients/eth2-testnets/tree/master/nimbus), below are the recommended ones:
|
||||
|
||||
- Multi-client Testnet: [altona](https://github.com/goerli/altona) ([explorer](https://altona.beaconcha.in))
|
||||
- Multi-client Testnet: [medalla](https://github.com/goerli/medalla) ([explorer](https://medalla.beaconcha.in))
|
||||
- Nimbus Testnet: testnet0 (experimental, not always active)
|
||||
|
||||
## Altona
|
||||
## Medalla
|
||||
|
||||
### Initial setup
|
||||
|
||||
|
@ -26,7 +26,7 @@ Before we start, we have to obtain 32 ETH on the Goerli testnet (later on, we'll
|
|||
3. Post your account address on a social media platform (Twitter or Facebook). Copy the url to the post.
|
||||
4. Paste your post url on the [Goerli faucet](https://faucet.goerli.mudit.blog/) and select `Give me Ether > 37.5 Ethers` from the top right corner of the page.
|
||||
5. Wait for a few seconds and return to your MetaMask wallet to check if you have successfully received the ETH.
|
||||
6. Once the [prerequisites](./install.md) are installed, you can connect to the altona testnet with the following commands: <br>
|
||||
6. Once the [prerequisites](./install.md) are installed, you can connect to the medalla testnet with the following commands: <br>
|
||||
|
||||
- **_Remember to replace `make` with `mingw32-make` if using Windows._**
|
||||
|
||||
|
@ -36,8 +36,8 @@ cd nim-beacon-chain
|
|||
git checkout devel
|
||||
git pull
|
||||
make update
|
||||
make altona # This will build Nimbus and all other dependencies
|
||||
# and connect you to altona
|
||||
make medalla # This will build Nimbus and all other dependencies
|
||||
# and connect you to medalla
|
||||
```
|
||||
|
||||
_Once Nimbus has finished building, you will be prompted to enter the private key of the account you want to deposit the 32 ETH from._
|
||||
|
@ -65,8 +65,8 @@ _Once Nimbus has finished building, you will be prompted to enter the private ke
|
|||
9. Press enter and wait for a few seconds until you see *Deposit sent*.
|
||||
|
||||
```
|
||||
INF 2020-07-05 12:58:25+02:00 Generating deposits ... validatorsDir=/Users/sssaintleger/nim-beacon-chain/build/data/shared_altona_0/validators ...
|
||||
INF 2020-07-05 12:58:25+02:00 Sending deposits ... DepositContract=0x16e82D77882A663454Ef92806b7DeCa1D394810f ...
|
||||
INF 2020-07-05 12:58:25+02:00 Generating deposits ... validatorsDir=/Users/sssaintleger/nim-beacon-chain/build/data/shared_medalla_0/validators ...
|
||||
INF 2020-07-05 12:58:25+02:00 Sending deposits ... DepositContract=0x07b39F4fDE4A38bACe212b546dAc87C58DfE3fDC ...
|
||||
INF 2020-07-05 12:58:26+02:00 Deposit sent ... status=0x5455b1faf773a535668bdd4ade6b03f6cfd52f88414a5ad74bbdfdfd89f28b86
|
||||
|
||||
Deposit sent, wait for confirmation then press enter to continue
|
||||
|
@ -78,7 +78,7 @@ Deposit sent, wait for confirmation then press enter to continue
|
|||
|
||||
<img src="./img/deposit-transaction-details.png" alt="" style="margin: 0 40 0 40"/>
|
||||
|
||||
> Note: it should take approximately 8 hours for your deposit to be processed by the beacon chain. To keep track of the status of your validator you should go to [https://altona.beaconcha.in/validators/eth1deposits/[Validator PubKey]](https://altona.beaconcha.in/validators/eth1deposits), replacing [Validator PubKey] with your actual Validator PubKey -- you can find this in the etherscan transaction details (for example, in the image above the Validator PubKey is `0x95aa...`).
|
||||
> Note: it should take approximately 8 hours for your deposit to be processed by the beacon chain. To keep track of the status of your validator you should go to [https://medalla.beaconcha.in/validators/eth1deposits/[Validator PubKey]](https://medalla.beaconcha.in/validators/eth1deposits), replacing [Validator PubKey] with your actual Validator PubKey -- you can find this in the etherscan transaction details (for example, in the image above the Validator PubKey is `0x95aa...`).
|
||||
|
||||
And voila! That's all there is to it :)
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit af0d84455faa43cadbb8e4fc9c37eb7ace6a552d
|
||||
Subproject commit 3a50f99abdcc8303096b4973b61712b6de37bfb0
|
Loading…
Reference in New Issue