You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modulus is half implemented in brillig, it's checked by manually emitting opcodes to check it, but it's never written to, so it fails randomly when the stack offset reserved for it was used for different things previously.
To Reproduce
This code fails to execute since the stack offset of modulus of a and b was reused, and since it's never written to, it contains old non-matching values.
# Description
## Problem\*
Resolves#5373
## Summary\*
Bigint modulus was checked but never written. Since changing
bigint::to_le_bytes to write a modulus ID would require a breaking
change, this fixes the modulus issue without changing the opcode spec,
by completely offloading modulus checks to the runtime itself.
## Additional Context
## Documentation\*
Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.
# PR Checklist\*
- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
Aim
Use bigint in brillig
Expected Behavior
Moduli should be checked correctly on operations
Bug
Modulus is half implemented in brillig, it's checked by manually emitting opcodes to check it, but it's never written to, so it fails randomly when the stack offset reserved for it was used for different things previously.
To Reproduce
This code fails to execute since the stack offset of modulus of a and b was reused, and since it's never written to, it contains old non-matching values.
Project Impact
None
Impact Context
No response
Workaround
None
Workaround Description
No response
Additional Context
No response
Installation Method
None
Nargo Version
No response
NoirJS Version
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered: