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

Add optional fuel tracking for wasm execution #371

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

krl
Copy link
Collaborator

@krl krl commented Mar 21, 2024

Fuel tracking based on wasmtime for limiting execution

@krl
Copy link
Collaborator Author

krl commented Mar 21, 2024

We should probably add a different error type to better handle out of fuel errors

Copy link

codecov bot commented Mar 21, 2024

Codecov Report

Attention: Patch coverage is 65.11628% with 15 lines in your changes are missing coverage. Please review.

Project coverage is 86.84%. Comparing base (5edf193) to head (25d1e8a).
Report is 2 commits behind head on main.

❗ Current head 25d1e8a differs from pull request most recent head 4b410f3. Consider uploading reports for the commit 4b410f3 to get more accurate results

Files Patch % Lines
clar2wasm/src/initialize.rs 40.00% 9 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #371      +/-   ##
==========================================
- Coverage   87.15%   86.84%   -0.32%     
==========================================
  Files          43       43              
  Lines       18510    18064     -446     
  Branches    18510    18064     -446     
==========================================
- Hits        16132    15687     -445     
+ Misses       1048     1045       -3     
- Partials     1330     1332       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


assert!(env.evaluate("(+ 1 2)").is_err());

let mut env = TestEnvironment::new(StacksEpochId::latest(), ClarityVersion::latest(), Some(90));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we know about 90?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trial and error, setting the limits will require a similar process

obycode
obycode previously approved these changes Mar 26, 2024
Copy link
Collaborator

@obycode obycode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks promising. It is definitely a departure from the current cost-tracking model, but I think we can merge this and build from here to fully flesh out the new mechanism. Thanks @krl!

@@ -1,4 +1,4 @@
//! The `tools` module contains tools for evaluating Clarity snippets.
//! THE `tools` module contains tools for evaluating Clarity snippets.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

@Acaccia
Copy link
Collaborator

Acaccia commented Apr 15, 2024

Does the fuel mechanism have any impact on the execution time?

@krl krl marked this pull request as draft May 28, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants