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

feat: implement hardhat_metadata API endpoint #455

Open
kiriyaga-txfusion opened this issue Nov 29, 2024 · 0 comments
Open

feat: implement hardhat_metadata API endpoint #455

kiriyaga-txfusion opened this issue Nov 29, 2024 · 0 comments

Comments

@kiriyaga-txfusion
Copy link

🌟 Feature Request

📝 Description

Returns an object with metadata about the instance of the Hardhat Network. This object contains:

  • clientVersion: A string identifying the version of Hardhat, for debugging purposes, not meant to be displayed to users.
  • chainId: The chain's id. Used to sign transactions.
  • instanceId: A 0x-prefixed hex-encoded 32 bytes id which uniquely identifies an instance/run of Hardhat Network. Running Hardhat Network more than once (even with the same version and parameters) will always result in different instanceIds. Running hardhat_reset will change the instanceId of an existing Hardhat Network.
  • latestBlockNumber: The latest block's number in Hardhat Network.
  • latestBlockHash: The latest block's hash in Hardhat Network.
  • forkedNetwork: An object with information about the forked network. This field is only present when Hardhat Network is forking another chain. Its fields are:
  • chainId: The chainId of the network that is being forked
  • forkBlockNumber: The number of the block that the network forked from.
  • forkBlockHash: The hash of the block that the network forked from.

🤔 Rationale

To temporarily cache upgradable contracts for the development network in the hardhat-zksync-upgradable plugin, an endpoint is required to fetch the instanceId, which is unique to the network and changes with each run.

@kiriyaga-txfusion kiriyaga-txfusion changed the title feat: implement hardhat_metadata API endpoint feat: implement hardhat_metadata API endpoint Nov 29, 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

No branches or pull requests

1 participant