EthDebug info programs are being output to an unexpected location
- Dominant language
- C++
- Stars
- 25.7k
- Forks
- 6.2k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 21
Description
## Description
The EthDebug [Info Schema](https://ethdebug.github.io/format/spec/info/) has a required field `programs`. The compiler currently omits this field. solc instead stores the programs under `contracts.${filename}.${contract_name}.evm.bytecode.ethdebug` and `contract.${filename}.${contract_name}.evm.deployedBytecode.ethdebug`.
## Environment
- Compiler version: Version: 0.8.29+commit.ab55807c.Linux.g++
- Compilation pipeline (legacy, IR, EOF): IR
- Target EVM version (as per compiler settings): osaca
- Framework/IDE (e.g. Foundry, Hardhat, Remix): No
- EVM execution environment / backend / blockchain client: No
- Operating system: WSL
## Steps to Reproduce
```bash
solc --standard-json input.json --pretty-json > ouput.json
```
input.json
~~~json
{
"language": "Solidity",
"sources": {
"contract.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.29;\n\nabstract contract GreeterBase {\n function greet() public view virtual returns (string memory);\n}"
},
"interface.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.29;\n\ninterface IGreeter {\n function greet() external view returns (string memory);\n}"
}
},
"settings": {
"viaIR": true,
"debug": {
"debugInfo": [
"ethdebug"
]
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode.ethdebug",
"evm.deployedBytecode.ethdebug",
"ir",
"irOptimized"
]
}
}
}
}
~~~
output.json
~~~json
{
"contracts": {
"contract.sol": {
"GreeterBase": {
"evm": {
"bytecode": {
"ethdebug": { // <- ethdebug/format/program can be found here
"contract": {
"definition": {
"source": {
"id": 0
}
},
"name": "GreeterBase"
}
}
},
"deployedBytecode": {
"ethdebug": { // <- and here
"contract": {
"definition": {
"source": {
"id": 0
}
},
"name": "GreeterBase"
}
}
}
},
"ir": "",
"irOptimized": ""
}
},
"interface.sol": {
"IGreeter": {
"evm": {
"bytecode": {
"ethdebug": { // <- and here
"contract": {
"definition": {
"source": {
"id": 1
}
},
"name": "IGreeter"
}
}
},
"deployedBytecode": {
"ethdebug": { // <- and here
"contract": {
"definition": {
"source": {
"id": 1
}
},
"name": "IGreeter"
}
}
}
},
"ir": "",
"irOptimized": ""
}
}
},
"ethdebug": {
// "programs": <- but programs are missing here
"compilation": {
"compiler": {
"name": "solc",
"version": "0.8.29+commit.ab55807c.Linux.g++"
},
"sources": [
{
"id": 0,
"path": "contract.sol"
},
{
"id": 1,
"path": "interface.sol"
}
]
}
},
"sources": {
"contract.sol": {
"id": 0
},
"interface.sol": {
"id": 1
}
}
}
~~~
Contributor guide
Research direction
Reproduce the issue with the supplied standard-json input using solc --standard-json, then compare output.json with the EthDebug Info Schema. Trace how ethdebug data is emitted for evm.bytecode and evm.deployedBytecode, and add regression coverage verifying that the required top-level programs field is populated in the expected location.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, solidity
- Domain
- blockchain, compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100