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

Feat/execution time expired #5926

Merged
merged 33 commits into from
Mar 27, 2025

Conversation

rdeioris
Copy link
Contributor

@rdeioris rdeioris commented Mar 14, 2025

Description

This patch introduces time tracking for contract call.

Initially it is just applied for miners using the "max_execution_time" (seconds) option.

Time is checked at every eval calls and eventually triggers CostErrors::ExecutionTimeExpired

Applicable issues

Additional info (benefits, drawbacks, caveats)

Checklist

  • Test coverage for new or modified code paths
  • Changelog is updated
  • Required documentation changes (e.g., docs/rpc/openapi.yaml and rpc-endpoints.md for v2 endpoints, event-dispatcher.md for new events)
  • New clarity functions have corresponding PR in clarity-benchmarking repo
  • New integration test(s) added to bitcoin-tests.yml

@rdeioris rdeioris mentioned this pull request Mar 14, 2025
5 tasks
@rdeioris rdeioris marked this pull request as ready for review March 14, 2025 13:09
@rdeioris rdeioris requested a review from a team as a code owner March 14, 2025 13:09
@aldur aldur added this to the 3.1.0.0.8 milestone Mar 14, 2025
@aldur aldur moved this to Status: 💻 In Progress in Stacks Core Eng Mar 14, 2025
Copy link
Contributor

@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 good! Can you also add a multi-miner integration test where one miner has this new config parameter set to 0? The test should verify that this miner still accepts blocks from the other miner.

@rdeioris rdeioris moved this from Status: 💻 In Progress to Status: In Review in Stacks Core Eng Mar 19, 2025
Copy link
Contributor

@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 is looking great, just a few more comments.

@rdeioris rdeioris requested review from kantai and obycode March 25, 2025 11:31
kantai
kantai previously approved these changes Mar 25, 2025
Copy link
Contributor

@kantai kantai left a comment

Choose a reason for hiding this comment

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

LGTM!

@rdeioris rdeioris requested review from obycode and kantai March 27, 2025 05:52
Copy link
Contributor

@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.

👍

@github-project-automation github-project-automation bot moved this from Status: In Review to Status: 💻 In Progress in Stacks Core Eng Mar 27, 2025
@obycode obycode added this pull request to the merge queue Mar 27, 2025
Merged via the queue into stacks-network:develop with commit e432dfd Mar 27, 2025
189 of 194 checks passed
@github-project-automation github-project-automation bot moved this from Status: 💻 In Progress to Status: ✅ Done in Stacks Core Eng Mar 27, 2025
Copy link

codecov bot commented Mar 27, 2025

Codecov Report

Attention: Patch coverage is 97.42198% with 19 lines in your changes missing coverage. Please review.

Project coverage is 84.10%. Comparing base (84c2de2) to head (30f5596).
Report is 42 commits behind head on develop.

Files with missing lines Patch % Lines
stackslib/src/chainstate/stacks/miner.rs 73.33% 8 Missing ⚠️
testnet/stacks-node/src/tests/signer/v0.rs 98.69% 4 Missing ⚠️
clarity/src/vm/ast/errors.rs 0.00% 2 Missing ⚠️
clarity/src/vm/clarity.rs 86.66% 2 Missing ⚠️
clarity/src/vm/analysis/errors.rs 50.00% 1 Missing ⚠️
clarity/src/vm/mod.rs 98.00% 1 Missing ⚠️
stackslib/src/config/mod.rs 87.50% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5926      +/-   ##
===========================================
+ Coverage    83.84%   84.10%   +0.26%     
===========================================
  Files          522      522              
  Lines       380644   381318     +674     
  Branches       323      323              
===========================================
+ Hits        319138   320709    +1571     
+ Misses       61498    60601     -897     
  Partials         8        8              
Files with missing lines Coverage Δ
clarity/src/vm/contexts.rs 92.98% <100.00%> (+0.02%) ⬆️
clarity/src/vm/costs/mod.rs 83.40% <ø> (ø)
clarity/src/vm/tests/simple_apply_eval.rs 99.57% <100.00%> (+<0.01%) ⬆️
stackslib/src/chainstate/coordinator/tests.rs 90.80% <100.00%> (+<0.01%) ⬆️
stackslib/src/chainstate/nakamoto/miner.rs 84.12% <100.00%> (+1.99%) ⬆️
stackslib/src/chainstate/nakamoto/mod.rs 83.86% <100.00%> (-0.03%) ⬇️
stackslib/src/chainstate/nakamoto/shadow.rs 75.75% <100.00%> (+0.03%) ⬆️
stackslib/src/chainstate/nakamoto/tests/node.rs 83.13% <100.00%> (+<0.01%) ⬆️
...kslib/src/chainstate/stacks/boot/contract_tests.rs 93.92% <100.00%> (+0.02%) ⬆️
stackslib/src/chainstate/stacks/db/blocks.rs 89.78% <100.00%> (+0.03%) ⬆️
... and 20 more

... and 43 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e31481d...30f5596. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

4 participants