Skip to content

fix(l1): update existing contact ENR on FINDNODE distance 0 response #6166

@ElFantasma

Description

@ElFantasma

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions