ethereum / c-kzg-4844

A minimal implementation of the Polynomial Commitments API for EIP-4844 and EIP-7594, written in C.
Apache License 2.0
112 stars 105 forks source link

Add new Rust fuzzer #457

Closed jtraglia closed 1 month ago

jtraglia commented 1 month ago
asn-d6 commented 1 month ago

Should we add a README here (this PR deleted one)? Or briefly mention how to run the fuzzer in the README?

jtraglia commented 1 month ago

Should we add a README here (this PR deleted one)? Or briefly mention how to run the fuzzer in the README?

Good idea. I've added a basic readme. Please walk through this to make sure it's correct.

asn-d6 commented 1 month ago

Hm. I got some undefined reference issues when running cargo fuzz run fuzz_verify_blob_kzg_proof:

/usr/bin/ld: /home/user/eth/c-kzg-4844/fuzz/target/x86_64-unknown-linux-gnu/release/build/c-kzg-852250952b678b24/out/libckzg.a(b638502d7019dfbe-c_kzg_4844.o): in function `g1_mul':
          /home/user/eth/c-kzg-4844/src/c_kzg_4844.c:409:(.text.g1_lincomb_naive+0x5f): undefined reference to `blst_scalar_from_fr'
          /usr/bin/ld: /home/user/eth/c-kzg-4844/src/c_kzg_4844.c:410:(.text.g1_lincomb_naive+0x7d): undefined reference to `blst_p1_mult'
          /usr/bin/ld: /home/user/eth/c-kzg-4844/fuzz/target/x86_64-unknown-linux-gnu/release/build/c-kzg-852250952b678b24/out/libckzg.a(b638502d7019dfbe-c_kzg_4844.o): in function `g1_lincomb_naive':
          /home/user/eth/c-kzg-4844/src/c_kzg_4844.c:682:(.text.g1_lincomb_naive+0x8f): undefined reference to `blst_p1_add_or_double'
          /usr/bin/ld: /home/user/eth/c-kzg-4844/fuzz/target/x86_64-unknown-linux-gnu/release/build/c-kzg-852250952b678b24/out/libckzg.a(b638502d7019dfbe-c_kzg_4844.o): in function `validate_kzg_g1':
          /home/user/eth/c-kzg-4844/src/c_kzg_4844.c:576:(.text.validate_kzg_g1+0x1d): undefined reference to `blst_p1_uncompress'
          /usr/bin/ld: /home/user/eth/c-kzg-4844/src/c_kzg_4844.c:577:(.text.validate_kzg_g1+0x41): undefined reference to `blst_p1_from_affine'
          /usr/bin/ld: /home/user/eth/c-kzg-4844/src/c_kzg_4844.c:580:(.text.validate_kzg_g1+0x49): undefined reference to `blst_p1_is_inf'
          /usr/bin/ld: /home/user/eth/c-kzg-4844/src/c_kzg_4844.c:582:(.text.validate_kzg_g1+0x55): undefined reference to `blst_p1_in_g1'

Not sure if this is my own issue or not. Likely my own issue.