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.97k stars 523 forks source link

Vendored dependencies #15603

Closed joseandro closed 1 month ago

joseandro commented 2 months ago

We were exposed to supply chain attacks because our Rust dependencies were not pinned. This PR fixes that by pinning the kimchi stubs dependencies and also incorporating all vendored dependencies available in proof-systems.

Explain your changes:

Explain how you tested your changes:

Checklist:

joseandro commented 2 months ago

!ci-build-me

joseandro commented 2 months ago

!ci-build-me

joseandro commented 2 months ago

!ci-build-me

joseandro commented 2 months ago

!ci-build-me

joseandro commented 2 months ago

!ci-build-me

joseandro commented 2 months ago

!ci-build-me

joseandro commented 2 months ago

!ci-build-me

joseandro commented 2 months ago

!ci-build-me

joseandro commented 2 months ago

!ci-build-me

dannywillems commented 2 months ago

I have:

ile "src/lib/crypto/kimchi_bindings/stubs/dune", line 51, characters 0-615:
51 | (rule
52 |  (enabled_if
53 |   (= %{env:MARLIN_PLONK_STUBS=n} n))
....
74 |     cp
75 |     %{read:dune-build-root}/cargo_kimchi_stubs/release/libwires_15_stubs.a
76 |     .))))
error: failed to select a version for the requirement `libc = "^0.2.0"` (locked to 0.2.154)
candidate versions found which didn't match: 0.2.147
location searched: directory source `/home/soc/codes/o1-labs/mina-berkeley/_build/default/src/lib/crypto/kimchi_bindings/stubs/kimchi-stubs-vendors` (which is replacing registry `crates-io`)
required by package `wires_15_stubs v0.1.0 (/home/soc/codes/o1-labs/mina-berkeley/_build/default/src/lib/crypto/kimchi_bindings/stubs)`
perhaps a crate was updated and forgotten to be re-vendored?

while building.

Also, i have the following (unrelated) error:

Error: optcomp: cannot open imported file: /src/config.mlh: /src/config.mlh: No such file or directory
File "src/lib/genesis_constants/genesis_constants.ml", line 1, characters 3-9:
1 | [%%import "/src/config.mlh"]

Do you know where it comes from?

Commands I use to test:

git clone git@github.com:MinaProtocol/mina/ mina-berkeley
cd mina-berkeley
git checkout vendoring
gvm use go1.20
git submodule init
opam switch create ./ 4.14.0
git submodule update --recursive && eval $(opam env)
opam switch import opam.export -y
./scripts/pin-external-packages.sh
make build
joseandro commented 1 month ago

Building it one last time to make sure everything is fine using the berkeley branch in proof-systems

joseandro commented 1 month ago

!ci-build-me

joseandro commented 1 month ago

!ci-build-me

joseandro commented 1 month ago

!ci-build-me

joseandro commented 1 month ago

!ci-build-me

joseandro commented 1 month ago

!ci-build-me

mrmr1993 commented 1 month ago

!approved-for-mainnet