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
Current behavior:
Any call to the MULMOD opcode with a modulus value of 0 will fail, due to the fact that we are calling the uint256_mul_div_mod which doesn't accept 0 as a div value.
let (stack, popped) = Stack.pop_n(self=stack, n=3);
let a = popped[0];
let b = popped[1];
let c = popped[2];
// Compute the mul mod
let (_, _, rem) = uint256_mul_div_mod(a, b, c);
Expected behavior:
Given 0 as the modulus value, the returned value should always be 0, whatever the value for first and second stack value (a and b in the above snippet).
thread 'blockchain_tests::vm_tests' panicked at 'attempt to divide by zero', ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/num-bigint-0.4.3/src/biguint/division.rs:168:9
[!] Case ~/code/rust/ef-tests/crates/ef-testing/ethereum-tests/BlockchainTests/GeneralStateTests/VMTests/vmArithmeticTest/mulmod.json failed (description: mulmod): Test failed: error sending request for url (http://[::1]:52181/): connection closed before message completed
The text was updated successfully, but these errors were encountered:
Time spent on this PR: 0.2
## Pull request type
Please check the type of change your PR introduces:
- [x] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):
## What is the current behavior?
Resolves#694
## What is the new behavior?
Passing
Bug Report
Kakarot version: ee6458a
Current behavior:
Any call to the MULMOD opcode with a modulus value of 0 will fail, due to the fact that we are calling the
uint256_mul_div_mod
which doesn't accept 0 as adiv
value.kakarot/src/kakarot/instructions/stop_and_arithmetic_operations.cairo
Lines 359 to 370 in ee6458a
Expected behavior:
Given 0 as the modulus value, the returned value should always be 0, whatever the value for first and second stack value (a and b in the above snippet).
Steps to reproduce:
all the below tests will fail due to the modulus value:
https://github.com/ethereum/tests/blob/develop/src/GeneralStateTestsFiller/VMTests/vmArithmeticTest/mulmodFiller.yml#L178-L222
Failing output should be:
The text was updated successfully, but these errors were encountered: