Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Idea: Replace protocolId with the genesis hash #7746

@tomaka

Description

@tomaka

At the moment, most networking protocols contain what is called the protocolId, defined in the chain specs.
For example, the syncing protocol of Polkadot is named /dot/sync/2, because Polkadot has protocolId: "dot" in its chain specs.

Instead of using a user-chosen protocolId, we could name the protocol using the hash of the genesis block.
The sync protocol could for example become /91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3/sync/2.

The advantage of doing so is that things become "automatic". No need to define your own protocolId anymore, and no need to verify whether the genesis hash is the same between two nodes during the blocks announce handshake.

The drawback is obviously that this is longer than just dot, so more bytes are transmitted on the network. The multistream-select protocol requires protocol names to be string.
To mitigate this, we could use an encoding other than hex encoding of the hash. Using a different encoding might however make things confusing.

This also depends on how we tackle #7458. After #7458, the definition of "genesis block" might become a bit blurry.

Metadata

Metadata

Assignees

Labels

J0-enhancementAn additional feature request.

Type

No type

Projects

Status

done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions