Description
When multiple peerinfo examples run concurrently they send to each other more than 1 peerinfo message per interval. Instead, if a peerinfo example conects with a Charon node the peerinfo message is only received once per interval.
How to reproduce
- Setup a test cluster using Charon
./charon create cluster --nodes 3 --network mainnet --num-validators 1 --cluster-dir ./test-cluster --insecure-keys --fee-recipient-addresses 0x0000000000000000000000000000000000000000 --withdrawal-addresses 0x0000000000000000000000000000000000000000
-
Copy the private keys for nodes 1 and 2 to .node-1 and .node-2 respectively (each directory should contain a single charon-enr-private-key file).
-
Run a Charon node:
./charon run --simnet-beacon-mock --no-verify --nickname=node0 --lock-file=test-cluster/node0/cluster-lock.json --private-key-file=test-cluster/node0/charon-enr-private-key --p2p-tcp-address=0.0.0.0:3610 --monitoring-address=0.0.0.0:9464 --log-level=info
- Run a Pluto
peerinfo example, dialing the Charon node:
cargo run -p charon-peerinfo --example peerinfo -- \
--port 4001 \
--nickname node-1 \
--data-dir .node-1 \
--metrics-port 9465 \
--dial /ip4/127.0.0.1/tcp/3610
- Validate that you're seeing a single PeerInfo log:
2026-01-28T20:32:50.806482Z INFO peerinfo: Loaded existing private key from .node-1
2026-01-28T20:32:50.809754Z INFO peerinfo: ENR: enr:-Iu4QCVayGwxN90xAbGqpvvR2TqciZ41ZgRN8mF0675xj2hkQFcnVwl6pWq1gjmUOAZVHBE50oD-HnWX8xlVDQN-hd2AgmlkgnY0gmlwhAAAAACJc2VjcDI1NmsxoQOdy7XC6i8ORmTOkLQNGEl6y4jqJFWlk9uabkp7g88nWYN0Y3CCD6GDdWRwgg-h
2026-01-28T20:32:50.809882Z INFO vise_exporter::exporter: Created metrics exporter with 23 metrics in 4 groups from crates vise_exporter 0.3.2, charon_tracing 1.7.1, charon_peerinfo 1.7.1, charon_p2p 1.7.1, ...
2026-01-28T20:32:50.813052Z INFO libp2p_swarm: local_peer_id=16Uiu2HAmPGxXC2xtfqrMo8uLFxeuAczdV1dqFc6cshrqNwHVet8G
2026-01-28T20:32:50.813086Z INFO peerinfo: Local peer id: 16Uiu2HAmPGxXC2xtfqrMo8uLFxeuAczdV1dqFc6cshrqNwHVet8G
2026-01-28T20:32:50.813100Z INFO peerinfo: mDNS auto-discovery enabled
2026-01-28T20:32:50.813171Z INFO peerinfo: Dialing /ip4/127.0.0.1/tcp/3610
2026-01-28T20:32:50.813294Z INFO peerinfo: Peerinfo example started with nickname 'node-1', interval 5s
2026-01-28T20:32:50.813303Z INFO peerinfo: Press Ctrl+C to exit
2026-01-28T20:32:50.813526Z INFO libp2p_mdns::behaviour::iface: creating instance on iface address address=192.168.1.182
2026-01-28T20:32:50.813590Z INFO libp2p_mdns::behaviour::iface: creating instance on iface address address=100.82.171.62
2026-01-28T20:32:50.813622Z INFO libp2p_mdns::behaviour::iface: creating instance on iface address address=172.17.0.1
2026-01-28T20:32:50.813764Z INFO peerinfo: Listening on /ip4/127.0.0.1/tcp/4001
2026-01-28T20:32:50.813797Z INFO peerinfo: Listening on /ip4/192.168.1.182/tcp/4001
2026-01-28T20:32:50.813815Z INFO peerinfo: Listening on /ip4/100.82.171.62/tcp/4001
2026-01-28T20:32:50.813841Z INFO peerinfo: Listening on /ip4/172.17.0.1/tcp/4001
2026-01-28T20:32:50.816948Z INFO peerinfo: Connection established with 16Uiu2HAmFGE1p3vAxnJ8ghSYuGCiByguyD4SZBu8wu2PcrG1tz7A via /ip4/127.0.0.1/tcp/3610
2026-01-28T20:32:55.818160Z INFO charon_peerinfo::protocol: Peer name to nickname mappings nicknames={"beautiful-park": "node0"}
2026-01-28T20:32:55.820692Z WARN charon_peerinfo::protocol: Mismatching peer lock hash peer="beautiful-park" lock_hash="916a191e150f1ab4a358326e7e036290e838997a80e703b500876f6a982c7a51"
2026-01-28T20:32:55.820857Z INFO peerinfo: Received PeerInfo from 16Uiu2HAmFGE1p3vAxnJ8ghSYuGCiByguyD4SZBu8wu2PcrG1tz7A:
│ Version: v1.7.1-DIRTY
│ Git Hash: 749d2d7
│ Nickname: node0
│ Builder API: false
│ Lock Hash: "916a191e150f1ab4a358326e7e036290e838997a80e703b500876f6a982c7a51"
- Run a second Pluto
peerinfo example:
cargo run -p charon-peerinfo --example peerinfo -- \
--port 4002 \
--nickname node-2 \
--data-dir .node-2 \
--metrics-port 9466 \
--dial /ip4/127.0.0.1/tcp/3610
- Validate that you're seeing multiple Peerinfo messages per node:
2026-01-28T20:33:41.584015Z INFO libp2p_mdns::behaviour: discovered peer on address peer=16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J address=/ip4/172.17.0.1/tcp/4002/p2p/16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J
2026-01-28T20:33:41.584109Z INFO libp2p_mdns::behaviour: discovered peer on address peer=16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J address=/ip4/100.82.171.62/tcp/4002/p2p/16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J
2026-01-28T20:33:41.584141Z INFO libp2p_mdns::behaviour: discovered peer on address peer=16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J address=/ip4/192.168.1.182/tcp/4002/p2p/16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J
2026-01-28T20:33:41.584184Z INFO peerinfo: 🔍 mDNS discovered peer 16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J at /ip4/172.17.0.1/tcp/4002/p2p/16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J
2026-01-28T20:33:41.584306Z INFO peerinfo: 🔍 mDNS discovered peer 16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J at /ip4/100.82.171.62/tcp/4002/p2p/16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J
2026-01-28T20:33:41.584363Z INFO peerinfo: 🔍 mDNS discovered peer 16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J at /ip4/192.168.1.182/tcp/4002/p2p/16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J
2026-01-28T20:33:41.588129Z INFO peerinfo: Connection established with 16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J via /ip4/100.82.171.62/tcp/4002/p2p/16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J
2026-01-28T20:33:41.588287Z INFO peerinfo: Connection established with 16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J via /ip4/192.168.1.182/tcp/4002/p2p/16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J
2026-01-28T20:33:41.588640Z INFO peerinfo: Connection established with 16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J via /ip4/172.17.0.1/tcp/4002/p2p/16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J
2026-01-28T20:33:41.589468Z INFO peerinfo: Connection established with 16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J via /ip4/100.82.171.62/tcp/4002
2026-01-28T20:33:41.589638Z INFO peerinfo: Connection established with 16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J via /ip4/192.168.1.182/tcp/4002
2026-01-28T20:33:41.589791Z INFO peerinfo: Connection established with 16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J via /ip4/192.168.1.182/tcp/54138
2026-01-28T20:33:46.589031Z INFO charon_peerinfo::protocol: Peer name to nickname mappings nicknames={"helpless-fish": "node-2"}
2026-01-28T20:33:46.589163Z INFO charon_peerinfo::protocol: Peer name to nickname mappings nicknames={"helpless-fish": "node-2"}
2026-01-28T20:33:46.589245Z INFO charon_peerinfo::protocol: Peer name to nickname mappings nicknames={"helpless-fish": "node-2"}
2026-01-28T20:33:46.589387Z INFO peerinfo: Received PeerInfo from 16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J:
│ Version: v1.0.0
│ Git Hash: abc1234
│ Nickname: node-2
│ Builder API: false
│ Lock Hash: "00000000"
2026-01-28T20:33:46.589450Z INFO peerinfo: Received PeerInfo from 16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J:
│ Version: v1.0.0
│ Git Hash: abc1234
│ Nickname: node-2
│ Builder API: false
│ Lock Hash: "00000000"
2026-01-28T20:33:46.589507Z INFO peerinfo: Received PeerInfo from 16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J:
│ Version: v1.0.0
│ Git Hash: abc1234
│ Nickname: node-2
│ Builder API: false
│ Lock Hash: "00000000"
2026-01-28T20:33:46.590046Z INFO charon_peerinfo::protocol: Peer name to nickname mappings nicknames={"helpless-fish": "node-2"}
2026-01-28T20:33:46.590119Z INFO charon_peerinfo::protocol: Peer name to nickname mappings nicknames={"helpless-fish": "node-2"}
2026-01-28T20:33:46.590136Z INFO peerinfo: Received PeerInfo from 16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J:
│ Version: v1.0.0
│ Git Hash: abc1234
│ Nickname: node-2
│ Builder API: false
│ Lock Hash: "00000000"
2026-01-28T20:33:46.590288Z INFO peerinfo: Received PeerInfo from 16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J:
│ Version: v1.0.0
│ Git Hash: abc1234
│ Nickname: node-2
│ Builder API: false
│ Lock Hash: "00000000"
2026-01-28T20:33:46.590375Z INFO charon_peerinfo::protocol: Peer name to nickname mappings nicknames={"helpless-fish": "node-2"}
2026-01-28T20:33:46.590463Z INFO peerinfo: Received PeerInfo from 16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J:
│ Version: v1.0.0
│ Git Hash: abc1234
│ Nickname: node-2
│ Builder API: false
│ Lock Hash: "00000000"
2026-01-28T20:33:48.810448Z WARN charon_peerinfo::protocol: Mismatching peer lock hash peer="beautiful-park" lock_hash="916a191e150f1ab4a358326e7e036290e838997a80e703b500876f6a982c7a51"
2026-01-28T20:33:48.810670Z INFO peerinfo: Received PeerInfo from 16Uiu2HAmFGE1p3vAxnJ8ghSYuGCiByguyD4SZBu8wu2PcrG1tz7A:
│ Version: v1.7.1-DIRTY
│ Git Hash: 749d2d7
│ Nickname: node0
│ Builder API: false
│ Lock Hash: "916a191e150f1ab4a358326e7e036290e838997a80e703b500876f6a982c7a51"
2026-01-28T20:33:51.590247Z INFO peerinfo: Received PeerInfo from 16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J:
│ Version: v1.0.0
│ Git Hash: abc1234
│ Nickname: node-2
│ Builder API: false
│ Lock Hash: "00000000"
2026-01-28T20:33:51.590353Z INFO peerinfo: Received PeerInfo from 16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J:
│ Version: v1.0.0
│ Git Hash: abc1234
│ Nickname: node-2
│ Builder API: false
│ Lock Hash: "00000000"
2026-01-28T20:33:51.590437Z INFO peerinfo: Received PeerInfo from 16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J:
│ Version: v1.0.0
│ Git Hash: abc1234
│ Nickname: node-2
│ Builder API: false
│ Lock Hash: "00000000"
2026-01-28T20:33:51.590551Z INFO peerinfo: Received PeerInfo from 16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J:
│ Version: v1.0.0
│ Git Hash: abc1234
│ Nickname: node-2
│ Builder API: false
│ Lock Hash: "00000000"
2026-01-28T20:33:51.590801Z INFO peerinfo: Received PeerInfo from 16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J:
│ Version: v1.0.0
│ Git Hash: abc1234
│ Nickname: node-2
│ Builder API: false
│ Lock Hash: "00000000"
2026-01-28T20:33:51.590855Z INFO peerinfo: Received PeerInfo from 16Uiu2HAmTvWXpcGW3BcGXF4MX7gkSPetYzjXxhUZMUk1FQX5HH1J:
│ Version: v1.0.0
│ Git Hash: abc1234
│ Nickname: node-2
│ Builder API: false
│ Lock Hash: "00000000"
Documentation link(s)
Not applicable
Description
When multiple peerinfo examples run concurrently they send to each other more than 1 peerinfo message per interval. Instead, if a peerinfo example conects with a Charon node the peerinfo message is only received once per interval.
How to reproduce
Copy the private keys for nodes 1 and 2 to
.node-1and.node-2respectively (each directory should contain a singlecharon-enr-private-keyfile).Run a Charon node:
peerinfoexample, dialing the Charon node:cargo run -p charon-peerinfo --example peerinfo -- \ --port 4001 \ --nickname node-1 \ --data-dir .node-1 \ --metrics-port 9465 \ --dial /ip4/127.0.0.1/tcp/3610peerinfoexample:cargo run -p charon-peerinfo --example peerinfo -- \ --port 4002 \ --nickname node-2 \ --data-dir .node-2 \ --metrics-port 9466 \ --dial /ip4/127.0.0.1/tcp/3610Documentation link(s)
Not applicable