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

bug: same chain id network config collision #141

Closed
TuDo1403 opened this issue May 23, 2024 · 1 comment
Closed

bug: same chain id network config collision #141

TuDo1403 opened this issue May 23, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@TuDo1403
Copy link
Collaborator

Description

  • Network config defined with identical chain id can result in collision in data config
enum Network {
   RoninTestnetShadow,
   RoninTestnet
}

function chainId(Network network) pure returns (uint256) {
  if (network == Network.RoninTestnet) return 2021;
  if (network == Network.RoninTestnetShadow) return 2021;

  revert("Network: Unknown chain id");
}

Root cause:

  • In NetworkConfig, block.chainid is treated as primary key.
mapping(uint256 chainId => TNetwork network) internal _networkMap;

@TuDo1403 TuDo1403 added the bug Something isn't working label May 23, 2024
@TuDo1403
Copy link
Collaborator Author

resolved in #144

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant