diff --git a/beacon_chain/attestation_aggregation.nim b/beacon_chain/attestation_aggregation.nim index 060fe9308..c9801642a 100644 --- a/beacon_chain/attestation_aggregation.nim +++ b/beacon_chain/attestation_aggregation.nim @@ -40,7 +40,7 @@ func get_slot_signature(state: BeaconState, slot: Slot, privkey: ValidatorPrivKe get_domain(state, DOMAIN_BEACON_ATTESTER, compute_epoch_at_slot(slot)) bls_sign(privkey, hash_tree_root(slot).data, domain) -# https://github.com/ethereum/eth2.0-specs/blob/v0.9.4/specs/validator/0_beacon-chain-validator.md#aggregation-selection +# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase0/validator.md#aggregation-selection func is_aggregator(state: BeaconState, slot: Slot, index: uint64, slot_signature: ValidatorSig): bool = # TODO index is a CommitteeIndex, aka uint64 @@ -65,17 +65,17 @@ proc aggregate_attestations*( doAssert slot + ATTESTATION_PROPAGATION_SLOT_RANGE >= state.slot doAssert state.slot >= slot - # https://github.com/ethereum/eth2.0-specs/blob/v0.9.4/specs/validator/0_beacon-chain-validator.md#aggregation-selection + # https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase0/validator.md#aggregation-selection if not is_aggregator(state, slot, index, slot_signature): return none(AggregateAndProof) let attestation_data = makeAttestationData(state, slot, index, get_block_root_at_slot(state, slot)) - # https://github.com/ethereum/eth2.0-specs/blob/v0.10.0/specs/phase0/validator.md#construct-aggregate + # https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase0/validator.md#construct-aggregate for attestation in getAttestationsForBlock(pool, state, slot): if attestation.data == attestation_data: - # https://github.com/ethereum/eth2.0-specs/blob/v0.10.0/specs/phase0/validator.md#aggregateandproof + # https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase0/validator.md#aggregateandproof return some(AggregateAndProof( aggregator_index: index, aggregate: attestation, diff --git a/beacon_chain/inspector.nim b/beacon_chain/inspector.nim index 548801812..f65ee7cd7 100644 --- a/beacon_chain/inspector.nim +++ b/beacon_chain/inspector.nim @@ -93,7 +93,7 @@ type abbr: "d" defaultValue: false }: bool -func getTopic(filter: TopicFilter): seq[string] {.inline.} = +func getTopics(filter: TopicFilter): seq[string] {.inline.} = case filter of TopicFilter.Blocks: @[topicBeaconBlocks] @@ -106,7 +106,7 @@ func getTopic(filter: TopicFilter): seq[string] {.inline.} = of TopicFilter.AttesterSlashings: @[topicAttesterSlashings] -proc getPeerId(peer: PeerID, conf: InspectorConf): string {.inline.} = +func getPeerId(peer: PeerID, conf: InspectorConf): string {.inline.} = if conf.fullPeerId: result = peer.pretty() else: @@ -278,8 +278,7 @@ proc run(conf: InspectorConf) {.async.} = try: for filter in topics: - let topics = getTopic(filter) - for topic in topics: + for topic in getTopics(filter): let t = await api.pubsubSubscribe(topic, pubsubLogger) info "Subscribed to topic", topic = topic subs.add((ticket: t, future: t.transp.join())) diff --git a/beacon_chain/spec/datatypes.nim b/beacon_chain/spec/datatypes.nim index 4748eab6d..956e30399 100644 --- a/beacon_chain/spec/datatypes.nim +++ b/beacon_chain/spec/datatypes.nim @@ -59,7 +59,6 @@ else: const SPEC_VERSION* = "0.10.1" ## \ ## Spec version we're aiming to be compatible with, right now - ## TODO: improve this scheme once we can negotiate versions in protocol GENESIS_EPOCH* = (GENESIS_SLOT.uint64 div SLOTS_PER_EPOCH).Epoch ##\ ## compute_epoch_at_slot(GENESIS_SLOT)