Skip to content

Implement ENR strings #1757

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks
MarcosNicolau opened this issue Jan 20, 2025 · 0 comments · Fixed by #1844
Closed
4 tasks

Implement ENR strings #1757

MarcosNicolau opened this issue Jan 20, 2025 · 0 comments · Fixed by #1844
Labels
L1 Ethereum client p2p Issues related to p2p network

Comments

@MarcosNicolau
Copy link
Member

We should implement Ethereum Node Records (ENR) strings encoding and decoding.

This consists of:

  • Encode a NodeRecord into an ENR string.
  • Decode an ENR string into a NodeRecord struct.
  • Include ENR string in admin_nodeInfo RPC alongside enode.
  • Support bootnodes in both enode and enr formats.

See:

@MarcosNicolau MarcosNicolau added L1 Ethereum client p2p Issues related to p2p network labels Jan 20, 2025
@MarcosNicolau MarcosNicolau added this to the [L1] 4 - P2P Network milestone Jan 20, 2025
github-merge-queue bot pushed a commit that referenced this issue Jan 31, 2025
**Motivation**
Implements missing support for `enr` strings when parsing bootnodes and
retrieving local enr via `admin_nodeInfo`

**Description**
- Adds possibility to construct a `Node` struct from an `enr` string
- Adds `enr` url field in `admin_nodeInfo` endpoint
- It also fixes the `id` field in the `admin_nodeInfo` which is not the
actual public key but the keccak256 digest of the public key.

**Testing**
- Start an `el` node and send a rpc request to `admin_nodeInfo` and
locate the `enr` field:
```shell
 curl http://localhost:8545 \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"admin_nodeInfo","params":[],"id":1}'
```
- Start an `ethrex` node with the `enr` string in the bootnodes param:
```shell
RUST_LOG=4 cargo run --bin ethrex -- \
    --network test_data/genesis-kurtosis.json \
    --http.port $HTTP_PORT \
    --p2p.port $P2P_PORT \
    --discovery.port $P2P_PORT \
    --bootnodes $BOOTNODES
```


Note: this pr points to #1823 because it follows the refactor for the
`BootNodes` struct.

Closes #1757
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L1 Ethereum client p2p Issues related to p2p network
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant