argotorg / argotorg/solidity

Bytecode compare runs with two-stage compilation

Open
#15,063 0 comments 0 reactions 0 assignees View on GitHub
medium effort medium impact must have testing :hammer:
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
21

Description

Similar to #13583, we should have a bytecode compare run to ensure that two-stage compilation produces output identical to compiling everything in one go.

We're especially interested in the pattern where the optimization is only performed in the second step, that we will be recommending as a way to parallelize compilation. Such compilation should not only produce the same bytecode but also metadata.

Currently two-stage compilation is covered only by the [`~via_ir_equivalence`](https://github.com/ethereum/solidity/tree/v0.8.25/test/cmdlineTests/~via_ir_equivalence) test, but if this pattern is to become more widespread, we need more confidence that there are no issues with it. Also, this command-line test does compilation in the first stage, which is not exactly the same pattern. We might actually want to extend that test to cover more patterns.

Contributor guide

Open the contributing guide

Research direction

Start with test/cmdlineTests/~via_ir_equivalence and compare its approach with issue #13583. Define coverage for two-stage compilation where optimization occurs only in the second step, checking that bytecode and metadata match one-stage compilation; done means the command-line tests exercise the intended patterns.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, solidity
Domain
compilers, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.