Comments (2)
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.
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)
- Investigate lack of peers reported by MainNet bootnodes HOT 1
- Continue retrying bootnodes
- Don't include address in ENR until it is known
- Check for recently evicted peers before adding them to the node table. HOT 3
- Discovery: ConcurrentModificationException in Bucket.getLiveNodes
- Replace web3j crypto
- DiscoveryIntegrationTest intermittently fails
- `NPE` during handshake
- Unhandled IllegalArgumentException
- Unhandled NullPointerException
- discovery-tasks-1 | ERROR | DefaultSchedulers | Unhandled exception (1)
- Errors from discovery v5 HOT 1
- hash(homeNodeId) can be cached
- DiscoveryNetworkTest intermittently fails
- Pack the Nodes message more tightly HOT 2
- checkTalkMessageHandling() intermittently fails HOT 1
- Verification not passed errors
- Adding SECP256R1 support to be NIST compliant
- Add a new method, NodeRecordFactory.fromEnr(String enr)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discovery.