From dfe3a6f0fb648ae3fb89ad661da1617f20b5732c Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Sun, 29 Sep 2019 20:42:53 +0300 Subject: [PATCH] Switch to Nim v1.0.2 --- .travis.yml | 1 + beacon_chain/beacon_node.nim | 5 +++-- beacon_chain/eth2_network.nim | 6 +++--- beacon_chain/spec/validator.nim | 2 +- research/state_sim.nim | 2 +- vendor/nim-libp2p | 2 +- vendor/nim-stew | 2 +- vendor/nim-web3 | 2 +- vendor/nimbus-build-system | 2 +- 9 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 256e5c63c..01f4edb6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,6 +36,7 @@ install: script: - set -e # fail fast + - make -j2 update # to allow a newer Nim version to be detected - make -j2 - make -j2 DISABLE_LFS_SCRIPT=1 test diff --git a/beacon_chain/beacon_node.nim b/beacon_chain/beacon_node.nim index a8489623e..54e588823 100644 --- a/beacon_chain/beacon_node.nim +++ b/beacon_chain/beacon_node.nim @@ -311,8 +311,9 @@ proc addLocalValidators(node: BeaconNode, state: BeaconState) = info "Local validators attached ", count = node.attachedValidators.count -proc getAttachedValidator( - node: BeaconNode, state: BeaconState, idx: ValidatorIndex): AttachedValidator = +proc getAttachedValidator(node: BeaconNode, + state: BeaconState, + idx: ValidatorIndex): AttachedValidator = let validatorKey = state.validators[idx].pubkey node.attachedValidators.getValidator(validatorKey) diff --git a/beacon_chain/eth2_network.nim b/beacon_chain/eth2_network.nim index 3efcbf49d..c628a4299 100644 --- a/beacon_chain/eth2_network.nim +++ b/beacon_chain/eth2_network.nim @@ -251,10 +251,10 @@ else: func peersCount*(node: Eth2Node): int = node.peers.len - proc makeMessageHandler[MsgType](msgHandler: proc(msg: MsgType)): P2PPubSubCallback = + proc makeMessageHandler[MsgType](msgHandler: proc(msg: MsgType) {.gcsafe.}): P2PPubSubCallback = result = proc(api: DaemonAPI, ticket: PubsubTicket, - msg: PubSubMessage): Future[bool] {.async.} = + msg: PubSubMessage): Future[bool] {.async, gcsafe.} = inc gossip_messages_received trace "Incoming gossip bytes", peer = msg.peer, len = msg.data.len, tops = msg.topics @@ -263,7 +263,7 @@ else: proc subscribe*[MsgType](node: Eth2Node, topic: string, - msgHandler: proc(msg: MsgType)) {.async.} = + msgHandler: proc(msg: MsgType) {.gcsafe.} ) {.async, gcsafe.} = discard await node.daemon.pubsubSubscribe(topic, makeMessageHandler(msgHandler)) proc broadcast*(node: Eth2Node, topic: string, msg: auto) = diff --git a/beacon_chain/spec/validator.nim b/beacon_chain/spec/validator.nim index a06f5eb63..51ef3c28b 100644 --- a/beacon_chain/spec/validator.nim +++ b/beacon_chain/spec/validator.nim @@ -66,7 +66,7 @@ func get_shuffled_seq*(seed: Eth2Digest, let cur_idx_permuted = shuffled_active_validator_indices[index] flip = ((list_size + pivot) - cur_idx_permuted.uint64) mod list_size - position = max(cur_idx_permuted, flip.int) + position = max(cur_idx_permuted.int, flip.int) let source = sources[position div 256].data diff --git a/research/state_sim.nim b/research/state_sim.nim index 97a49286c..a8af96b19 100644 --- a/research/state_sim.nim +++ b/research/state_sim.nim @@ -37,7 +37,7 @@ proc writeJson*(prefix, slot, v: auto) = let fileName = fmt"{prefix:04}-{shortLog(slot):08}.json" Json.saveFile(fileName, v, pretty = true) -cli do(slots = 448, +cli do(slots = 448'u, validators = SLOTS_PER_EPOCH * 9, # One per shard is minimum json_interval = SLOTS_PER_EPOCH, prefix = 0, diff --git a/vendor/nim-libp2p b/vendor/nim-libp2p index f2b10776d..21af08106 160000 --- a/vendor/nim-libp2p +++ b/vendor/nim-libp2p @@ -1 +1 @@ -Subproject commit f2b10776dbdfab2986ef35499994028a6809250c +Subproject commit 21af0810663901abc832ff7f29e3920a9f22392a diff --git a/vendor/nim-stew b/vendor/nim-stew index 2bdd2fab6..0c3ab3eb7 160000 --- a/vendor/nim-stew +++ b/vendor/nim-stew @@ -1 +1 @@ -Subproject commit 2bdd2fab6e9bdcdcb51ea7e09d077f36a29faf4c +Subproject commit 0c3ab3eb78dc495a7662d397d04dff07d1a490c6 diff --git a/vendor/nim-web3 b/vendor/nim-web3 index 817c81984..5107c088b 160000 --- a/vendor/nim-web3 +++ b/vendor/nim-web3 @@ -1 +1 @@ -Subproject commit 817c819847368471ea782880088299cda4045c5a +Subproject commit 5107c088bc90f1cc62df9dcda077333c20f3a778 diff --git a/vendor/nimbus-build-system b/vendor/nimbus-build-system index 648a08f97..c29bc8342 160000 --- a/vendor/nimbus-build-system +++ b/vendor/nimbus-build-system @@ -1 +1 @@ -Subproject commit 648a08f970b521171c1eac004a0f7e5854243c20 +Subproject commit c29bc8342c5ec2ffb87310460246f4de953ba933