Skip to content

EthDebug program instructions and environment are mandatory #15999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
RaoulSchaffranek opened this issue Apr 11, 2025 · 0 comments
Open

EthDebug program instructions and environment are mandatory #15999

RaoulSchaffranek opened this issue Apr 11, 2025 · 0 comments
Labels

Comments

@RaoulSchaffranek
Copy link

Description

According to EthDebug spec the environment and instructions fields are required, but solc omits them for interfaces and abstract contracts. See: https://ethdebug.github.io/format/spec/program/

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

solc --standard-json input.json --pretty-json > ouput.json

input.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

{
  "contracts": {
    "contract.sol": {
      "GreeterBase": {
        "evm": {
          "bytecode": {
            "ethdebug": {
              "contract": {
                "definition": {
                  "source": {
                    "id": 0
                  }
                },
                "name": "GreeterBase"
              }
              // "environment": "create" <- missing
              // "instructions": [] <- missing
            }
          },
          "deployedBytecode": {
            "ethdebug": {
              "contract": {
                "definition": {
                  "source": {
                    "id": 0
                  }
                },
                "name": "GreeterBase"
              }
              // "environment": "call" <- missing
              // "instructions": [] <- missing
            }
          }
        },
        "ir": "",
        "irOptimized": ""
      }
    },
    "interface.sol": {
      "IGreeter": {
        "evm": {
          "bytecode": {
            "ethdebug": {
              "contract": {
                "definition": {
                  "source": {
                    "id": 1
                  }
                },
                "name": "IGreeter"
              }
              // "environment": "create" <- missing
              // "instructions": [] <- missing
            }
          },
          "deployedBytecode": {
            "ethdebug": {
              "contract": {
                "definition": {
                  "source": {
                    "id": 1
                  }
                },
                "name": "IGreeter"
              }
              // "environment": "call" <- missing
              // "instructions": [] <- missing
            }
          }
        },
        "ir": "",
        "irOptimized": ""
      }
    }
  },
  "ethdebug": {
    "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
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant