Skip to content

/eth/v1/node/peers response contains extraneous fields #7909

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

Open
nflaig opened this issue Jun 3, 2025 · 3 comments
Open

/eth/v1/node/peers response contains extraneous fields #7909

nflaig opened this issue Jun 3, 2025 · 3 comments
Labels
scope-api Issues related to APIs

Comments

@nflaig
Copy link
Member

nflaig commented Jun 3, 2025

We should only return the fields as per spec, see getPeers and keep the custom response only to our /eth/v1/lodestar/peers endpoint.

@nflaig nflaig changed the title Do not return extraneous fields in /eth/v1/node/peers response /eth/v1/node/peers response contains extraneous fields Jun 3, 2025
@philknows philknows added the scope-api Issues related to APIs label Jun 3, 2025
@Alleysira
Copy link

Providing details from testing for your reference :D

Related implementation in lodestar:

export type LodestarNodePeer = NodePeer & {
agentVersion: string;
status: unknown | null;
metadata: unknown | null;
agentClient: string;
lastReceivedMsgUnixTsMs: number;
lastStatusUnixTsMs: number;
connectedUnixTsMs: number;
};

Results from other CL clients. Please note that I added server locally for debugging.

# prysm
{"data": {"direction": "inbound", "enr": "enr:-Ly4QHuFLBZVCuzvOGCYcxYBgKB5e9qlDONJUMyyYLlI8FtVHZLI26VzDYXk76q9P0tjGDvxvPzCMxSV8XxUHKvBAlwJh2F0dG5ldHOIAAAAADAAAACEZXRoMpDQmgRKYAAAOP__________gmlkgnY0gmlwhKwQCBOJc2VjcDI1NmsxoQNBgsMUKa3VcuHBVEN9w_JTyOUrjjWXvV4xrkzMh9T_pYhzeW5jbmV0cw-DdGNwgiMog3VkcIIjKA", "last_seen_p2p_address": "/ip4/172.16.8.19/tcp/51046", "peer_id": "16Uiu2HAmH4iVp7nw5f6fg5fNzhDqpVqjmuts6wyPcSZMRWuvjQyS", "state": "connected"}, "server": "http://127.0.0.1:8370"}
# lighthouse
{"data": {"direction": "inbound", "enr": null, "last_seen_p2p_address": "/ip4/172.16.8.19/tcp/42582", "peer_id": "16Uiu2HAmH4iVp7nw5f6fg5fNzhDqpVqjmuts6wyPcSZMRWuvjQyS", "state": "connected"}, "server": "http://127.0.0.1:8481"}
# nimbus
{"data": {"agent": "teku/teku/v25.4.1+52-g65869daa82/linux-x86_64/-eclipseadoptium-openjdk64bitservervm-java-21", "direction": "outbound", "enr": "enr:-LK4QBK4xAVXuXFb_RaWmYVc95CuxTFtS72MCIekKtI9-ZAoMM4NUh3DJhfK98kPlwXpTMtiopakyCGqfpIu_cSCALAEh2F0dG5ldHOIAAwAAAAAAACEZXRoMpDQmgRKYAAAOP__________gmlkgnY0gmlwhKwQCBOJc2VjcDI1NmsxoQNBgsMUKa3VcuHBVEN9w_JTyOUrjjWXvV4xrkzMh9T_pYN0Y3CCIyiDdWRwgiMo", "last_seen_p2p_address": "/ip4/172.16.8.19/tcp/9000/p2p/16Uiu2HAmH4iVp7nw5f6fg5fNzhDqpVqjmuts6wyPcSZMRWuvjQyS", "peer_id": "16Uiu2HAmH4iVp7nw5f6fg5fNzhDqpVqjmuts6wyPcSZMRWuvjQyS", "proto": "ipfs/0.1.0", "state": "connected"}, "server": "http://127.0.0.1:9060"}
# lodestar
{"data": {"agent_client": "Teku", "agent_version": "teku/teku/v25.4.1+52-g65869daa82/linux-x86_64/-eclipseadoptium-openjdk64bitservervm-java-21", "connected_unix_ts_ms": 1748939173658, "direction": "outbound", "enr": "", "last_received_msg_unix_ts_ms": 1748955423698, "last_seen_p2p_address": "/ip4/172.16.8.19/tcp/9000/p2p/16Uiu2HAmH4iVp7nw5f6fg5fNzhDqpVqjmuts6wyPcSZMRWuvjQyS", "last_status_unix_ts_ms": 1748955373152, "metadata": {"attnets": "0x0000000030000000", "seq_number": "6", "syncnets": "0x0f"}, "peer_id": "16Uiu2HAmH4iVp7nw5f6fg5fNzhDqpVqjmuts6wyPcSZMRWuvjQyS", "state": "connected", "status": {"finalized_epoch": "40", "finalized_root": "0x33ce405d7e3c2ff86ca1331b779ad5cbcbe5cdb4feb18f4a148e76d2822c7663", "fork_digest": "0xd09a044a", "head_root": "0x754819a64c5fcf96e3959285ce77a82a9e3070eaf81ce221774c197c0cef7c29", "head_slot": "1350"}}, "server": "http://127.0.0.1:9253"}
# grandine
{"data": {"direction": "outbound", "enr": "enr:-LK4QBK4xAVXuXFb_RaWmYVc95CuxTFtS72MCIekKtI9-ZAoMM4NUh3DJhfK98kPlwXpTMtiopakyCGqfpIu_cSCALAEh2F0dG5ldHOIAAwAAAAAAACEZXRoMpDQmgRKYAAAOP__________gmlkgnY0gmlwhKwQCBOJc2VjcDI1NmsxoQNBgsMUKa3VcuHBVEN9w_JTyOUrjjWXvV4xrkzMh9T_pYN0Y3CCIyiDdWRwgiMo", "last_seen_p2p_address": "/ip4/172.16.8.19/tcp/9000/p2p/16Uiu2HAmH4iVp7nw5f6fg5fNzhDqpVqjmuts6wyPcSZMRWuvjQyS", "peer_id": "16Uiu2HAmH4iVp7nw5f6fg5fNzhDqpVqjmuts6wyPcSZMRWuvjQyS", "state": "connected"}, "server": "http://127.0.0.1:9463"}

@Alleysira
Copy link

Another minor issue:

Should the env field be set to null when the value is not available? The spec defines enr as either null or a string, and I believe null is intended for cases where the value is unavailable. However, in the above response, Lodestar returns an empty string "" instead.

@nflaig
Copy link
Member Author

nflaig commented Jun 4, 2025

Should the env field be set to null when the value is not available? The spec defines enr as either null or a string, and I believe null is intended for cases where the value is unavailable.

ethereum/beacon-APIs#80 seems we should definitely set it to null according to this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope-api Issues related to APIs
Projects
None yet
Development

No branches or pull requests

3 participants