-
Notifications
You must be signed in to change notification settings - Fork 732
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
on chain Heartbeats without external_addresses #646
Comments
could this be related to p2p issues in paritytech/polkadot#6696 ? |
No, we could probably also remove them. I don't know why we added them back in the days, maybe it was planed to be used as authority discovery. However, authority discovery works now using the dht which you probably also should use for your work. Nevertheless, this list should not be empty as each node should learn the external addresses from the nodes they are connected to. Could someone from @paritytech/networking please look into this? Aka that the external addresses are working? It should be this call. |
@bkchr Ok, we will start looking into how to use the DHT in case that list is removed. In my opinion it is positive to leave on chain information about IP topology, in case we wanted to implement on-chain mechanisms to promote decentralization. The obvious would be a staking plus/accelerator for periphery networks and regions. Staking already implements other policies such as slashing, etc. But in that case the Heartbeat functionality would require some kind of validation prior to being added to chain... the most obvious would be to check that the address reported in by DHT for the peer is actually one of the listed in external_addresses. Then the field would become something like a topology oracle for our network. |
Not sure how this should work and if we need this we can bring back the information.
The nodes are controlling the addresses that you find in the DHT and the ones that you put into the heartbeat. So, you could only ensure that an attacker is not too dumb to make sure that both are using the same list. |
I am assuming that if the DHT does not hold correct information the p2p protocol would just not work, the node would not get connections, etc. |
No, the DHT is used to find specific nodes. Random connections are done differently. Nodes are connecting to the boot nodes and they send all their known nodes. Then your local nodes starts connecting to these nodes. |
Understood. |
@bkchr I keep looking into the disappearance of external_addresses from the Heartbeat. Regardless of whether external_addresses field is needed or not, I agree with your statement above. After looking at the data, I found out more:
The following 60 day chart represent when the issue appears (in blue), I would say about a month ago. |
Is this around the 0.9.41 release? |
The date we start to see the increase is actually April 5th, which also matches the release date of 0.9.41. I guess one of the big operators with many nodes upgraded on that date, if the issue came with the .41 |
I've just checked and external addresses seem to work fine (kusama). I.e. the node learns its external addresses over time and adds them to the list. |
https://github.com/paritytech/substrate/compare/polkadot-v0.9.40..polkadot-v0.9.41 I can't find anything in |
So you say it works? Then we can close this issue? @rvalle do you still see this behavior of empty addresses in |
Yes
|
May be there is some issue with adding external addresses on chain, not with discovering them? |
@dmitry-markin at what point do we add them? here https://github.com/paritytech/substrate/blob/dca6ebeb4dac3aac301a475cd52d5566dbc7a9ef/client/offchain/src/api.rs#L161-L166 is the call, right? |
To be honest I don't know, I'm not familiar with this part of the codebase. That was just my assumption. |
You can just test this locally by letting some nodes run and check that the heartbeat contains the addresses. |
@bkchr According to our indexer, in Kusama, I can see many, very recent ones like this: https://kusama.subscan.io/extrinsic/18066716-5
These are latest Event-IDs with null address, sorted by block number in descending order. The Address information is in the extrinsic, and shows as null. In Polkadot the issue does not seem to be a problem, last occurrence was 400K blocks ago, and seem to be isolated cases:
|
@bkchr we can also see that since block 17M in Kusama, 17 Validators have issued this kind of event:
We could notice that the validators where from different node operators too, so, there must be some kind of obscure condition that triggers the issue. |
Users should use DHT for discovering new nodes. The reason for adding external addresses was unstable work of authority discovery (see paritytech#2719), which is now stable. Hence we can safely remove `external_addresses`. Refs https://github.com/paritytech/polkadot/issues/7181
* [frame/im-online] remove `external_addresses` from heartbeats Users should use DHT for discovering new nodes. The reason for adding external addresses was unstable work of authority discovery (see #2719), which is now stable. Hence we can safely remove `external_addresses`. Refs https://github.com/paritytech/polkadot/issues/7181 * remove unused import * run benchmark * remove external_addresses from offchain NetworkState * add missing fn to TestNetwork * Revert "run benchmark" This reverts commit a282042. * update weights * address @bkchr comments * remove duplicate fn * cleanup benchmarking.rs * fix executor tests * remove peer_id from hearbeat as well #14251 (comment) * remove MaxPeerDataEncodingSize * change storage value type to `()` #14251 (comment) * scaffold storage migration * no need to check the type actually * remove unnecessary types from v0 mod * add a test for migration * expose Config types + pre_upgrade and post_upgrade working fn * fix test * replace dummy type with ConstU32 * add some comments to migration test * fix comment * respond to @bkchr comments * use BoundedOpaqueNetworkState::default intead of using default for each field
) * [frame/im-online] remove `external_addresses` from heartbeats Users should use DHT for discovering new nodes. The reason for adding external addresses was unstable work of authority discovery (see paritytech#2719), which is now stable. Hence we can safely remove `external_addresses`. Refs https://github.com/paritytech/polkadot/issues/7181 * remove unused import * run benchmark * remove external_addresses from offchain NetworkState * add missing fn to TestNetwork * Revert "run benchmark" This reverts commit a282042. * update weights * address @bkchr comments * remove duplicate fn * cleanup benchmarking.rs * fix executor tests * remove peer_id from hearbeat as well paritytech#14251 (comment) * remove MaxPeerDataEncodingSize * change storage value type to `()` paritytech#14251 (comment) * scaffold storage migration * no need to check the type actually * remove unnecessary types from v0 mod * add a test for migration * expose Config types + pre_upgrade and post_upgrade working fn * fix test * replace dummy type with ConstU32 * add some comments to migration test * fix comment * respond to @bkchr comments * use BoundedOpaqueNetworkState::default intead of using default for each field
The information do not exist anymore. |
Hi
We are detecting a growing number of Heartbeats in the Kusama network that come with null external_addresses.
Here is an example.
We currently use that information to perform decentralization analytics and I believe the network requires the validators to issue HBs in order to get active, however, is the external_addresses list validated somehow?
The text was updated successfully, but these errors were encountered: