chainIdentifier cannot be nested in the {chainIdentifier}-{version} format #1646
+13
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#1467
In the case of a chain id like minepflex-testnet-2-5, when converted to the {chainIdentifier}-{version} format, the chainIdentifier becomes minepflex-testnet-2. However, if minepflex-testnet-2 is again converted using the same format, the chainIdentifier becomes minepflex-testnet.
Since existing functions attempt this kind of format conversion internally to support both chainId and chainIdentifier, the final result is that minepflex-testnet-2-5 ends up being registered in the permission system with minepflex-testnet as its chainIdentifier.
Fixing this issue within the permission system would cause problems in other functionalities, and it’s difficult to modify all of them individually.
So far, this type of chain id has been rare, and there have been no such cases among the chains registered in KCR.
For now, we will modify the validation logic to reject cases where the chainIdentifier would become nested.