Merge pull request #634 from status-im/devel

Restore finalization in the testnet release
This commit is contained in:
zah 2019-12-10 12:22:05 +02:00 committed by GitHub
commit ffd0c052ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 14 additions and 10 deletions

View File

@ -257,7 +257,7 @@ proc getAttestationsForBlock*(
logScope: pcs = "retrieve_attestation"
if newBlockSlot < (GENESIS_SLOT + MIN_ATTESTATION_INCLUSION_DELAY):
debug "[Attestion Pool] Too early for attestations",
debug "Too early for attestations",
newBlockSlot = shortLog(newBlockSlot),
cat = "query"
return

View File

@ -760,7 +760,11 @@ proc onSlotStart(node: BeaconNode, lastSlot, scheduledSlot: Slot) {.gcsafe, asyn
# disappear naturally - risky because user is not aware,
# and might lose stake on canonical chain but "just works"
# when reconnected..
if not node.isSynced(head):
if node.attachedValidators.count == 0:
# There are no validators, thus we don't have any additional work to do
# beyond keeping track of the head
discard
elif not node.isSynced(head):
warn "Node out of sync, skipping block and attestation production for this slot",
slot, headSlot = head.slot
else:
@ -1198,4 +1202,3 @@ when isMainModule:
quit 1
echo navigator.navigatePath(pathFragments[1 .. ^1]).toJson

View File

@ -1,6 +1,6 @@
import
os, strutils, options, json,
chronos, nimcrypto/utils, confutils, web3, stint,
chronos, nimcrypto, confutils, web3, stint,
eth/keys
# Compiled version of /scripts/depositContract.v.py in this repo

View File

@ -479,7 +479,7 @@ proc check_attestation*(
else:
if not (ffg_check_data == (state.previous_justified_checkpoint.epoch,
state.previous_justified_checkpoint.root, get_previous_epoch(state))):
warn("FFG data not matching current justified epoch")
warn("FFG data not matching previous justified epoch")
return
if not is_valid_indexed_attestation(

View File

@ -552,6 +552,7 @@ func shortLog*(v: BeaconBlock): auto =
func shortLog*(v: AttestationData): auto =
(
slot: shortLog(v.slot),
beacon_block_root: shortLog(v.beacon_block_root),
source_epoch: shortLog(v.source.epoch),
source_root: shortLog(v.source.root),

View File

@ -7,8 +7,8 @@
# Helpers and functions pertaining to managing the validator set
import
options, sequtils, math, tables,
./crypto, ./datatypes, ./digest, ./helpers
options, nimcrypto, sequtils, math, tables,
./datatypes, ./digest, ./helpers
# TODO: Proceed to renaming and signature changes
# https://github.com/ethereum/eth2.0-specs/blob/v0.9.2/specs/core/0_beacon-chain.md#compute_shuffled_index

View File

@ -1,6 +1,6 @@
import
os, strutils,
chronicles, chronos, blscurve, json_serialization, serialization,
chronicles, chronos, blscurve, nimcrypto, json_serialization, serialization,
web3, stint, eth/keys,
spec/[datatypes, digest, crypto], conf, ssz, interop

View File

@ -9,7 +9,7 @@
import
unittest, options,
stint, eth/common, serialization/testing/generic_suite,
stint, nimcrypto, eth/common, serialization/testing/generic_suite,
./testutil,
../beacon_chain/spec/[datatypes, digest],
../beacon_chain/ssz, ../beacon_chain/ssz/[navigator, dynamic_navigator]
@ -51,7 +51,7 @@ type
f0: uint8
f1: uint32
f2: EthAddress
f3: Eth2Digest
f3: MDigest[256]
f4: seq[byte]
f5: ValidatorIndex