Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker container for more reproducible builds of RISC-V artifacts #40

Closed
wwared opened this issue Jun 24, 2024 · 1 comment · Fixed by argumentcomputer/sphinx#151
Closed
Labels
enhancement New feature or request

Comments

@wwared
Copy link
Contributor

wwared commented Jun 24, 2024

Related to #13 (comment)

Just commiting the Cargo.lock files was not enough: re-building the same program in a different machine, or with a different source path, lead to different binaries with slightly different file hashes. This can be confirmed by running, e.g. strings aptos/aptos-programs/artifacts/epoch-change-program | grep home which outputs paths like /home/thomas/... (or the relative paths of whoever last re-compiled the artifacts)

This can be "fixed" with rustc's --remap-path-prefix option or the unstable trim-paths cargo feature. This should enable us to sanitize these paths in our binaries.

However, even then, other factors (such as rustc toolchain version used) might still lead to slightly different binaries, which leads to a different VK, requiring a change to the respective solidity contracts. As a result, we've disabled the auto-rebuild-by-default behavior of build.rs.

We should additionally look into making a Docker image that contains within it all the resources needed to build a specific version of the light client binaries:

  • Source checkouts of the LC and all dependencies fetched via Cargo and locked by Cargo.lock
  • cargo-prove installed for the corresponding Sphinx version
  • Rustc RISC-V toolchain installed at a given version
  • All source paths at a fixed location
@huitseeker
Copy link
Contributor

There is also the --docker option of the CLI.

huitseeker added a commit to argumentcomputer/sphinx that referenced this issue Aug 16, 2024
- Added a '-Ztrim-paths' argument to the 'cargo_args' vector.
- Added a provisional solution to enable 'trim-paths', linking the associated Rust issue for context.

Fixes argumentcomputer/zk-light-clients#40
huitseeker added a commit to argumentcomputer/sphinx that referenced this issue Aug 16, 2024
- Added a '-Ztrim-paths' argument to the 'cargo_args' vector.
- Added a provisional solution to enable 'trim-paths', linking the associated Rust issue for context.

Fixes argumentcomputer/zk-light-clients#40
huitseeker added a commit to argumentcomputer/sphinx that referenced this issue Aug 16, 2024
- Added a '-Ztrim-paths' argument to the 'cargo_args' vector.
- Added a provisional solution to enable 'trim-paths', linking the associated Rust issue for context.

Fixes argumentcomputer/zk-light-clients#40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants