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

Support calculating gas cost of whole test execution #834

Closed
1 task
cptartur opened this issue Oct 9, 2023 · 2 comments · Fixed by #1037
Closed
1 task

Support calculating gas cost of whole test execution #834

cptartur opened this issue Oct 9, 2023 · 2 comments · Fixed by #1037
Assignees
Labels
Milestone

Comments

@cptartur
Copy link
Member

cptartur commented Oct 9, 2023

When running tests, we should be able to calculate its combined gas cost, that is: cost of all code in the test itself, probably extracted from the VM using starkware-libs/cairo#4084 + the cost of blockifier calls which we are already calculating.

We should create some interface that makes the combined cost of the test available in the run_from_test_case

pub(crate) fn run_from_test_case(
function, so it can be then collected and displayed by forge.

Additionally:

  • Address the TODO in code
@cptartur cptartur converted this from a draft issue Oct 9, 2023
@github-actions github-actions bot added the new label Oct 9, 2023
@cptartur cptartur added this to the Cairo 2.3.0-rc0 milestone Oct 9, 2023
@cptartur
Copy link
Member Author

cptartur commented Oct 9, 2023

This is blocked by blockifier getting bumped to 2.3.0-rc0 or higher.

@Arcticae Arcticae removed the new label Oct 10, 2023
@Arcticae Arcticae moved this from Triage to TODO in Starknet foundry Oct 10, 2023
@Arcticae Arcticae moved this from TODO to Backlog in Starknet foundry Oct 11, 2023
@Arcticae Arcticae moved this from Backlog to In Progress in Starknet foundry Oct 30, 2023
@Arcticae
Copy link
Contributor

Please do create a follow-up to parse the result and display it (for forge-cli team)

@Arcticae Arcticae added the asap label Oct 30, 2023
@war-in war-in mentioned this issue Nov 3, 2023
5 tasks
github-merge-queue bot pushed a commit that referenced this issue Nov 28, 2023
<!-- Reference any GitHub issues resolved by this PR -->

Closes #834

## Introduced changes

<!-- A brief description of the changes -->

- SierraCasmRunner was copied (and slightly modified) to enable gas
calculation

## Checklist

<!-- Make sure all of these are complete -->

- [x] Linked relevant issue
- [ ] Updated relevant documentation
- [x] Added relevant tests
- [x] Performed self-review of the code
- [ ] Added changes to `CHANGELOG.md`

---------

Co-authored-by: Kamil Jankowski <kamil.jankowski.x@gmail.com>
Co-authored-by: Arcticae <tomekgsd@gmail.com>
@github-project-automation github-project-automation bot moved this from In Progress to Done in Starknet foundry Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants