-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Welcome Basket" for new nodes #350
Comments
How would this actually work for trie-node/archive style state data? If it needs proof matter... then we're talking about nodes storing a significant overhead of proof data that they otherwise wouldn't be holding in storage... the data closest to them is fundamentally likely to be uniformly randomly distributed across the state trie... trie node based state data is the worst. Overall I like the concept but I'm struggling to figure out how it would get applied to the data we most need it to apply to. |
Problem
Collecting network data near your node ID as a fresh peer is slow. It's been tolerable on history, but gets painfully slow on state.
Previous Proposal: Range Queries
We've talked about ways to address this before. The main proposal I remember is running range-queries on peers. But I don't think we overcame the general concern about asking a peer to do arbitrary work. Also, trie-node data is typically not stored with enough info to prove that it's canonical, to requesting peers.
New Proposal: Welcome Baskets
We could have every node prepare its own Welcome Basket to offer to new neighbors.
Requesting a Basket
When a peer joins the network, and is looking to populate its database, it first works to fill its peer buckets. When it finds peers that are nearby itself (roughly within its own estimated radius), it asks for a welcome basket.
What's in the Basket?
The basket is a heterogeneous collection of all types of content keys, values and inclusion proofs for the network.
The basket almost certainly does not include all of a mature peer's content (though it might for a very new one). When selecting which content to include in its basket, a peer should prefer content closest to its own node ID. This way, collections of baskets from different peers should create a wider coverage.
The Welcome Basket is not filtered by the transmitting peer. That work is left up to the receiving peer.
How big should we allow the basket to grow? 🤷🏻♂️ TBD
Generating a Basket
Every peer would be responsible for generating a welcome basket. Brand new peers would have an empty one, of course. Baskets should not be created on-demand. They should be pre-generated in a background process, or incrementally generated as new offers come in. The data must be fully provable to other peers.
The cost of sending a Welcome Basket should be trivial.
Goal
Welcome Baskets can give new nodes a quick jolt of data, so they can instantly start contributing to the network.
It's not a goal to immediately fill up new nodes. This just accelerates the first stages of the onboard process.
The text was updated successfully, but these errors were encountered: