-
Notifications
You must be signed in to change notification settings - Fork 690
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
Implement RFC 8: store parachain bootnodes in the relay chain DHT #1825
Comments
This issue has been mentioned on Polkadot Forum. There might be relevant details there: https://forum.polkadot.network/t/smoldot-updates-threads/4471/4 |
This issue has been mentioned on Polkadot Forum. There might be relevant details there: https://forum.polkadot.network/t/smoldot-updates-threads/4471/8 |
If someone is implementing this any time soon, they might want to keep in mind that polkadot-fellows/RFCs#59 aims to make the mechanism slightly more generic than what is described in RFC 8. |
We had some internal discussions regarding the issue, and it seems it is quite easy to generate enough peer IDs to either:
For (1) the amount of peer IDs to generate to get closer to the target key than all the parachain nodes is in the order of number of parachain nodes, and for 20 such IDs is in the order of To have close to 1 probability of taking over the bootnodes the amount of peer IDs to generate is higher, but the order is still the same. @tomaka am I missing something? |
This PR is about implementing polkadot-fellows/RFCs#8
(note: I'm opening this issue before the RFC is accepted because I assume it will be unanimously accepted, will close if it's not the case)
There are two different but related aspects to this RFC that need to be implemented:
The DHT registration described in the RFC should use
Kademlia::start_providing
.Looking for other nodes should use
get_providers
.As I mention in the RFC text, I believe that rust-libp2p already hashes the key.
The RFC says that the key is
sha256(concat(scale_compact(para_id), randomness))
, but since rust-libp2p already hashes it, what you need to pass as parameter is instead justconcat(scale_compact(para_id), randomness)
.Since the authority discovery system is already using Kademlia, I would expect the wiring between the parachain node and the relay chain Kademlia to not encounter any major obstacle. The authority discovery system is not using Kademlia's providers system but straight-up Kademlia records, so you probably need to add a few functions that are similar to the existing one but not exactly the same.
The way I would expect the registration to be implemented is to start a background task that in a loop: queries
Babe_current_epoch
&Babe_next_epoch
, updates the providers registration if necessary, then sleeps for a few minutes.Implementing it this way means that for each node the registration would take a different amount of time (up to a few minutes) between the moment when the Babe epoch changes and the moment when the registration updates, which as mentioned in the RFC is a good thing in order to avoid a spike of traffic to the nodes handling the DHT records.
Are you willing to help with this request?
Only by answering questions regarding the RFC.
The text was updated successfully, but these errors were encountered: