Change chain IDs to 256-bit numbers #353
Merged
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.
Currently a size limit on chain IDs isn't well-defined (see https://ethereum-magicians.org/t/eip-2294-explicit-bound-to-chain-id). Some tools use an unsigned 64-bit integer (including
alloywhich is one of our dependencies), some use an unsigned 52-bit integer (since that's the highest value that fits without error into floats, which JS uses), but the largest value canonically is an unsigned 256-bit integer, used by Geth and friends in the EVM implementation itself.One of the reasons the 256-bit version is popular is because it lets people use
keccak256("some_relevant_string")as their Chain ID to avoid collisions. Until there's an official spec designation for a size limit, we should stick to 256-bit ones internally to support use-cases like that.Alternatively, we should make it explicit in the documentation that Commit-Boost doesn't support chain IDs larger than the
u64limit; people will not be able to use e.g. the Signer service for custom chains that go out of those bounds.