Description
new_contact_records() in peer_table.rs only inserts new contacts (uses Entry::Vacant). When a NODES response arrives with an updated ENR for an already-known peer, it is silently discarded.
There's an existing TODO in the code:
// TODO Handle the case the contact is already present
This means the ENR update flow added in #5910 (sending FINDNODE distance 0 when PONG enr_seq differs) has no practical effect — the request is sent but the response can't update the existing record.
Expected behavior
When a NODES response contains an ENR for a peer already in the contact table, the cached ENR should be updated (after signature validation) if the new sequence number is higher.
References