argotorg / argotorg/solidity

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

Open
#14,586 2 comments 0 reactions 0 assignees View on GitHub
feature low effort low impact must have eventually protocol design :crystal_ball:
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
2d 19h
Merged PRs (30d)
29

Description

## 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)
1. `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](https://github.com/ethereum/solidity/issues/8171#issuecomment-588184845).

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.

Contributor guide

Open the contributing guide

Research direction

Start by tracing Standard JSON outputSelection handling and the existing evm.legacyAssembly generation. Add support for evm.assemblyJson while preserving legacyAssembly behavior, excluding it from wildcard selection, and allowing both selections; verify that both keys produce the same JSON output.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, solidity
Domain
compilers
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.