fix(ignition): Pass global config to Ignition helper implementations #7641
+116
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a bug where global
hre.config.ignitionsettings (likerequiredConfirmations,blockPollingInterval, etc.) are not propagated toignition.deploy()when called from scripts.Problem
The Ignition helper implementations (
EthersIgnitionHelperImplandViemIgnitionHelperImpl) are instantiated without passing the global configuration fromhre.config.ignition. This causes deployments to fall back to default values instead of respecting user configuration.For example, setting
requiredConfirmations: 1inhardhat.config.tshas no effect, and deployments use the default value of5, causingIGN403: WAITING_FOR_CONFIRMATIONSerrors on networks with lazy mining.Root Cause
The network hook handlers instantiate the helper implementations with only 3 arguments, omitting the optional 4th parameter
config?: Partial<DeployConfig>:v-next/hardhat-ignition-ethers/src/internal/hook-handlers/network.ts:24-27v-next/hardhat-ignition-viem/src/internal/hook-handlers/network.ts:24-27This leaves
this.#configasundefinedin the helper instances, so when thedeploy()method merges configurations, only per-deployment config and defaults are used.Solution
Pass
context.config.ignitionas the 4th parameter when instantiating both helper implementations. This ensures the global configuration is properly merged with per-deployment config, establishing the correct precedence:defaultConfig→hre.config.ignition→ per-deployment configChanges
v-next/hardhat-ignition-ethers/src/internal/hook-handlers/network.tsto passcontext.config.ignitiontoEthersIgnitionHelperImplconstructorv-next/hardhat-ignition-viem/src/internal/hook-handlers/network.tsto passcontext.config.ignitiontoViemIgnitionHelperImplconstructorTesting
Verified that:
hre.config.ignitionsettings are now respected inignition.deploy()callsdeploytask continues to work correctly (it was already working)Related Issues
Fixes #7640