Switch to Nim v1.0.2

This commit is contained in:
Zahary Karadjov 2019-09-29 20:42:53 +03:00
parent f7dea04ed6
commit dfe3a6f0fb
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
9 changed files with 13 additions and 11 deletions

View File

@ -36,6 +36,7 @@ install:
script: script:
- set -e # fail fast - set -e # fail fast
- make -j2 update # to allow a newer Nim version to be detected
- make -j2 - make -j2
- make -j2 DISABLE_LFS_SCRIPT=1 test - make -j2 DISABLE_LFS_SCRIPT=1 test

View File

@ -311,8 +311,9 @@ proc addLocalValidators(node: BeaconNode, state: BeaconState) =
info "Local validators attached ", count = node.attachedValidators.count info "Local validators attached ", count = node.attachedValidators.count
proc getAttachedValidator( proc getAttachedValidator(node: BeaconNode,
node: BeaconNode, state: BeaconState, idx: ValidatorIndex): AttachedValidator = state: BeaconState,
idx: ValidatorIndex): AttachedValidator =
let validatorKey = state.validators[idx].pubkey let validatorKey = state.validators[idx].pubkey
node.attachedValidators.getValidator(validatorKey) node.attachedValidators.getValidator(validatorKey)

View File

@ -251,10 +251,10 @@ else:
func peersCount*(node: Eth2Node): int = func peersCount*(node: Eth2Node): int =
node.peers.len node.peers.len
proc makeMessageHandler[MsgType](msgHandler: proc(msg: MsgType)): P2PPubSubCallback = proc makeMessageHandler[MsgType](msgHandler: proc(msg: MsgType) {.gcsafe.}): P2PPubSubCallback =
result = proc(api: DaemonAPI, result = proc(api: DaemonAPI,
ticket: PubsubTicket, ticket: PubsubTicket,
msg: PubSubMessage): Future[bool] {.async.} = msg: PubSubMessage): Future[bool] {.async, gcsafe.} =
inc gossip_messages_received inc gossip_messages_received
trace "Incoming gossip bytes", trace "Incoming gossip bytes",
peer = msg.peer, len = msg.data.len, tops = msg.topics peer = msg.peer, len = msg.data.len, tops = msg.topics
@ -263,7 +263,7 @@ else:
proc subscribe*[MsgType](node: Eth2Node, proc subscribe*[MsgType](node: Eth2Node,
topic: string, topic: string,
msgHandler: proc(msg: MsgType)) {.async.} = msgHandler: proc(msg: MsgType) {.gcsafe.} ) {.async, gcsafe.} =
discard await node.daemon.pubsubSubscribe(topic, makeMessageHandler(msgHandler)) discard await node.daemon.pubsubSubscribe(topic, makeMessageHandler(msgHandler))
proc broadcast*(node: Eth2Node, topic: string, msg: auto) = proc broadcast*(node: Eth2Node, topic: string, msg: auto) =

View File

@ -66,7 +66,7 @@ func get_shuffled_seq*(seed: Eth2Digest,
let let
cur_idx_permuted = shuffled_active_validator_indices[index] cur_idx_permuted = shuffled_active_validator_indices[index]
flip = ((list_size + pivot) - cur_idx_permuted.uint64) mod list_size 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 let
source = sources[position div 256].data source = sources[position div 256].data

View File

@ -37,7 +37,7 @@ proc writeJson*(prefix, slot, v: auto) =
let fileName = fmt"{prefix:04}-{shortLog(slot):08}.json" let fileName = fmt"{prefix:04}-{shortLog(slot):08}.json"
Json.saveFile(fileName, v, pretty = true) 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 validators = SLOTS_PER_EPOCH * 9, # One per shard is minimum
json_interval = SLOTS_PER_EPOCH, json_interval = SLOTS_PER_EPOCH,
prefix = 0, prefix = 0,

2
vendor/nim-libp2p vendored

@ -1 +1 @@
Subproject commit f2b10776dbdfab2986ef35499994028a6809250c Subproject commit 21af0810663901abc832ff7f29e3920a9f22392a

2
vendor/nim-stew vendored

@ -1 +1 @@
Subproject commit 2bdd2fab6e9bdcdcb51ea7e09d077f36a29faf4c Subproject commit 0c3ab3eb78dc495a7662d397d04dff07d1a490c6

2
vendor/nim-web3 vendored

@ -1 +1 @@
Subproject commit 817c819847368471ea782880088299cda4045c5a Subproject commit 5107c088bc90f1cc62df9dcda077333c20f3a778

@ -1 +1 @@
Subproject commit 648a08f970b521171c1eac004a0f7e5854243c20 Subproject commit c29bc8342c5ec2ffb87310460246f4de953ba933