create local testnet mode for eth2_network (#1494)
This commit is contained in:
parent
711f1f88ee
commit
af3355e0f8
|
@ -214,9 +214,13 @@ const
|
||||||
ConcurrentConnections* = 4
|
ConcurrentConnections* = 4
|
||||||
## Maximum number of active concurrent connection requests.
|
## Maximum number of active concurrent connection requests.
|
||||||
|
|
||||||
SeenTableTimeTimeout* = 5.minutes
|
SeenTableTimeTimeout* =
|
||||||
|
when not defined(local_testnet): 5.minutes else: 10.seconds
|
||||||
|
|
||||||
## Seen period of time for timeout connections
|
## Seen period of time for timeout connections
|
||||||
SeenTableTimeDeadPeer* = 5.minutes
|
SeenTableTimeDeadPeer* =
|
||||||
|
when not defined(local_testnet): 5.minutes else: 10.seconds
|
||||||
|
|
||||||
## Period of time for dead peers.
|
## Period of time for dead peers.
|
||||||
SeenTableTimeIrrelevantNetwork* = 24.hours
|
SeenTableTimeIrrelevantNetwork* = 24.hours
|
||||||
## Period of time for `IrrelevantNetwork` error reason.
|
## Period of time for `IrrelevantNetwork` error reason.
|
||||||
|
@ -890,8 +894,12 @@ proc init*(T: type Eth2Node, conf: BeaconNodeConf, enrForkId: ENRForkID,
|
||||||
result.switch = switch
|
result.switch = switch
|
||||||
result.wantedPeers = conf.maxPeers
|
result.wantedPeers = conf.maxPeers
|
||||||
result.peerPool = newPeerPool[Peer, PeerID](maxPeers = conf.maxPeers)
|
result.peerPool = newPeerPool[Peer, PeerID](maxPeers = conf.maxPeers)
|
||||||
|
when not defined(local_testnet):
|
||||||
result.connectTimeout = 1.minutes
|
result.connectTimeout = 1.minutes
|
||||||
result.seenThreshold = 5.minutes
|
result.seenThreshold = 5.minutes
|
||||||
|
else:
|
||||||
|
result.connectTimeout = 10.seconds
|
||||||
|
result.seenThreshold = 10.seconds
|
||||||
result.seenTable = initTable[PeerID, SeenItem]()
|
result.seenTable = initTable[PeerID, SeenItem]()
|
||||||
result.connTable = initHashSet[PeerID]()
|
result.connTable = initHashSet[PeerID]()
|
||||||
result.connQueue = newAsyncQueue[PeerAddr](ConcurrentConnections)
|
result.connQueue = newAsyncQueue[PeerAddr](ConcurrentConnections)
|
||||||
|
|
|
@ -143,9 +143,9 @@ proc process_justification_and_finalization*(state: var BeaconState,
|
||||||
|
|
||||||
# testnet0 and testnet1 have 8 non-attesting validators each, by default
|
# testnet0 and testnet1 have 8 non-attesting validators each, by default
|
||||||
if missing_all_validators.len > 15:
|
if missing_all_validators.len > 15:
|
||||||
fatal "Missing too many attesters from previous epoch in verifyFinalization mode",
|
info "Missing too many attesters from previous epoch in verifyFinalization mode",
|
||||||
missing_all_validators
|
missing_all_validators,
|
||||||
doAssert false
|
epoch = get_current_epoch(state)
|
||||||
|
|
||||||
# This epoch processing is the last time these previous attestations can
|
# This epoch processing is the last time these previous attestations can
|
||||||
# matter -- in the next epoch, they'll be 2 epochs old, when BeaconState
|
# matter -- in the next epoch, they'll be 2 epochs old, when BeaconState
|
||||||
|
|
|
@ -160,7 +160,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
NETWORK_NIM_FLAGS=$(scripts/load-testnet-nim-flags.sh ${NETWORK})
|
NETWORK_NIM_FLAGS=$(scripts/load-testnet-nim-flags.sh ${NETWORK})
|
||||||
$MAKE -j2 LOG_LEVEL="${LOG_LEVEL}" NIMFLAGS="-d:insecure -d:testnet_servers_image ${NETWORK_NIM_FLAGS}" beacon_node deposit_contract
|
$MAKE -j2 LOG_LEVEL="${LOG_LEVEL}" NIMFLAGS="-d:insecure -d:testnet_servers_image -d:local_testnet ${NETWORK_NIM_FLAGS}" beacon_node deposit_contract
|
||||||
|
|
||||||
PIDS=""
|
PIDS=""
|
||||||
WEB3_ARG=""
|
WEB3_ARG=""
|
||||||
|
|
|
@ -49,7 +49,7 @@ mkdir -p "$SECRETS_DIR"
|
||||||
|
|
||||||
cd "$GIT_ROOT"
|
cd "$GIT_ROOT"
|
||||||
|
|
||||||
CUSTOM_NIMFLAGS="${NIMFLAGS} -d:useSysAsserts -d:chronicles_sinks:textlines,json[file] -d:const_preset=mainnet -d:insecure"
|
CUSTOM_NIMFLAGS="${NIMFLAGS} -d:useSysAsserts -d:chronicles_sinks:textlines,json[file] -d:const_preset=mainnet -d:insecure -d:local_testnet"
|
||||||
GANACHE_BLOCK_TIME=5
|
GANACHE_BLOCK_TIME=5
|
||||||
|
|
||||||
# Run with "SLOTS_PER_EPOCH=8 ./start.sh" to change these
|
# Run with "SLOTS_PER_EPOCH=8 ./start.sh" to change these
|
||||||
|
|
Loading…
Reference in New Issue