AztecProtocol / ab2

Alpha Build 2 project repository.
3 stars 27 forks source link

Libraries of `zkmail.nr` aren't updated with the latest breaking changes of the `v0.36.0` compiler #21

Open NikolayKostadinov21 opened 1 month ago

NikolayKostadinov21 commented 1 month ago

Issue Description

Compiling a Nargo program with the latest compiler version (v0.36.0) results in 8 errors when using zkmail.nr as a dependency (version v0.3.2). However, reverting to compiler version v0.35.0 allows the code to compile without issues.

Project Context

Project Name: ZeKshop

Challenge: ZKEmail Guardian

GitHub Repository: https://github.com/NikolayKostadinov21/ZeKshop

Environment

Aztec Version: 0.55.1 - Has no effect.

Noir Version (if applicable): nargo version = 0.36.0 noirc version = 0.36.0+3299c25cefb6e3eb4b55396b2f842138b658e42f (git version hash: 3299c25cefb6e3eb4b55396b2f842138b658e42f, is dirty: false)

Operating System: Ubuntu 24

Steps to Reproduce

  1. Create new nargo project with nargo new dummy_project
  2. Add zkmail.nr as a dependency
  3. Run nargo compile

Expected Behavior

The code compiles

Actual Behavior

The compiler detected 8 errors.

Error Messages

error: Function expects 1 parameter but 2 were given
    ┌─ /home/anon/nargo/github.com/noir-lang/noir-bignumv0.3.5/src/runtime_bignum.nr:179:9
    │
179 │         most_significant_byte.assert_max_bit_size(max_bits_in_most_significant_byte as u32);
    │         -----------------------------------------------------------------------------------
    │

error: Function expects 1 parameter but 2 were given
    ┌─ /home/anon/nargo/github.com/noir-lang/noir-bignumv0.3.5/src/runtime_bignum.nr:229:13
    │
229 │             self.limbs[i].assert_max_bit_size(120);
    │             --------------------------------------
    │

error: Function expects 1 parameter but 2 were given
    ┌─ /home/anon/nargo/github.com/noir-lang/noir-bignumv0.3.5/src/runtime_bignum.nr:232:9
    │
232 │         self.limbs[N - 1].assert_max_bit_size(final_limb_bits as u32);
    │         -------------------------------------------------------------
    │

error: Function expects 1 parameter but 2 were given
    ┌─ /home/anon/nargo/github.com/noir-lang/noir-bignumv0.3.5/src/runtime_bignum.nr:250:13
    │
250 │             self.limbs[i].assert_max_bit_size(120);
    │             --------------------------------------
    │

error: Function expects 1 parameter but 2 were given
    ┌─ /home/anon/nargo/github.com/noir-lang/noir-bignumv0.3.5/src/runtime_bignum.nr:254:9
    │
254 │         self.limbs[N - 1].assert_max_bit_size(final_limb_bits as u32);
    │         -------------------------------------------------------------
    │

error: Function expects 1 parameter but 2 were given
    ┌─ /home/anon/nargo/github.com/noir-lang/noir-bignumv0.3.5/src/runtime_bignum.nr:498:9
    │
498 │         borrow_flags[0].assert_max_bit_size(1);
    │         --------------------------------------
    │

error: Function expects 1 parameter but 2 were given
    ┌─ /home/anon/nargo/github.com/noir-lang/noir-bignumv0.3.5/src/runtime_bignum.nr:501:13
    │
501 │             borrow_flags[i].assert_max_bit_size(1);
    │             --------------------------------------
    │

error: Function expects 1 parameter but 2 were given
    ┌─ /home/anon/nargo/github.com/noir-lang/noir-bignumv0.3.5/src/runtime_bignum.nr:523:13
    │
523 │             product_limbs[i].assert_max_bit_size(126); // N.B. is this sufficient? going beyond 126 costs us 1 gate per limb
    │             -----------------------------------------
    │

Aborting due to 8 previous errors

Possible Solution

Update the libraries that require an update to be compatible with the newest version of Noir

Impact on Development

Minor

skaunov commented 4 weeks ago

Hence it's not compatible with v0.60 of Aztec.

Btw, actually it's down to the RSA crate which have been broken. \

TXE https://discordapp.com/channels/1144692727120937080/1298987568653795432/1299767305055768648