mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-10-20 18:56:17 +00:00
## Description This adds verification for reproducible builds (via [revive-differential-tests](https://github.com/paritytech/revive-differential-tests) testing framework) by: 1. Compiling [contracts](https://github.com/paritytech/resolc-compiler-tests/tree/main/fixtures/solidity) and generating hashes from each bytecode * With the resolc builds: * linux musl * macos universal * windows * (future todo: wasm32 emscripten) * With optimization levels `0`, `3`, `z` for each contract 2. Exporting the hashes 3. Comparing the hashes * For each optimization level: * Checks if each hash for a specific contract is identical across the platforms This PR also runs the differential E2E tests (via `retester`) with the resolc linux musl build. All of the above only runs if our `test` workflow succeeds. ## Related This PR initially implemented the above in this repo but has now been implemented into the separate testing framework instead. The most relevant PRs implemented alongside this PR as prerequisites are: * `revive-differential-tests`: * [Generate bytecode hashes included in the report ](https://github.com/paritytech/revive-differential-tests/pull/238) * [Fix handling of resolc's optimizer `mode` and allow setting solc optimizer enabled](https://github.com/paritytech/revive-differential-tests/pull/243) * [Fix solc and resolc optimization settings](https://github.com/paritytech/revive-differential-tests/pull/253) * [Implement a `compile` context/subcommand for standalone compilation mode](https://github.com/paritytech/revive-differential-tests/pull/239) * [Implement support for `--mode` CLI argument for `compile`](https://github.com/paritytech/revive-differential-tests/pull/246) * [Implement `export-hashes` and `compare-hashes` subcommands for report processor ](https://github.com/paritytech/revive-differential-tests/pull/250) * [Implement GH actions for compiling, exporting and comparing hashes](https://github.com/paritytech/revive-differential-tests/pull/251) * [Gate zombienet-sdk behind `cfg(unix)` to fix Windows builds](https://github.com/paritytech/revive-differential-tests/pull/254) * [Link library-using contracts with dummy addresses for `--compile` command](https://github.com/paritytech/revive-differential-tests/pull/267) * `revive`: * [Build LLVM for Windows using MSVC-compatible Clang](https://github.com/paritytech/revive/pull/497) * [Apply LLVM patches for deterministic operand order and correct peephole optimization for `minsize` ](https://github.com/paritytech/revive/pull/500) * Investigation of comparison mismatches in third-party dependencies: * `llvm-project`: * [`SelectionDAG` type legalization produces different operand ordering for `i256` multiply across platforms](https://github.com/llvm/llvm-project/issues/190148) * `solidity`: * [Windows absolute paths in standard JSON break import resolution and library linking](https://github.com/argotorg/solidity/issues/16579) ## Notes ### Failed compilations Since [resolc-compiler-tests](https://github.com/paritytech/resolc-compiler-tests) currently includes contracts that are expected to fail resolc compilation (e.g. due to unsupported instructions, contracts that are expected to work with solc for evm/revm), the compilation workflow job is not expected to fail if compilation fails for a contract. Instead, if a contract compiles with one build but not with another, a hash will be missing and will thereby generate a mismatch when comparing all hashes, failing at the verification step. ## Resolved Issues Closes [#175](https://github.com/paritytech/revive/issues/175)