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

IGN403 should be aware of development networks #793

Open
fvictorio opened this issue Aug 16, 2024 · 3 comments
Open

IGN403 should be aware of development networks #793

fvictorio opened this issue Aug 16, 2024 · 3 comments
Labels
status:ready This issue is ready to be worked on

Comments

@fvictorio
Copy link
Member

Assuming Ignition has some way to know that a network is a development network, then IGN403: You have sent transactions from 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 and they interfere with Hardhat Ignition. Please wait until they get 5 confirmations before running Hardhat Ignition again. shouldn't be thrown for those kinds of networks.

To be honest I don't fully understand the reason for this error (and as far as I can tell, Ignition doesn't have a reference with expanded explanations about errors like Hardhat does). But I can imagine someone starting a node, running a transaction with the default account, and then trying to deploy something with Ignition. I can imagine it because it just happened to me.

One easy way to detect if a network is a development network is to send a hardhat_metadata request. If it doesn't fail, then it's a development node. This works both on Hardhat and Anvil.

@fvictorio
Copy link
Member Author

Something similar happens when you deploy on a Hardhat or Anvil node with automining disabled. When the deployment transactions are (manually) mined, Ignition hangs. You have to mine four or five blocks more for the deployment task to finish.

I guess the underlying reason here might be the same: there is a "safe" number of blocks used to consider a transaction finalized. If that's the case, I think that number should be 0 for development networks.

@kanej kanej moved this to Todo in Hardhat Ignition Aug 19, 2024
@kanej kanej added status:ready This issue is ready to be worked on and removed status:triaging labels Aug 19, 2024
@kanej
Copy link
Member

kanej commented Aug 19, 2024

We detect whether a network has automining enabled. If automining is enabled we don't require confirmations. If automining is disabled we use the config value for required confirmations (there might be some weird rules for private besu chains, but leaving them out of it).

I think the feature your requesting is, "detect a development node with automing off and set a the number of required confirmations to 1"?

This in effect would add three categories:

  1. Normal network (use config for required confirmations)
  2. Development network with Automining on (use different strategy for confirmation)
  3. Development network with automining off (override config for required confirmations and set it to 1).

@fvictorio
Copy link
Member Author

That makes sense to me, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready This issue is ready to be worked on
Projects
Status: Todo
Development

No branches or pull requests

3 participants