Skip to content

Conversation

obycode
Copy link
Contributor

@obycode obycode commented Aug 20, 2025

Description

This is the first step in the Clarity 4 proposal (see SIP PR #218). This changes adds Epoch 3.3, Clarity version 4, and costs-4, which is needed for the new builtins. Epoch 3.3 is currently set to activate at Bitcoin height 33,000,000, and Clarity 4 does not activate until 3.3, so it should be safe to merge into develop.

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

See clarity-lang/reference#88 and
stacks-network#6320 for dicsussion
about this new builtin function.
For now, this is only accessible via the CLI:
```sh
stacks-inspect contract-hash <path-to-contract>
```
Also adds Epoch 3.3 and costs-4 to support this new function and removes
the MAST implementation from the previous proposal.
@obycode obycode requested review from a team as code owners August 20, 2025 19:02
@obycode obycode moved this to Status: In Review in Stacks Core Eng Aug 20, 2025
@obycode obycode added this to the 3.3.0.0.0 milestone Aug 20, 2025
@obycode obycode linked an issue Aug 20, 2025 that may be closed by this pull request
This is not needed since it will actually execute a read-only call in
the Clarity version for the called contract. Removing this allows us to
safely set `ClarityVersion::latest()` to return `Clarity4`.
@obycode obycode self-assigned this Aug 20, 2025
@aldur aldur requested review from hstove and kantai August 21, 2025 14:53
@obycode
Copy link
Contributor Author

obycode commented Aug 22, 2025

These failing integration tests all pass locally. I don't recall seeing these be flaky in other PRs. I will take a look to see if I introduced a new source of flakiness somewhere.

@obycode
Copy link
Contributor Author

obycode commented Aug 25, 2025

I believe the flakiness I saw before is solved by #6420.

@obycode obycode dismissed stale reviews from hstove and kantai via 4d661fc September 9, 2025 15:43
@obycode
Copy link
Contributor Author

obycode commented Sep 9, 2025

Merge conflicts resolved and ready for re-review.

@obycode obycode requested review from hstove and kantai September 9, 2025 15:44
hstove
hstove previously approved these changes Sep 9, 2025
jcnelson
jcnelson previously approved these changes Sep 10, 2025
@github-project-automation github-project-automation bot moved this from Status: In Review to Status: 💻 In Progress in Stacks Core Eng Sep 10, 2025
@obycode obycode added this pull request to the merge queue Sep 10, 2025
github-merge-queue bot pushed a commit that referenced this pull request Sep 10, 2025
Setup for Clarity 4 and implement `contract-hash?`
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Sep 10, 2025
@obycode obycode dismissed stale reviews from jcnelson and hstove via 1503a7e September 10, 2025 13:26
@obycode obycode requested review from hstove and jcnelson September 10, 2025 13:27
@obycode
Copy link
Contributor Author

obycode commented Sep 10, 2025

Added clone needed after merge with develop. Please re-review. 🙏

@obycode obycode enabled auto-merge September 10, 2025 13:27
@obycode obycode added this pull request to the merge queue Sep 10, 2025
Merged via the queue into stacks-network:develop with commit f183be7 Sep 10, 2025
1 of 2 checks passed
@obycode obycode deleted the feat/clarity-4 branch September 10, 2025 15:03
@github-project-automation github-project-automation bot moved this from Status: 💻 In Progress to Status: ✅ Done in Stacks Core Eng Sep 10, 2025
@codecov
Copy link

codecov bot commented Sep 10, 2025

Codecov Report

❌ Patch coverage is 58.30145% with 545 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.61%. Comparing base (1393537) to head (1503a7e).
⚠️ Report is 53 commits behind head on develop.

Files with missing lines Patch % Lines
stackslib/src/core/mod.rs 8.72% 157 Missing ⚠️
...c/vm/analysis/type_checker/v2_1/tests/contracts.rs 0.00% 146 Missing ⚠️
stacks-node/src/tests/nakamoto_integrations.rs 0.00% 114 Missing ⚠️
stackslib/src/chainstate/stacks/transaction.rs 55.88% 30 Missing ⚠️
clarity/src/vm/database/clarity_db.rs 33.33% 24 Missing ⚠️
stackslib/src/cli.rs 0.00% 13 Missing ⚠️
clarity-serialization/src/types/signatures.rs 20.00% 12 Missing ⚠️
clarity/src/vm/tests/mod.rs 0.00% 10 Missing ⚠️
stackslib/src/clarity_vm/tests/costs.rs 92.40% 6 Missing ⚠️
clarity-serialization/src/errors/analysis.rs 0.00% 4 Missing ⚠️
... and 14 more

❌ Your project status has failed because the head coverage (63.61%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

❗ There is a different number of reports uploaded between BASE (1393537) and HEAD (1503a7e). Click for more details.

HEAD has 50 uploads less than BASE
Flag BASE (1393537) HEAD (1503a7e)
122 72
Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #6403       +/-   ##
============================================
- Coverage    74.81%   63.61%   -11.20%     
============================================
  Files          557      558        +1     
  Lines       341830   342708      +878     
============================================
- Hits        255724   218013    -37711     
- Misses       86106   124695    +38589     
Files with missing lines Coverage Δ
clarity/src/vm/analysis/arithmetic_checker/mod.rs 92.48% <100.00%> (ø)
clarity/src/vm/analysis/mod.rs 94.94% <ø> (ø)
clarity/src/vm/analysis/read_only_checker/mod.rs 87.39% <ø> (ø)
clarity/src/vm/analysis/type_checker/mod.rs 93.75% <100.00%> (ø)
...rity/src/vm/analysis/type_checker/v2_1/contexts.rs 100.00% <100.00%> (ø)
...ity/src/vm/analysis/type_checker/v2_1/tests/mod.rs 67.06% <100.00%> (-20.68%) ⬇️
clarity/src/vm/clarity.rs 83.26% <100.00%> (ø)
clarity/src/vm/costs/cost_functions.rs 100.00% <100.00%> (ø)
clarity/src/vm/costs/costs_1.rs 100.00% <100.00%> (ø)
clarity/src/vm/costs/costs_2.rs 100.00% <100.00%> (+15.87%) ⬆️
... and 49 more

... and 299 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 1393537...1503a7e. 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.

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

Status: Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

[Clarity-4] contract-hash?

4 participants