Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
PR feeback, thanks to NIC619
Browse files Browse the repository at this point in the history
  • Loading branch information
hwwhww committed Dec 6, 2019
1 parent 4363ea3 commit ac36e73
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/eth2/core/beacon/tools/builder/test_aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_aggregator_selection(validator_count, privkeys, genesis_state, config):
)


def test_get_get_aggregate_from_valid_committee_attestations(
def test_get_aggregate_from_valid_committee_attestations(
sample_attestation_params, privkeys, genesis_state, config
):
committee_size = 16
Expand Down
4 changes: 4 additions & 0 deletions trinity/components/eth2/beacon/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ async def attest(self, slot: Slot) -> Tuple[Attestation, ...]:
self.import_attestation(attestation)
await self.p2p_node.broadcast_attestation_to_subnet(attestation, subnet_id)

# Log the last epoch that the validator attested
for index in attesting_validators_indices:
self.latest_attested_epoch[index] = epoch

attestations = attestations + (attestation,)
# TODO: Aggregate attestations

Expand Down
11 changes: 7 additions & 4 deletions trinity/protocol/bcc_libp2p/servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,13 @@ async def _handle_committee_beacon_attestation_loop(self) -> None:
topic = PUBSUB_TOPIC_COMMITTEE_BEACON_ATTESTATION.substitute(
subnet_id=str(subnet_id)
)
await self._handle_message(
topic,
self._handle_committee_beacon_attestation,
)
try:
queue = self.topic_msg_queues[topic]
message = queue.get_nowait()
except asyncio.QueueEmpty:
continue
else:
await self._handle_committee_beacon_attestation(message)

async def _handle_aggregate_and_proof_loop(self) -> None:
await self._handle_message(
Expand Down

0 comments on commit ac36e73

Please sign in to comment.