Mainnet deposit contract monitoring
This commit is contained in:
parent
c7d8b81c86
commit
f596a24c4c
|
@ -116,7 +116,7 @@ OK: 3/3 Fail: 0/3 Skip: 0/3
|
||||||
+ DOMAIN_VOLUNTARY_EXIT "0x04000000" [Preset: mainnet] OK
|
+ DOMAIN_VOLUNTARY_EXIT "0x04000000" [Preset: mainnet] OK
|
||||||
+ EFFECTIVE_BALANCE_INCREMENT 1000000000 [Preset: mainnet] OK
|
+ EFFECTIVE_BALANCE_INCREMENT 1000000000 [Preset: mainnet] OK
|
||||||
+ EJECTION_BALANCE 16000000000 [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_HISTORICAL_VECTOR 65536 [Preset: mainnet] OK
|
||||||
+ EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION 256 [Preset: mainnet] OK
|
+ EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION 256 [Preset: mainnet] OK
|
||||||
+ EPOCHS_PER_SLASHINGS_VECTOR 8192 [Preset: mainnet] OK
|
+ EPOCHS_PER_SLASHINGS_VECTOR 8192 [Preset: mainnet] OK
|
||||||
|
|
|
@ -1034,6 +1034,13 @@ programMain:
|
||||||
config.depositContractDeployedAt = some metadata.depositContractDeployedAt
|
config.depositContractDeployedAt = some metadata.depositContractDeployedAt
|
||||||
else:
|
else:
|
||||||
config.runtimePreset = defaultRuntimePreset
|
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
|
# Single RNG instance for the application - will be seeded on construction
|
||||||
# and avoid using system resources (such as urandom) after that
|
# and avoid using system resources (such as urandom) after that
|
||||||
|
|
|
@ -359,6 +359,7 @@ proc init*(T: type Eth1Monitor,
|
||||||
depositContractDeployedAt: string): Future[Result[T, string]] {.async.} =
|
depositContractDeployedAt: string): Future[Result[T, string]] {.async.} =
|
||||||
let web3 = try: await newWeb3(web3Url)
|
let web3 = try: await newWeb3(web3Url)
|
||||||
except CatchableError as err:
|
except CatchableError as err:
|
||||||
|
debugEcho err.msg
|
||||||
return err "Failed to setup web3 connection"
|
return err "Failed to setup web3 connection"
|
||||||
let
|
let
|
||||||
ns = web3.contractSender(DepositContract, depositContractAddress)
|
ns = web3.contractSender(DepositContract, depositContractAddress)
|
||||||
|
@ -489,7 +490,7 @@ proc waitGenesis*(m: Eth1Monitor): Future[BeaconStateRef] {.async.} =
|
||||||
if m.genesisStateFut.isNil:
|
if m.genesisStateFut.isNil:
|
||||||
m.genesisStateFut = newFuture[void]("waitGenesis")
|
m.genesisStateFut = newFuture[void]("waitGenesis")
|
||||||
|
|
||||||
info "Waiting genesis state"
|
info "Awaiting genesis event"
|
||||||
await m.genesisStateFut
|
await m.genesisStateFut
|
||||||
m.genesisStateFut = nil
|
m.genesisStateFut = nil
|
||||||
|
|
||||||
|
|
|
@ -146,10 +146,10 @@ const
|
||||||
# that there are no constant overrides
|
# that there are no constant overrides
|
||||||
eth1Network: some mainnet,
|
eth1Network: some mainnet,
|
||||||
runtimePreset: mainnetRuntimePreset,
|
runtimePreset: mainnetRuntimePreset,
|
||||||
# TODO The values below are just placeholders for now
|
# TODO Add bootstrap nodes for mainnet
|
||||||
bootstrapNodes: @[],
|
bootstrapNodes: @[],
|
||||||
depositContractAddress: Eth1Address.fromHex "0x1234567890123456789012345678901234567890",
|
depositContractAddress: Eth1Address.fromHex "0x00000000219ab540356cBB839Cbe05303d7705Fa",
|
||||||
depositContractDeployedAt: "0",
|
depositContractDeployedAt: "11052984",
|
||||||
genesisData: "")
|
genesisData: "")
|
||||||
else:
|
else:
|
||||||
Eth2NetworkMetadata(
|
Eth2NetworkMetadata(
|
||||||
|
|
|
@ -128,10 +128,10 @@ static: doAssert: ETH2_SPEC == "v0.12.3" or ETH2_SPEC == "v1.0.0"
|
||||||
when ETH2_SPEC == "v0.12.3":
|
when ETH2_SPEC == "v0.12.3":
|
||||||
const mainnetRuntimePreset* = RuntimePreset(
|
const mainnetRuntimePreset* = RuntimePreset(
|
||||||
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 16384,
|
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_FORK_VERSION: Version [byte 0, 0, 0, 0],
|
||||||
GENESIS_DELAY: 172800,
|
GENESIS_DELAY: 604800,
|
||||||
ETH1_FOLLOW_DISTANCE: 1024)
|
ETH1_FOLLOW_DISTANCE: 2048)
|
||||||
else:
|
else:
|
||||||
const mainnetRuntimePreset* = RuntimePreset(
|
const mainnetRuntimePreset* = RuntimePreset(
|
||||||
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 16384,
|
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 16384,
|
||||||
|
|
|
@ -138,7 +138,7 @@ const
|
||||||
WHISTLEBLOWER_REWARD_QUOTIENT*: uint64 = 2'u64^9
|
WHISTLEBLOWER_REWARD_QUOTIENT*: uint64 = 2'u64^9
|
||||||
PROPOSER_REWARD_QUOTIENT*: uint64 = 2'u64^3
|
PROPOSER_REWARD_QUOTIENT*: uint64 = 2'u64^3
|
||||||
INACTIVITY_PENALTY_QUOTIENT*: uint64 = 2'u64^26
|
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
|
PROPORTIONAL_SLASHING_MULTIPLIER*: uint64 = 1
|
||||||
|
|
||||||
# Max operations per block
|
# Max operations per block
|
||||||
|
|
|
@ -109,7 +109,7 @@ const
|
||||||
WHISTLEBLOWER_REWARD_QUOTIENT*: uint64 = 2'u64^9
|
WHISTLEBLOWER_REWARD_QUOTIENT*: uint64 = 2'u64^9
|
||||||
PROPOSER_REWARD_QUOTIENT*: uint64 = 2'u64^3
|
PROPOSER_REWARD_QUOTIENT*: uint64 = 2'u64^3
|
||||||
INACTIVITY_PENALTY_QUOTIENT*: uint64 = 2'u64^25
|
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
|
PROPORTIONAL_SLASHING_MULTIPLIER*: uint64 = 2
|
||||||
|
|
||||||
# Max operations per block
|
# Max operations per block
|
||||||
|
|
|
@ -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}" \
|
||||||
|
$@
|
||||||
|
|
Loading…
Reference in New Issue