Skip to content

Commit fde8c8f

Browse files
Merge branch 'main' into feat/804-add-thin-waist-address
2 parents 63a8458 + bc1b1ed commit fde8c8f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

libp2p/pubsub/gossipsub.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -775,16 +775,16 @@ async def handle_ihave(
775775
# Get list of all seen (seqnos, from) from the (seqno, from) tuples in
776776
# seen_messages cache
777777
seen_seqnos_and_peers = [
778-
seqno_and_from for seqno_and_from in self.pubsub.seen_messages.cache.keys()
778+
str(seqno_and_from)
779+
for seqno_and_from in self.pubsub.seen_messages.cache.keys()
779780
]
780781

781782
# Add all unknown message ids (ids that appear in ihave_msg but not in
782783
# seen_seqnos) to list of messages we want to request
783-
# FIXME: Update type of message ID
784-
msg_ids_wanted: list[Any] = [
784+
msg_ids_wanted: list[str] = [
785785
msg_id
786786
for msg_id in ihave_msg.messageIDs
787-
if literal_eval(msg_id) not in seen_seqnos_and_peers
787+
if msg_id not in seen_seqnos_and_peers
788788
]
789789

790790
# Request messages with IWANT message

newsfragments/859.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix type for gossipsub_message_id for consistency and security

0 commit comments

Comments
 (0)