Implement `hardhat_setChainId`
We should implement this method, as it's useful for testing things like EIP-712 related functionality
This issue is also being tracked on Linear.
We use Linear to manage our development process, but we keep the conversations on Github.
LINEAR-ID: 0f6a69b7-ab70-4c75-9353-c1888ff77420
This comes from a conversation with Ryan about https://github.com/NomicFoundation/hardhat/pull/3060 — I think hardhat_setChainId would be a better alternative to #3060
Following up on this. hardhat_setChainId approach would be better as it would allow setting the chain id without resetting state (simulation of a network fork), but is quite a bit more invasive. I believe that both approaches would be ideal as the most often use-case to set the chainId is with a network reset. Having #3060 functionality would be better than requiring two rpc calls to reset network with a new chainId.
Agreed with having a hardhat_setChainId. EIP-712 is pretty common and it would be useful to have tests for network-fork-proofing.