Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: performance tests hit RunResources has no remaining steps. #39

Closed
Tracked by #28
greged93 opened this issue Aug 30, 2023 · 0 comments
Closed
Tracked by #28

bug: performance tests hit RunResources has no remaining steps. #39

greged93 opened this issue Aug 30, 2023 · 0 comments
Labels
evm bug Something related to normal EVM execution isn't working

Comments

@greged93
Copy link
Contributor

Bug Report

Kakarot version: ee6458a

Current behavior:
The VMTests/vmPerformance tests fail with RunResources has no remaining steps. The first test (performanceTester_d0g0v0_Shanghai) should be able to pass as the calculation is still very limited.

Expected behavior:
The test should pass at least up to performanceTester_d2g0v0_Shanghai, which tests the Ackermann recursive function with input (3,1), causing 15 recursive calls.

Steps to reproduce:

make setup
make fetch-dump
make tarket=performanceTester_d0g0v0_Shanghai ef-test
make tarket=performanceTester_d1g0v0_Shanghai ef-test
make tarket=performanceTester_d2g0v0_Shanghai ef-test

The above should fail with:

Transaction execution error: "Error in the called contract (0x04e2460d0debdacdde372cb598b4e4403939ca112c8720e1c2aca13f6ac09b9a):
Error at pc=0:7:
Got an exception while executing a hint.
Cairo traceback (most recent call last):
Unknown location (pc=0:163)
Unknown location (pc=0:149)

Error in the called contract (0x04e2460d0debdacdde372cb598b4e4403939ca112c8720e1c2aca13f6ac09b9a):
Error at pc=0:31:
Got an exception while executing a hint.
Cairo traceback (most recent call last):
Unknown location (pc=0:4606)
Unknown location (pc=0:4545)
Unknown location (pc=0:4374)
Unknown location (pc=0:376)

Error in the called contract (0x049c085e55e5ab05ea46e16706720852421e86c1f8aeeab2be257313c4e290f4):
Error at pc=0:4571:
Could not reach the end of the program. RunResources has no remaining steps.
Cairo traceback (most recent call last):
Unknown location (pc=0:18120)
Unknown location (pc=0:18120)
Unknown location (pc=0:18120)
Unknown location (pc=0:18120)
Unknown location (pc=0:18120)
Unknown location (pc=0:18120)
Unknown location (pc=0:18120)
Unknown location (pc=0:18120)
Unknown location (pc=0:18120)
Unknown location (pc=0:18120)
Unknown location (pc=0:18120)
Unknown location (pc=0:18120)
Unknown location (pc=0:18120)
Unknown location (pc=0:18120)
Unknown location (pc=0:18120)
Unknown location (pc=0:18120)
Unknown location (pc=0:18120)
Unknown location (pc=0:18120)
Unknown location (pc=0:18022)
Unknown location (pc=0:17239)
"
[!] Case ~/code/rust/ef-tests/crates/ef-testing/ethereum-tests/BlockchainTests/GeneralStateTests/VMTests/vmPerformance/performanceTester.json failed (description: performanceTester): Test failed: failed test performanceTester_d0g0v0_Shanghai: expected storage value 0x000000000000000000000000000000000000000000000000000000000000003d, got 0x0000000000000000000000000000000000000000000000000000000000000000

Related code:
Here is are the code snippets executed by performanceTester_d0g0v0_Shanghai, performanceTester_d1g0v0_Shanghai and performanceTester_d2g0v0_Shanghai respectively:

pragma solidity ^0.8;
    // SPDX-License-Identifier: GPL-3.0
    // RETESTETH_SOLC_EVM_VERSION=berlin
    contract PerformanceTester {    
        uint result;

        function ackermann(uint m, uint n) public returns (uint) {
                if (m == 0)
                        return n + 1;
                
                if (n == 0)
                        return ackermann(m - 1, 1);
                
                return ackermann(m - 1, ackermann(m, n - 1));
        }
  
        function ack(uint m, uint n) public returns (uint) {
                result = ackermann(m,n);
                return result;
        }

        
        function fibonacci(uint n) public returns (uint) {
            if (n == 0 || n == 1)
                return n;

            return fibonacci(n - 1) + fibonacci(n - 2);
        }



        function fib(uint n) public returns (uint) {
            result = fibonacci(n);
            return 0x60A7;
        }
    }
  • performanceTester_d0g0v0_Shanghai calls fib(10)
  • performanceTester_d1g0v0_Shanghai calls fib(16)
  • performanceTester_d2g0v0_Shanghai calls ack(3, 1)
@greged93 greged93 added the bug Something isn't working label Aug 30, 2023
@github-project-automation github-project-automation bot moved this to 🆕 Backlog in Kakarot on Starknet Aug 30, 2023
@greged93 greged93 added evm bug Something related to normal EVM execution isn't working and removed bug Something isn't working labels Sep 2, 2023
@github-project-automation github-project-automation bot moved this from 🆕 Backlog to ✅ Done in Kakarot on Starknet Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
evm bug Something related to normal EVM execution isn't working
Projects
No open projects
Archived in project
Development

No branches or pull requests

2 participants