docs: some fixes on discv4 docs (#18601)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
morito
2025-09-24 21:41:34 +09:00
committed by GitHub
parent 6631fc4e82
commit e6050e0332
2 changed files with 5 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
# <h1 align="center"> discv4 </h1>
This is a rust implementation of
the [Discovery v4](https://github.com/ethereum/devp2p/blob/40ab248bf7e017e83cc9812a4e048446709623e8/discv4.md)
the [Discovery v4](https://github.com/ethereum/devp2p/blob/0b3b679be294324eb893340461c7c51fb4c15864/discv4.md)
peer discovery protocol.
For comparison to Discovery v5,
@@ -14,7 +14,7 @@ This is inspired by the [discv5](https://github.com/sigp/discv5) crate and reuse
The discovery service continuously attempts to connect to other nodes on the network until it has found enough peers.
If UPnP (Universal Plug and Play) is supported by the router the service is running on, it will also accept connections
from external nodes. In the discovery protocol, nodes exchange information about where the node can be reached to
eventually establish ``RLPx`` sessions.
eventually establish `RLPx` sessions.
## Trouble Shooting

View File

@@ -213,12 +213,12 @@ impl Discv4 {
/// Binds a new `UdpSocket` and creates the service
///
/// ```
/// # use std::io;
/// use reth_discv4::{Discv4, Discv4Config};
/// use reth_network_peers::{pk2id, NodeRecord, PeerId};
/// use secp256k1::SECP256K1;
/// use std::{net::SocketAddr, str::FromStr};
/// # async fn t() -> io::Result<()> {
/// # async fn t() -> std:: io::Result<()> {
///
/// // generate a (random) keypair
/// let (secret_key, pk) = SECP256K1.generate_keypair(&mut rand_08::thread_rng());
/// let id = pk2id(&pk);
@@ -2109,7 +2109,7 @@ impl Default for LookupTargetRotator {
}
impl LookupTargetRotator {
/// this will return the next node id to lookup
/// This will return the next node id to lookup
fn next(&mut self, local: &PeerId) -> PeerId {
self.counter += 1;
self.counter %= self.interval;