MinaProtocol / mina

Mina is a cryptocurrency protocol with a constant size blockchain, improving scaling while maintaining decentralization and security.
https://minaprotocol.com
Apache License 2.0
1.99k stars 525 forks source link

Nix Guardian duty #12518

Open michal0mina opened 1 year ago

michal0mina commented 1 year ago

Please log here your activity regarding fixing nix issues

@Smorci 2022 > 27.01.2023 @simisimis 30.01.2023 > 17.02.2023 @Smorci 20.02 > 3.03.2023 @simisimis 6.03 -> 17.03.2023 @kaozenn @Smorci 20.03 -> 31.03.2023

michal0mina commented 1 year ago

@Smorci please report about bcase problem and fixes

michal0mina commented 1 year ago

Problem with kimchi bindings not in sync with source tree. See slack thread: https://minafoundation.slack.com/archives/C01TQQP6E4S/p1674555791084319

Solution: recompile nix environment

Solution by Sventimir:It appears the compilation issue on develop is just Nix not being smart enough to detect changed version of kimchi_bindings. Forcing it to rebuild the environment (e.g. with direnv reload if one uses direnv ) solves the problem.

michal0mina commented 1 year ago

Problem with json parsing: need ./nix/pin.sh

simisimis commented 1 year ago

question about linking errors like: ld: warning: ignoring file src/lib/crypto/kimchi_bindings/stubs/libwires_15_stubs.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64 Undefined symbols for architecture x86_64<..> solution isn't clear, but user found their way to workaround switching to bash or recloning https://minafoundation.slack.com/archives/C041SGTBR9Q/p1675096248774109

michal0mina commented 1 year ago

Issue re SnarkyJS build failure

Thread: https://minafoundation.slack.com/archives/C041SGTBR9Q/p1675752474340839

` For Nix experts regarding this one, so SnarkyJS building scripts (scripts/update-snarkyjs-bindings.sh, scripts/build-snarkyjs-node.sh, scripts/build-snarkyjs-web.sh) fail (on dune b src/lib/crypto/kimchi_bindings/js/node_js command invocation, for example) with 2 issues, either no Rust deps found or weird cp: cannot stat 'n/*': No such file or directory(if #rust-impure shell is in use) The later one is caused because Nix sets PLONK_WASM_NODEJS and PLONK_WASM_WEB to the value of n (for whatever reason, probably it is the main issue). And to successfully build SnarkyJS with Nix we have to follow next procedure:

  1. Use impure Rust shell: use flake mina#rust-impure (.envrc)
  2. rustup toolchain install nightly-2022-09-12-x86_64-unknown-linux-gnu
  3. Make sure Nightly is default toolchain
  4. rustup component add rust-src --toolchain nightly-2022-09-12-x86_64-unknown-linux-gnu
  5. unset PLONK_WASM_NODEJS
  6. unset PLONK_WASM_WEB
  7. Now ./scripts/update-snarkyjs-bindings.sh will work Is it possible to align/update/fix Nix build for SnarkyJS? Or tell/teach Team what needs to be taken care of on Nix side of things during the main codebase changes related to ?`
simisimis commented 1 year ago

Mina develop shell broke due to rust nightly version bump. https://minafoundation.slack.com/archives/C041SGTBR9Q/p1676965390664989 resolution: still unresolved

michal0mina commented 1 year ago

I see you engaged in this. Please document later if there is any conclusion https://minafoundation.slack.com/archives/C041SGTBR9Q/p1677167823482709

simisimis commented 1 year ago

regarding https://minafoundation.slack.com/archives/C041SGTBR9Q/p1677167823482709

nix develop mina#rust-impure    
zsh: no matches found: mina#rust-impure

something about zsh on mac breaking on # symbol(regex match?) therefore people were advised to quote it.

michal0mina commented 1 year ago

The issue with root user on the VM for buildkite configuration 15.02 -> 15.03 bug fix time frame

michal0mina commented 1 year ago

FYI, crypto team from O1 removes support for nix due to poor ocaml support

kaozenn commented 1 year ago

Does it mean that Nix will be decommissioned?

michal0mina commented 1 year ago

@kaozenn No, only one team stopped using it

michal0mina commented 1 year ago

Namespace conflict in GH buildkite hooks:

The current understanding is that this is happening because the webhook/API interaction uses a format of buildkite/<pipeline-slug>/ to send test status back to GH, so having the same Mina pipeline defined in both places is allowing the MF Buildkite instance to block PRs when returning failed test statuses on the same buildkite/mina/ and buildkite/mina/pr names (which GH understands as a required tests).

Smorci commented 1 year ago

Namespace conflict in GH buildkite hooks:

The current understanding is that this is happening because the webhook/API interaction uses a format of buildkite/<pipeline-slug>/ to send test status back to GH, so having the same Mina pipeline defined in both places is allowing the MF Buildkite instance to block PRs when returning failed test statuses on the same buildkite/mina/ and buildkite/mina/pr names (which GH understands as a required tests).

Solved

michal0mina commented 1 year ago

Nix - Serghii issue TODO Nix - Trevor's issue Nix - Jen's issue