solidity icon indicating copy to clipboard operation
solidity copied to clipboard

Add `assemblyJson` as an alias for `legacyAssembly` output in Standard JSON

Open cameel opened this issue 1 year ago • 2 comments

Abstract

Currently the JSON-based assembly output in Standard JSON is called legacyAssembly, which makes it seem deprecated. While that was the original intention, we moved away from that and we should rename it to make that clear.

Motivation

Currently we have two assembly formats:

  1. assembly/--asm (text)
  2. legacyAssembly/--asm-json/--combined-json asm (JSON)

legacyAssembly was called that ever since Standard JSON was introduced.

@chriseth says that the legacy format was not machine-readable, and he wanted to remove it eventually. Though it's not certain if it was really the same as current legacy format (the non-machine-readable one was apparently text, not JSON). See also comments from @chriseth and @axic on a related bug.

We're actively using the legacy JSON format for the assembly import feature that's being implemented (#13673) and it seems that if it had problems with ambiguity, those were resolved long ago. For this reason we decided to keep it after all.

Specification

Make "evm.assemblyJson" a valid value for Standard JSON outputSelection.

  • It should produce the same JSON output that "evm.legacyAssembly" does, but under a key called assemblyJson.

Backwards compatibility

  • "evm.legacyAssembly" should keep working exactly as it does now.
  • Selecting "*" should not include "evm.assemblyJson" for now to avoid including the same, very verbose information twice or breaking the compatibility. We may change that in the future.
  • Selecting both at the same time should be allowed.

cameel avatar Oct 04 '23 17:10 cameel

can i work on this issue?

btme0011 avatar Oct 22 '23 13:10 btme0011

This issue has been marked as stale due to inactivity for the last 90 days. It will be automatically closed in 7 days.

github-actions[bot] avatar Jan 21 '24 12:01 github-actions[bot]