Skip to content

Commit

Permalink
Bump libp2p (#3709)
Browse files Browse the repository at this point in the history
  • Loading branch information
Menduist authored Jun 8, 2022
1 parent a07d14c commit 29297e9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions beacon_chain/rpc/rest_nimbus_api.nim
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ type
proc toInfo(node: BeaconNode, peerId: PeerId): RestPeerInfo =
RestPeerInfo(
peerId: $peerId,
addrs: node.network.switch.peerStore.addressBook.get(peerId).toSeq().mapIt($it),
protocols: node.network.switch.peerStore.protoBook.get(peerId).toSeq(),
protoVersion: node.network.switch.peerStore.protoVersionBook.get(peerId),
agentVersion: node.network.switch.peerStore.agentBook.get(peerId)
addrs: node.network.switch.peerStore[AddressBook][peerId].mapIt($it),
protocols: node.network.switch.peerStore[ProtoBook][peerId],
protoVersion: node.network.switch.peerStore[ProtoVersionBook][peerId],
agentVersion: node.network.switch.peerStore[AgentBook][peerId]
)

proc toNode(v: PubSubPeer, backoff: Moment): RestPubSubPeer =
Expand Down
10 changes: 5 additions & 5 deletions beacon_chain/rpc/rest_node_api.nim
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ proc getLastSeenAddress(node: BeaconNode, id: PeerId): string =
# TODO (cheatfate): We need to provide filter here, which will be able to
# filter such multiaddresses like `/ip4/0.0.0.0` or local addresses or
# addresses with peer ids.
let addrs = node.network.switch.peerStore.addressBook.get(id).toSeq()
let addrs = node.network.switch.peerStore[AddressBook][id]
if len(addrs) > 0:
$addrs[len(addrs) - 1]
else:
Expand Down Expand Up @@ -200,8 +200,8 @@ proc installNodeApiHandlers*(router: var RestRouter, node: BeaconNode) =
state: peer.connectionState.toString(),
direction: peer.direction.toString(),
# Fields `agent` and `proto` are not part of specification
agent: node.network.switch.peerStore.agentBook.get(peer.peerId),
proto: node.network.switch.peerStore.protoVersionBook.get(peer.peerId)
agent: node.network.switch.peerStore[AgentBook][peer.peerId],
proto: node.network.switch.peerStore[ProtoVersionBook][peer.peerId]
)
res.add(peer)
return RestApiResponse.jsonResponseWMeta(res, (count: uint64(len(res))))
Expand Down Expand Up @@ -242,8 +242,8 @@ proc installNodeApiHandlers*(router: var RestRouter, node: BeaconNode) =
last_seen_p2p_address: getLastSeenAddress(node, peer.peerId),
state: peer.connectionState.toString(),
direction: peer.direction.toString(),
agent: node.network.switch.peerStore.agentBook.get(peer.peerId), # Fields `agent` and `proto` are not
proto: node.network.switch.peerStore.protoVersionBook.get(peer.peerId) # part of specification
agent: node.network.switch.peerStore[AgentBook][peer.peerId], # Fields `agent` and `proto` are not
proto: node.network.switch.peerStore[ProtoVersionBook][peer.peerId] # part of specification
)
)

Expand Down
2 changes: 1 addition & 1 deletion vendor/nim-libp2p

0 comments on commit 29297e9

Please sign in to comment.