Skip to content

feat(compilers): support ETHDebug output - #248

Draft
figtracer wants to merge 2 commits into
mainfrom
fig/ethdebug-output
Draft

figtracer wants to merge 2 commits into
mainfrom
fig/ethdebug-output

Conversation

@figtracer

@figtracer figtracer commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Why

Before: foundry-compilers drops the compiler's ETHDebug output.

After: artifacts keep the ETHDebug programs, so Foundry can give them to SolDB (foundry-rs/foundry#16557, foundry-rs/foundry#17430).

Change

Adds output selections for the per-contract programs and the global ethdebug.resources and ethdebug.compilation records. With ExtraOutputValues::ethdebug, artifacts keep the programs on their bytecode, and the build info keeps the global output at output.metadata.ethdebug. The sparse output filter keeps the global selections under "*": {"*": [...]}, where solar and solc 0.8.35+ read them.

Downstream

Bytecode and CompactBytecode get a public ethdebug field, so struct literals need ethdebug: None. Solc emits this output only with experimental, viaIR, and the optimizer off, and experimental adds 14 bytes to the CBOR metadata; solar emits it with the optimizer on.

Add the ETHDebug output selections `evm.bytecode.ethdebug`,
`evm.deployedBytecode.ethdebug`, `ethdebug.resources`, and
`ethdebug.compilation`. Keep the ETHDebug programs on `Bytecode` and
`CompactBytecode`, and keep the global `ethdebug` output in the build
info at `output.metadata.ethdebug`. Solar and solc use the same
standard-JSON shape for these outputs.

`ExtraOutputValues::ethdebug` requests both programs and keeps them in
`ConfigurableContractArtifact`. The sparse output filter keeps the
global ETHDebug selections under `*`, because Solar and solc 0.8.35 and
later read them only there.

Projects that do not request ETHDebug get the same output selection,
artifacts, and build info.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant