Different bytecode produced via IR for some of OpenZeppelin's contracts when extra contracts are included in the input #15134
Labels
bug 🐛
medium effort
Default level of effort
medium impact
Default level of impact
must have
Something we consider an essential part of Solidity 1.0.
Description
This looks like yet another bug where different AST IDs lead to differences in the generated bytecode. I found it when experimenting with parallel compilation of OpenZeppelin.
When each source file is compiled in isolation by providing only that single file as input (rather than providing all of them and only selecting one via
outputSelection
), three contracts produce different bytecode than when all contracts are compiled together:test/metatx/ERC2771Forwarder.t.sol:ERC2771ForwarderTest
test/token/ERC20/extensions/ERC4626.t.sol:ERC4626StdTest
test/utils/structs/Checkpoints.t.sol:CheckpointsTrace224Test
Environment
Steps to Reproduce
Note: This is a minimized example that's enough to reproduce one of the bytecode differences. With the full input there are more of them and they may or may not have the same cause. To make sure, when the bug is fixed, verify with the full original input:
openzeppelin-5.0.2-full-input.json
. It should produce the same bytecode for the three contracts when compiled as is and when you include only the source files containing those contracts.The text was updated successfully, but these errors were encountered: