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

EVM BetaNet returns MainNet chain ID #3781

Open
artob opened this issue Jan 5, 2021 · 14 comments
Open

EVM BetaNet returns MainNet chain ID #3781

artob opened this issue Jan 5, 2021 · 14 comments
Assignees
Labels
A-EVM Area: Native EVM implementation and support C-bug Category: This is a bug T-SRE Team: issues relevant to the SRE team

Comments

@artob
Copy link
Contributor

artob commented Jan 5, 2021

As discussed on our 2021-01-04 call, the EVM's [CHAINID](https://eips.ethereum.org/EIPS/eip-1344) opcode on betanet currently returns the registered value for mainnet:

@artob artob added C-bug Category: This is a bug A-EVM Area: Native EVM implementation and support labels Jan 5, 2021
@ilblackdragon
Copy link
Member

This is a configuration issue on the betanet in the genesis.json

CC @chefsale

@chefsale
Copy link
Contributor

chefsale commented Jan 8, 2021

I just checked the genesis.json hosted on S3 here: https://s3.console.aws.amazon.com/s3/object/build.nearprotocol.com?region=us-west-1&prefix=nearcore-deploy/betanet/genesis.json which nearup is using and the current betanet network RPC also returns betanet: http://rpc.betanet.near.org/status.

@artob are you sure you are have setup the node correctly? Can you provide more information on how did you reproduce this?

@chefsale
Copy link
Contributor

chefsale commented Jan 8, 2021

@artob also if you are just running: neard init --chain-id betanet make sure you clean your ~/.near folder and try using neard init --chain-id betanet --download-genesis to get latest genesis download, as we also do a hardforks on betanet on protocol changes. So, I would advise to make a clean start with new near dir.

@ilblackdragon
Copy link
Member

@chefsale Sorry for confusion, this issue is not about chain_id field but about new evm_chain_id field. evm_chain_id field should not be 1313161554 (which is MainNet evm_chain_id). We also registered 1313161555 for TestNet. So BetaNet prob should have 1313161556.

@artob
Copy link
Contributor Author

artob commented Jan 11, 2021

@chefsale Yes, as @ilblackdragon noted, this is about what the EVM's CHAINID opcode returns. I'll edit the issue to make that clearer.

@chefsale chefsale added this to the SRE 2021.01.04 - 2021.01.31 milestone Jan 12, 2021
@chefsale
Copy link
Contributor

It seems like the only place where we specify the chain ids for evm is here: https://github.com/near/nearcore/blob/master/core/chain-configs/src/genesis_config.rs, but we specify them for MAINNET_EVM_CHAIN_ID and TEST_EVM_CHAIN_ID, but we don't for betanet, so this seems like it's missing and is probably the cause for this. Just and assumption. cc: @artob

@chefsale
Copy link
Contributor

And then here: https://github.com/near/nearcore/blob/master/neard/src/runtime.rs#L1397 we are not handling this properly, sending a fix.

@chefsale chefsale self-assigned this Jan 12, 2021
@chefsale chefsale added the T-SRE Team: issues relevant to the SRE team label Jan 12, 2021
@chefsale
Copy link
Contributor

PR which I believe should be the fix: #3800 cc: @mikedotexe @artob @ilblackdragon

@artob
Copy link
Contributor Author

artob commented Jan 14, 2021

@chefsale Could you let me know when the changes from #3800 have been deployed to the betanet, please, and I'd go ahead and test that this has been resolved. (In general, do we have a dashboard that shows what betanet nodes are currently running?)

@artob artob assigned artob and unassigned mikedotexe Jan 14, 2021
@chefsale
Copy link
Contributor

@artob, sure they should be deployed in 20 minutes by the daily cron job.

@chefsale
Copy link
Contributor

@artob the deploy has happened: https://buildkite.com/nearprotocol/deploy-betanet/builds/210. It was already done when you pinged me I just mixed up the time of the cron job.

@artob artob changed the title EVM betanet returns mainnet chain ID EVM BetaNet returns MainNet chain ID Jan 14, 2021
@artob
Copy link
Contributor Author

artob commented Jan 14, 2021

Turns out near-web3-provider has a bug regarding chain IDs (aurora-is-near/near-web3-provider#71), so I'll need to test this by deploying an actual Solidity contract. I'll aim to come back to this tomorrow.

@bowenwang1996
Copy link
Collaborator

@artob what is the latest on this?

@stale
Copy link

stale bot commented Sep 27, 2021

This issue has been automatically marked as stale because it has not had recent activity in the last 2 months.
It will be closed in 7 days if no further activity occurs.
Thank you for your contributions.

@stale stale bot added the S-stale label Sep 27, 2021
@akhi3030 akhi3030 removed the S-stale label Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-EVM Area: Native EVM implementation and support C-bug Category: This is a bug T-SRE Team: issues relevant to the SRE team
Projects
None yet
Development

No branches or pull requests

6 participants