Skip to content

Implement verification of reproducible builds and run differential E2E tests#468

Merged
elle-j merged 79 commits intomainfrom
lj/ci-retester
Apr 14, 2026
Merged

Implement verification of reproducible builds and run differential E2E tests#468
elle-j merged 79 commits intomainfrom
lj/ci-retester

Conversation

@elle-j
Copy link
Copy Markdown
Contributor

@elle-j elle-j commented Feb 2, 2026

Description

This adds verification for reproducible builds (via revive-differential-tests testing framework) by:

  1. Compiling contracts 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:

Notes

Failed compilations

Since 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

elle-j added 30 commits February 2, 2026 13:16
Prior to adding cache to this workflow, the build steps always ran,
which invoked the following: "make install-wasm" > "make install-npm" >
installed the solc npm package defined in "js/emscripten/package.json".
Thus, the explicitly downloaded soljson.js was never used since npm
module resolution first looks for an npm package when required with
"require('solc/soljson')" as before. With cache now added and on cache
hits, the build step no longer runs and just performs the sanity check,
which now detects this unintended behavior and fails since there is no
solc npm package. This commit updates it to look for the local file.
This allows using the same script for all builds including Wasm, and to
make it more readable, maintainable, testable, and more easily allow for
parallel compilations with Node async APIs.
elle-j added 4 commits April 8, 2026 15:45
Includes building LLVM for Windows using clang-cl, and applies LLVM
patches for deterministic operand order and correct peephole
optimization for large integers for minsize (thus, the custom stripping
of minsize has been removed).

The patches are applied as part of llvm-builder, instead of in the
workflow step as previously tested.
Comment thread .github/assets/revive-dev-node-polkavm-resolc.json
Comment thread .github/workflows/test-builds.yml Outdated
@elle-j elle-j changed the title [WIP] Verify reproducible builds and run differential E2E tests Implement verification of reproducible builds and run differential E2E tests Apr 10, 2026
@elle-j elle-j marked this pull request as ready for review April 10, 2026 08:34
Copy link
Copy Markdown
Member

@xermicus xermicus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running differential tests needs build caches for revive dev node and rpc binaries since (--profile production builds take long time to build)

Comment thread .github/workflows/test-builds.yml Outdated
Comment thread .github/workflows/differential-tests.yml
Copy link
Copy Markdown
Member

@xermicus xermicus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff! This is looking much better now, thanks for taking on all that effort!

Comment thread .github/workflows/test-builds.yml Outdated
Comment thread .github/workflows/reusable-build.yml
Comment thread .github/workflows/reusable-build.yml
Comment thread .github/workflows/differential-tests.yml
Comment thread .github/workflows/test-builds.yml Outdated
Comment thread .github/workflows/test-builds.yml Outdated
@elle-j elle-j merged commit 733e01c into main Apr 14, 2026
30 checks passed
@elle-j elle-j deleted the lj/ci-retester branch April 14, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Comprehensive differential E2E tests

3 participants