Giter Site home page Giter Site logo

discv5: define ENR exchange about devp2p HOT 5 CLOSED

ethereum avatar ethereum commented on July 20, 2024
discv5: define ENR exchange

from devp2p.

Comments (5)

fjl avatar fjl commented on July 20, 2024

Simple idea for pull-style sync: Add highest-known sequence number of destination node to the PING packet. Define that nodes should return their local record in PONG if seq is higher than the one in PING.

from devp2p.

FrankSzendzielarz avatar FrankSzendzielarz commented on July 20, 2024

Thinking about the 1st question, can we list some of the scenarios under consideration?:

  • Node changes IP/port
  • Node changes its identity?
  • Node changes id scheme
  • Other stuff in the ENR that does not affect the id/handshake eg: "Client Name: geth" or some such...

If the node is changing the IP/port, then push or pull it's an attack scenario [i.e. 1) I establish handshake, 2) my enr goes into peer dht 3) i tell peer 'hi I am now on a different ip' but my source IP is spoofed] So....maybe prefer to push (well, the peer can't pull from an old ip or port) but in this case the recipient verifies the incoming UpdateMe message with the WhoAreYou (and nonce) to verify ?
Problem: what if two nodes need to update themselves to each other at the same time? They wouldn't be able to without an intermediary. Unsolvable non-issue?

If the Node is changing identity...similar? But the node should be able to announce in advance? Over existing channel, send "UpdateMe" and again re-establish channel.

If nothing channel-related updated, take UpdateMe message , process and preserve existing channel?

from devp2p.

fjl avatar fjl commented on July 20, 2024

Been thinking about this in the context of EIP-868 last few days. We need a similar mechanism for v4 to implement record sync on top of the new enrRequest. I'll implement it as follows:

When a node pings us or we receive a pong reply, the sequence number in the message is compared
to the one in the local node table. If our local copy has lower sequence number, we enqueue a request to retrieve the latest version using enrRequest.

from devp2p.

fjl avatar fjl commented on July 20, 2024

Best solution so far: since FINDNODE takes distance, requesting distance zero is equivalent to enrRequest.

from devp2p.

FrankSzendzielarz avatar FrankSzendzielarz commented on July 20, 2024

Yes, for v4. And for v5 bucket zero could represent the same thing. However for the scenario that IP changes, the node may still need a Push message of some type, or otherwise the handshake would need to be reestablished I suppose.

from devp2p.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.