From 629af2eb4b6bfb5ef6f52504649e267e99f57e1f Mon Sep 17 00:00:00 2001 From: Ivan Wang Date: Wed, 1 Apr 2026 14:29:17 +0800 Subject: [PATCH] fix(rpc): remove 0x prefix from admin_peers id to match go-ethereum format B256::to_string() / Display always prepends "0x" via alloy-primitives FixedBytes::fmt_hex. Replace with alloy_primitives::hex::encode() which emits a bare 64-char hex string, matching go-ethereum's admin_peers output. The node_info handler already uses the same hex::encode pattern (line 160), so this change makes the two handlers consistent. --- crates/rpc/rpc/src/admin.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/rpc/rpc/src/admin.rs b/crates/rpc/rpc/src/admin.rs index af5e1ae2ef9..9e02277c17d 100644 --- a/crates/rpc/rpc/src/admin.rs +++ b/crates/rpc/rpc/src/admin.rs @@ -76,7 +76,7 @@ where for peer in peers { infos.push(PeerInfo { - id: keccak256(peer.remote_id.as_slice()).to_string(), + id: alloy_primitives::hex::encode(keccak256(peer.remote_id.as_slice())), name: peer.client_version.to_string(), enode: peer.enode, enr: peer.enr,