Skip to content
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

Add chainId and chainspec validation to peering process #646

Closed
Voxelot opened this issue Sep 26, 2022 · 1 comment · Fixed by #785
Closed

Add chainId and chainspec validation to peering process #646

Voxelot opened this issue Sep 26, 2022 · 1 comment · Fixed by #785
Assignees
Labels

Comments

@Voxelot
Copy link
Member

Voxelot commented Sep 26, 2022

The peering process should invalidate connections to peers with a different chain id or chain config.

While we currently segment peers based on a network name, we should take further measures to prevent fuel nodes from different networks (e.g. testnet vs mainnet) from peering with each other.

Each chainconfig contains its own unique genesis values such as initial balances or initial state. We also plan to have a chain identifier to help differentiate between testnets with similar genesis values. When connecting to a new peer, we should request a checksum (sha256) of these unique values (chain ID + chain_config) and compare with a local checksum before adding to the peerset.

@leviathanbeak
Copy link
Contributor

Investigated the approach for this,
this can be achieved by applying and implementing inbound/outbound upgrades to libp2p's connections.

Working on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants