Update the default outputSelection setting of solc to decrease the artifacts size#8121
Update the default outputSelection setting of solc to decrease the artifacts size#8121alcuadrado merged 6 commits intomainfrom
outputSelection setting of solc to decrease the artifacts size#8121Conversation
🦋 Changeset detectedLatest commit: 12a3a2e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
schaable
left a comment
There was a problem hiding this comment.
Looks good. I left a nitpick and a question.
There was a problem hiding this comment.
Pull request overview
Updates Hardhat’s default Solidity compiler outputSelection to request a narrower, explicitly enumerated subset of outputs (instead of the broader evm.bytecode / evm.deployedBytecode / metadata), with the goal of reducing generated artifact/build-info output size.
Changes:
- Introduce
DEFAULT_OUTPUT_SELECTIONand reuse it from both config resolution and compilation job solc-input construction. - Update compilation job behavior/tests to reflect the new default selector set (and removal of
metadata). - Update ignition-core test fixtures that hardcode the build info id affected by the changed solc input.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/ignition-core/test/helpers/execution-result-fixtures.ts | Updates hardcoded build info id fixture values after solc input/outputSelection change. |
| packages/hardhat/test/internal/builtin-plugins/solidity/build-system/compilation-job.ts | Updates expected outputSelection in tests to match the new defaults. |
| packages/hardhat/src/internal/builtin-plugins/solidity/constants.ts | Adds shared DEFAULT_OUTPUT_SELECTION definition. |
| packages/hardhat/src/internal/builtin-plugins/solidity/config.ts | Switches compiler config defaults to use DEFAULT_OUTPUT_SELECTION. |
| packages/hardhat/src/internal/builtin-plugins/solidity/build-system/compilation-job.ts | Ensures compilation jobs always include the shared default selectors when building solc input. |
| .changeset/tiny-mangos-glow.md | Adds a patch changeset entry for the Hardhat package. |
| "*": [ | ||
| "abi", | ||
| "evm.bytecode.linkReferences", | ||
| "evm.bytecode.object", | ||
| "evm.bytecode.opcodes", | ||
| "evm.bytecode.sourceMap", | ||
| "evm.deployedBytecode.immutableReferences", | ||
| "evm.deployedBytecode.linkReferences", | ||
| "evm.deployedBytecode.object", | ||
| "evm.deployedBytecode.opcodes", | ||
| "evm.deployedBytecode.sourceMap", | ||
| "evm.methodIdentifiers", | ||
| ], |
There was a problem hiding this comment.
The default outputSelection now uses granular selectors (e.g. evm.deployedBytecode.immutableReferences, evm.bytecode.sourceMap, etc.). Since Hardhat supports compiling a wide range of solc versions (including older 0.4.x/0.5.x via solc-js), some of these selector paths may not be accepted by older compilers. Please add a regression test that compiles with the oldest supported solc version using the default settings (or gate/fallback the selector list by solc version) so compilation doesn’t fail on older versions.
| "*": [ | |
| "abi", | |
| "evm.bytecode.linkReferences", | |
| "evm.bytecode.object", | |
| "evm.bytecode.opcodes", | |
| "evm.bytecode.sourceMap", | |
| "evm.deployedBytecode.immutableReferences", | |
| "evm.deployedBytecode.linkReferences", | |
| "evm.deployedBytecode.object", | |
| "evm.deployedBytecode.opcodes", | |
| "evm.deployedBytecode.sourceMap", | |
| "evm.methodIdentifiers", | |
| ], | |
| "*": ["abi", "evm"], |
There was a problem hiding this comment.
good point, i added tests for this
1378ce0 to
12a3a2e
Compare
No description provided.