NomicFoundation / hardhat

Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software.
https://hardhat.org
Other
7.18k stars 1.38k forks source link

Verification does not work in ignition when deploying external artifacts #5659

Open sim31 opened 3 weeks ago

sim31 commented 3 weeks ago

Version of Hardhat

2.22.8

What happened?

I'm using ignition to deploy contracts from external repository by specifying artifacts to deploy as described in the docs.

Getting this error when running `npx hardhat ignition verify...:

Error: ENOENT: no such file or directory, open '/home/tadas/sources/sim31/frapps/impl/ordao/sc-deployment/ignition/deployments/op-sepolia-1/artifacts/Orec#Orec.dbg.json'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/home/tadas/sources/sim31/frapps/impl/ordao/sc-deployment/ignition/deployments/op-sepolia-1/artifacts/Orec#Orec.dbg.json'
}

When I place the expected debug file, the error goes away.

Then another error appears:

Error: ENOENT: no such file or directory, open '/home/tadas/sources/sim31/frapps/impl/ordao/sc-deployment/ignition/deployments/build-info/2bf29f558aacadc638c9589b99d7fcc1.json'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/home/tadas/sources/sim31/frapps/impl/ordao/sc-deployment/ignition/deployments/build-info/2bf29f558aacadc638c9589b99d7fcc1.json'
}

Again I solve this by copying expected build-info files to the expected place. Then finally verification works.

Would be nice if ignition would either handle this automatically (although I understand that the user would then have to specify these debug and build-info files somehow) or there would be some warnings in the docs about these extra manual steps.

Minimal reproduction steps

  1. Create sample hardhat project 1, compile it;
  2. Create hardhat project 2, create ignition module that tries to deploy artifact from project 1 (as described here);
  3. Use ignition to deploy to testnet (I was deploying to OP Sepolia)
  4. Try using ignition to verify testnet deployment

Search terms

ignition, verification

kanej commented 3 weeks ago

I think there are a several things we should consider doing here:

  1. Provide a warning before deploying if external artifacts are detected indicating that verification won't be possible (due to lack of build info).
  2. Add a mechanism to allow associating an external artifact with the build info needed to do a full verification