From b656759e0e28ae4edadf5edce9dc334b66b1b30f Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Fri, 3 Dec 2021 15:42:20 -0300 Subject: [PATCH] be explicit about ignoring params --- scripts/dht_node.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/dht_node.py b/scripts/dht_node.py index a9f5ea80d..229c8fc45 100644 --- a/scripts/dht_node.py +++ b/scripts/dht_node.py @@ -30,7 +30,7 @@ class SimpleMetrics: self.prometheus_port = port self.dht_node: Node = node - async def handle_metrics_get_request(self, request: web.Request): + async def handle_metrics_get_request(self, _): try: return web.Response( text=prom_generate_latest().decode(), @@ -40,7 +40,7 @@ class SimpleMetrics: log.exception('could not generate prometheus data') raise - async def handle_peers_csv(self, request: web.Request): + async def handle_peers_csv(self, _): out = StringIO() writer = csv.DictWriter(out, fieldnames=["ip", "port", "dht_id"]) writer.writeheader() @@ -48,7 +48,7 @@ class SimpleMetrics: writer.writerow({"ip": peer.address, "port": peer.udp_port, "dht_id": peer.node_id.hex()}) return web.Response(text=out.getvalue(), content_type='text/csv') - async def handle_blobs_csv(self, request: web.Request): + async def handle_blobs_csv(self, _): out = StringIO() writer = csv.DictWriter(out, fieldnames=["blob_hash"]) writer.writeheader() @@ -56,7 +56,7 @@ class SimpleMetrics: writer.writerow({"blob_hash": blob.hex()}) return web.Response(text=out.getvalue(), content_type='text/csv') - async def active_estimation(self, request: web.Request): + async def active_estimation(self, _): # - "crawls" the network for peers close to our node id (not a full aggressive crawler yet) # given everything is random, the odds of a peer having the same X prefix bits matching ours is roughly 1/(2^X) # we use that to estimate the network size, see issue #3463 for related papers and details @@ -65,7 +65,7 @@ class SimpleMetrics: close_ids = [peer for peer in peers if peer.node_id[0] == self.dht_node.protocol.node_id[0]] return web.json_response({"total": len(peers), "close": len(close_ids)}) - async def passive_estimation(self, request: web.Request): + async def passive_estimation(self, _): # same method as above but instead we use the routing table and assume our implementation was able to add # all the reachable close peers, which should be usable for seed nodes since they are super popular total_peers = self.dht_node.protocol.routing_table.get_peers()