Skip to content

conformance: SolDB reads sources only from the compilation inside resources #416

Open

Description

@gnidan

SolDB reads source contents only from the compilation inside the resources file of its debug directory. It has no input for a compilation that a compiler emits on its own, which ethdebug/format/info/resources allows: compilation is optional there (the schema requires only ethdebug, types and pointers).

This now matters for solc. Since argotorg/solidity#17179, solc emits the compilation only as the separate ethdebug.compilation in standard JSON (with --ethdebug output to a directory: ethdebug_compilation.json next to ethdebug_resources.json). Its resources no longer contain the compilation.

In SolDB (v0.4.0, what our CI builds; main is the same):

  • find_ethdebug_metadata in crates/soldb-ethdebug/src/artifacts.rs looks for one resources file, ethdebug.json or ethdebug_resources.json. No other file in the debug directory is read for the compilation.
  • ethdebug_resources_from_metadata in the same file returns an error ("does not contain resources or compilation") for a resources object without compilation. Both soldb info resources and the trace path go through it, so solc's current output does not load at all.
  • EthdebugInfo::from_artifacts in crates/soldb-ethdebug/src/metadata.rs takes the source table and contents from metadata.compilation only (or treats the whole file as a legacy compilation). Without it, SolDB has no source contents and falls back to source files on disk.

The conformance harness shims this: since #414, ethdebugResources in packages/conformance/src/adapters/soldb.ts merges solc's separate compilation into the ethdebug.json it writes for SolDB. A tripwire in the conformance test gives SolDB the directory as solc writes it (resources without a compilation, ethdebug_compilation.json next to it) and fails once SolDB reports the sources from it. When that happens, remove the shim and close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions