Skip to content

Commit

Permalink
dev: add 4m step limit to cairo runner (#1120)
Browse files Browse the repository at this point in the history
<!--- Please provide a general summary of your changes in the title
above -->

<!-- Give an estimate of the time you spent on this PR in terms of work
days.
Did you spend 0.5 days on this PR or rather 2 days?  -->

Time spent on this PR: 0.5 H

## Pull request type

<!-- Please try to limit your pull request to one type,
submit multiple pull requests if needed. -->

Please check the type of change your PR introduces:

- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, renaming)
- [x] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

## What is the current behavior?

<!-- Please describe the current behavior that you are modifying,
or link to a relevant issue. -->

Resolves #1115

## What is the new behavior?

<!-- Please describe the behavior or changes that are being added by
this PR. -->

-
-
-

<!-- Reviewable:start -->
- - -
This change is [<img src="https://reviewable.io/review_button.svg"
height="34" align="absmiddle"
alt="Reviewable"/>](https://reviewable.io/reviews/kkrt-labs/kakarot/1120)
<!-- Reviewable:end -->
  • Loading branch information
imotai committed Apr 23, 2024
1 parent c177e26 commit 65d1976
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/fixtures/starknet.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from starkware.cairo.lang.vm.cairo_runner import CairoRunner
from starkware.cairo.lang.vm.memory_dict import MemoryDict
from starkware.cairo.lang.vm.memory_segments import FIRST_MEMORY_ADDR as PROGRAM_BASE
from starkware.cairo.lang.vm.utils import RunResources
from starkware.starknet.business_logic.execution.execute_entry_point import (
ExecuteEntryPoint,
)
Expand Down Expand Up @@ -215,7 +216,8 @@ def _factory(entrypoint, **kwargs) -> list:
},
static_locals={"debug_info": debug_info(program)},
)
runner.run_until_pc(stack[-1])
run_resources = RunResources(n_steps=4_000_000)
runner.run_until_pc(stack[-1], run_resources)
runner.original_steps = runner.vm.current_step
runner.end_run(disable_trace_padding=False)
runner.relocate()
Expand Down

0 comments on commit 65d1976

Please sign in to comment.