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

CfgEnv.chain_id should be u64 #693

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

thedevbirb
Copy link
Contributor

Closes #671. Let me know if I am missing something from this issue!

@thedevbirb thedevbirb changed the title chore(cfg): convert chain_id from u256 to u64 CfgEnv.chain_id should be u64 Sep 6, 2023
@thedevbirb thedevbirb changed the title CfgEnv.chain_id should be u64 CfgEnv.chain_id should be u64 Sep 6, 2023
@DaniPopes
Copy link
Collaborator

hm actually i realized this is wrong, realistically chain id is a u64 but users should be able to set any arbitrary u256 in the EVM

@rakita
Copy link
Member

rakita commented Sep 7, 2023

hm actually i realized this is wrong, realistically chain id is a u64 but users should be able to set any arbitrary u256 in the EVM

This is one of those ambiguous things where the upper limit was not specified but all the "chains" use u64, so it is a good call to use u64.

Here is a site that lists chain ids: https://chainlist.org/
from github list is here: https://github.com/DefiLlama/chainlist/blob/main/constants/chainIds.json
And biggest value is: 836542336838601

Copy link
Member

@rakita rakita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rakita rakita merged commit 616cc7e into bluealloy:main Sep 7, 2023
7 checks passed
@DaniPopes
Copy link
Collaborator

DaniPopes commented Sep 7, 2023

Makes sense, this is also enforced in Foundry:

https://github.com/foundry-rs/foundry/blob/675a824648b6259c1566009b79356a4fc109b6ac/crates/evm/src/executor/inspector/cheatcodes/env.rs#L548-L552

mikelodder7 pushed a commit to LIT-Protocol/revm that referenced this pull request Sep 12, 2023
Evalir pushed a commit to Evalir/revm that referenced this pull request Sep 14, 2023
@github-actions github-actions bot mentioned this pull request Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CfgEnv.chain_id should be u64
3 participants