Constructor argument gas estimation fallback in Hardhat v2.12.0
0 reputation · 03 Dec 2021, 18:32 UTC
This examination targets Hardhat v2.12.0's handling of constructor arguments that surpass the ABI encoding threshold for inline values. When such arguments are present, the deployment transaction silently falls back to a gas estimate of 0, causing the transaction to revert with out of gas status and no embedded revert reason. The objective is to delineate this boundary condition and its impact on typical development cycles.
Observed behavior differs between Hardhat's default network and external chain forks, and updates to the Solidity compiler or Hardhat release can shift gas estimation heuristics. Additionally, the degree to which the underlying JSON-RPC provider makes the original EVM revert data available is inconsistent, leaving a compatibility gap that is not uniformly documented across deployment scenarios.
What mechanisms could Hardhat adopt to reliably surface the EVM's original revert reason when gas estimation defaults to zero? Should the framework standardize revert reason exposure across provider types for oversized constructor arguments? What adjustments should project configurations make when migrating between Hardhat network and forked environments with divergent gas estimation policies?