Skip to content
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

feat(l1): enr strings #1844

Merged
merged 16 commits into from
Jan 31, 2025
Merged

feat(l1): enr strings #1844

merged 16 commits into from
Jan 31, 2025

Conversation

MarcosNicolau
Copy link
Contributor

@MarcosNicolau MarcosNicolau commented Jan 29, 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:
 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:
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

Copy link

github-actions bot commented Jan 29, 2025

| File                                                                          | Lines | Diff |
+-------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/cmd/ethrex/ethrex.rs                          | 392   | +7   |
+-------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/common/base64.rs                       | 132   | +132 |
+-------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/common/core.rs                         | 6     | +1   |
+-------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/p2p/types.rs                | 405   | +77  |
+-------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/rpc/admin/mod.rs            | 57    | +11  |
+-------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/rpc/eth/filter.rs           | 548   | +3   |
+-------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/rpc/eth/gas_price.rs        | 121   | -3   |
+-------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/rpc/eth/max_priority_fee.rs | 106   | -3   |
+-------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/rpc/rpc.rs                  | 511   | +58  |
+-------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/rpc/utils.rs                | 277   | +16  |
+-------------------------------------------------------------------------------+-------+------+

Total lines added: +305
Total lines removed: 6
Total lines changed: 311

@MarcosNicolau MarcosNicolau changed the title feat: enr strings in admin_nodeInfo feat(l1): enr strings Jan 30, 2025
@MarcosNicolau MarcosNicolau changed the base branch from main to feat/store-known-peers January 30, 2025 11:55
@MarcosNicolau MarcosNicolau marked this pull request as ready for review January 30, 2025 11:59
@MarcosNicolau MarcosNicolau requested a review from a team as a code owner January 30, 2025 11:59
@MarcosNicolau MarcosNicolau self-assigned this Jan 30, 2025
Copy link
Collaborator

@mpaulucci mpaulucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Base automatically changed from feat/store-known-peers to main January 31, 2025 16:07
@MarcosNicolau MarcosNicolau added this pull request to the merge queue Jan 31, 2025
Merged via the queue into main with commit f8b738a Jan 31, 2025
19 checks passed
@MarcosNicolau MarcosNicolau deleted the feat/enr-strings branch January 31, 2025 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement ENR strings
3 participants