Skip to content

Standard JSON input / output types#16587

Draft
erak wants to merge 2 commits intostate-mutability-from-stringfrom
standard-json-input-output
Draft

Standard JSON input / output types#16587
erak wants to merge 2 commits intostate-mutability-from-stringfrom
standard-json-input-output

Conversation

@erak
Copy link
Copy Markdown
Collaborator

@erak erak commented Apr 9, 2026

Part of #16394. Depends on #16586.

Description

In order to modularize the test execution framework, it was decided to settle on JSON as the common input / output data type for compilers under test. Since not only the testing framework, but also the CLI, which is planned to interface with the StandardCompiler in the future, would benefit from this common types. Furthermore, these common data types could be used where (de)serialization is currently duplicated (see e.g. StandardCompiler input parsing).

Design goals

  • mirror schema of standard JSON input / output as closely as possible
  • untangle schema and semantics (this layer only validates the input / output format, but does not add any semantics)
  • have data types and (de)serialization in one place
  • (de)serialize using nlohmann's conventions (via ADL for to_json/from_json)
  • support lazy-deserialization

Open questions

Should StandardJSONOutput live inside test namespace for now, since the test execution framework is the only place where we need the outout right now?

TODO

  • add unit tests
  • clarify general error handling strategy (e.g. when to throw)

Input

  • do not hard-code output selection

Output

  • introduce Cached<T> for Contract members that should lazy-load
  • add error severity

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Thank you for your contribution to the Solidity compiler! A team member will follow up shortly.

If you haven't read our contributing guidelines and our review checklist before, please do it now, this makes the reviewing process and accepting your contribution smoother.

If you have any questions or need our help, feel free to post them in the PR or talk to us directly on the #solidity-dev channel on Matrix.

@erak erak changed the title Standard JSO input / output types Standard JSON input / output types Apr 9, 2026
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