Giter Site home page Giter Site logo

Comments (2)

ajsutton avatar ajsutton commented on July 17, 2024

The optimised version of this makes sense to me except that we then can't stream the results effectively. There may be use cases where we do know the number of results required, but for Teku we need to find some number of nodes meeting a specific criteria which may require scanning more nodes. That would then essentially devolve to the unoptimised case where we have to get every node to ensure we actually get enough once filtered.

It would be doable though if we passed in a Predicate to allow filtering the nodes (potentially out of order).

from discovery.

SangameswaranRS avatar SangameswaranRS commented on July 17, 2024

Yes, Totally agree with you @ajsutton Actually I faced the same myself.

It totally makes sense as we need some ACTIVE k peers, we won't be knowing how much we should traverse in order to get k

Also, its a great insight to pass a Predicate, so that we'd know if we have streamed enough from the buckets.

Also I faced a weird case when streaming buckets the way I posited. For small values of N its working fine, (Tested over many iterations), but for larger values of N there is sometimes a node which is closer in bucket b+1 than b. (Since they share exactly cpl prefix bits), but there are some, cases like CPL bits....mismatch..mismatch vs CPL bits .... mismatch ..match , leading the xor distance to be smaller than bucket b+1.

Yeah, anyway we need to sort, the go-libp2p-kbucket guys also sort at the end to handle cases like this. So I think It makes sense only if we limit our traversing when we have enough peers.

from discovery.

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.