Skip to content

bug(rln): idCommitmentBigInt generated are some times rejected by the contract #2393

Open
@danisharora099

Description

@danisharora099

Description

The idCommitment value generated during hashing sometimes exceeds the maximum allowed limit defined by the smart contract (Q).
This results in invalid commitments that would be rejected at the contract level.

During testing, most generated values were in the 1e+76 range, with some occasionally in 1e+75, both of which may exceed Q.

Expected Behavior

All idCommitment values should be less than the constant Q defined in the smart contract:
https://github.com/waku-org/waku-rlnv2-contract/blob/b7e9a9b1bc69256a2a3076c1f099b50ce84e7eff/src/WakuRlnV2.sol#L25

Steps to Reproduce

  1. Run the RLN identity generation logic in a test environment
  2. Log or inspect the idCommitment values
  3. Observe occasional bigint values larger than Q
  4. Attempt to use these values on-chain → contract rejects them

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions