paritytech / substrate

Substrate: The platform for blockchain innovators
Apache License 2.0
8.39k stars 2.65k forks source link

expose Kademlia replication factor in node CLI #14374

Closed klbrvik closed 1 year ago

klbrvik commented 1 year ago

What does it do?

Exposes setting Kademlia replication factor through node's CLI.

Why?

Default Kademlia replication factor is 20. In environments (testing for example) with less than 20 nodes AuthorityDiscovery fails to publish DHT records containing node's Multiaddrs. So to make AuthorityDiscovery work in test environments it's useful to have option to manually adjust Kademlia replication factor.

paritytech-cicd-pr commented 1 year ago

The CI pipeline was cancelled due to failure one of the required jobs. Job name: test-linux-stable-int Logs: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2991543

klbrvik commented 1 year ago

Any insight in why CI is failing on completely unrelated things? Was CI changed in the meantime and never ran on latest polkadot-v0.9.41?

altonen commented 1 year ago

Can you merge master and see if that fixes the issue?

klbrvik commented 1 year ago

Can you merge master and see if that fixes the issue?

Merge master into polkadot-v0.9.41?

This branch is 5 commits ahead, 396 commits behind master.

There's a lot of conflicts I'm not comfortable resolving currently. Also 1298 files changed.

I can go ahead and fix stuff that's failing in this PR although it's not related to my changes towards the end of the week. Do you have any other alternatives maybe?

altonen commented 1 year ago

@klbrvik

the changes you introduced were quite trivial so I'd just take a diff and apply it on top of Substrate master and open a new pull request.

klbrvik commented 1 year ago

@altonen will do that, but interested in seeing these changes in polkadot-v0.9.41 branch also. Are they going to land in polkadot-* branches?

Also generally is there strategy for taking master changes and applying them in polkadot-* branches? Haven't seen it described in READMEs if I'm not missing anything. Any hints are appreciated.

altonen commented 1 year ago

They're most likely going to land in polkadot 0.9.44 but I don't think they'll be backported to another other release. If you need them in 0.9.41, you'd have to do it yourself. That would most likely mean maintaining your own version of 0.9.41 that would point to a Substrate branch where you would've cherry-picked Kademlia changes.

klbrvik commented 1 year ago

Thanks @altonen. I'll close this PR then and open new pointing to master.