Mainnet deposit contract monitoring

This commit is contained in:
Zahary Karadjov 2020-11-06 00:33:31 +02:00 committed by zah
parent c7d8b81c86
commit f596a24c4c
8 changed files with 30 additions and 10 deletions

View File

@ -116,7 +116,7 @@ OK: 3/3 Fail: 0/3 Skip: 0/3
+ DOMAIN_VOLUNTARY_EXIT "0x04000000" [Preset: mainnet] OK
+ EFFECTIVE_BALANCE_INCREMENT 1000000000 [Preset: mainnet] OK
+ EJECTION_BALANCE 16000000000 [Preset: mainnet] OK
+ EPOCHS_PER_ETH1_VOTING_PERIOD 32 [Preset: mainnet] OK
+ EPOCHS_PER_ETH1_VOTING_PERIOD 64 [Preset: mainnet] OK
+ EPOCHS_PER_HISTORICAL_VECTOR 65536 [Preset: mainnet] OK
+ EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION 256 [Preset: mainnet] OK
+ EPOCHS_PER_SLASHINGS_VECTOR 8192 [Preset: mainnet] OK

View File

@ -1034,6 +1034,13 @@ programMain:
config.depositContractDeployedAt = some metadata.depositContractDeployedAt
else:
config.runtimePreset = defaultRuntimePreset
when const_preset == "mainnet":
if config.depositContractAddress.isNone:
config.depositContractAddress =
some mainnetMetadata.depositContractAddress
if config.depositContractDeployedAt.isNone:
config.depositContractDeployedAt =
some mainnetMetadata.depositContractDeployedAt
# Single RNG instance for the application - will be seeded on construction
# and avoid using system resources (such as urandom) after that

View File

@ -359,6 +359,7 @@ proc init*(T: type Eth1Monitor,
depositContractDeployedAt: string): Future[Result[T, string]] {.async.} =
let web3 = try: await newWeb3(web3Url)
except CatchableError as err:
debugEcho err.msg
return err "Failed to setup web3 connection"
let
ns = web3.contractSender(DepositContract, depositContractAddress)
@ -489,7 +490,7 @@ proc waitGenesis*(m: Eth1Monitor): Future[BeaconStateRef] {.async.} =
if m.genesisStateFut.isNil:
m.genesisStateFut = newFuture[void]("waitGenesis")
info "Waiting genesis state"
info "Awaiting genesis event"
await m.genesisStateFut
m.genesisStateFut = nil

View File

@ -146,10 +146,10 @@ const
# that there are no constant overrides
eth1Network: some mainnet,
runtimePreset: mainnetRuntimePreset,
# TODO The values below are just placeholders for now
# TODO Add bootstrap nodes for mainnet
bootstrapNodes: @[],
depositContractAddress: Eth1Address.fromHex "0x1234567890123456789012345678901234567890",
depositContractDeployedAt: "0",
depositContractAddress: Eth1Address.fromHex "0x00000000219ab540356cBB839Cbe05303d7705Fa",
depositContractDeployedAt: "11052984",
genesisData: "")
else:
Eth2NetworkMetadata(

View File

@ -128,10 +128,10 @@ static: doAssert: ETH2_SPEC == "v0.12.3" or ETH2_SPEC == "v1.0.0"
when ETH2_SPEC == "v0.12.3":
const mainnetRuntimePreset* = RuntimePreset(
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 16384,
MIN_GENESIS_TIME: 1578009600,
MIN_GENESIS_TIME: 1606824000, # Dec 1, 2020, 12pm UTC
GENESIS_FORK_VERSION: Version [byte 0, 0, 0, 0],
GENESIS_DELAY: 172800,
ETH1_FOLLOW_DISTANCE: 1024)
GENESIS_DELAY: 604800,
ETH1_FOLLOW_DISTANCE: 2048)
else:
const mainnetRuntimePreset* = RuntimePreset(
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 16384,

View File

@ -138,7 +138,7 @@ const
WHISTLEBLOWER_REWARD_QUOTIENT*: uint64 = 2'u64^9
PROPOSER_REWARD_QUOTIENT*: uint64 = 2'u64^3
INACTIVITY_PENALTY_QUOTIENT*: uint64 = 2'u64^26
MIN_SLASHING_PENALTY_QUOTIENT*: uint64 = 128 # 2^5
MIN_SLASHING_PENALTY_QUOTIENT*: uint64 = 128 # 2^7
PROPORTIONAL_SLASHING_MULTIPLIER*: uint64 = 1
# Max operations per block

View File

@ -109,7 +109,7 @@ const
WHISTLEBLOWER_REWARD_QUOTIENT*: uint64 = 2'u64^9
PROPOSER_REWARD_QUOTIENT*: uint64 = 2'u64^3
INACTIVITY_PENALTY_QUOTIENT*: uint64 = 2'u64^25
MIN_SLASHING_PENALTY_QUOTIENT*: uint64 = 64 # 2^5
MIN_SLASHING_PENALTY_QUOTIENT*: uint64 = 64 # 2^6
PROPORTIONAL_SLASHING_MULTIPLIER*: uint64 = 2
# Max operations per block

12
run-mainnet-beacon-node.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
if [[ "$WEB3_URL" == "" ]]; then
echo -n "Please enter a Web3 provider URL: "
read WEB3_URL
fi
build/beacon_node \
--data-dir=build/data/mainnet \
--web3-url="${WEB3_URL}" \
$@