argotorg / argotorg/solidity

Make source maps byte-offset based instead of opcode-offset

Open
#12,000 3 comments 0 reactions 0 assignees View on GitHub
breaking change :warning: ethdebug high impact medium effort must have protocol design :crystal_ball:
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
2d 19h
Merged PRs (30d)
29

Description

The source maps currently contain one item per opcode, instead of one item per byte in the assembly. This kind of makes sense because it allows the source maps to be flexible about which `push` opcode is used for a constant, but it makes it also more difficult because the "pseudo-opcode" AssignImmutable results in multiple opcodes in the end. To make things worse: As soon as one uses `verbatim`, it is taken as a single opcode by the compiler, but when just seeing the bytecode, it is impossible to tell whether a sequence of opcodes came from a single `verbatim` or multiple opcodes.

Because of that I would propose to make the source maps byte-based starting from Solidity 0.9.0.

Contributor guide

Open the contributing guide

Research direction

The issue names no files or tests; start by locating source-map generation and the handling of AssignImmutable and verbatim in the compiler. Compare opcode-based entries with emitted bytecode, and consider how the change should apply starting with Solidity 0.9.0; done means source maps are byte-offset based rather than opcode-offset based.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, solidity
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.