Skip to content

PoX-5 and Epoch3.5 boilerplate code#6928

Closed
rob-stacks wants to merge 24 commits intostacks-network:developfrom
rob-stacks:feat/pox_5_reward_set
Closed

PoX-5 and Epoch3.5 boilerplate code#6928
rob-stacks wants to merge 24 commits intostacks-network:developfrom
rob-stacks:feat/pox_5_reward_set

Conversation

@rob-stacks
Copy link
Copy Markdown
Contributor

Description

This is the boilerplate code for introducing Epoch3.5 and PoX-5. It is still a draft as it is not ready to be merged but definitely ready to be used as a base for the other tasks for pox-5 implementations.

Notes:

  • a bunch of hooks for preparing to the new pox-5 contract function names are available
  • Epoch3.5 still supports all of the clarity versions
  • The activation for epoch3.5 already includes the boot contract installation for pox-5 (contract is just a placeholder)
  • No block height has been set (so currently most of the epoch-related tests are going to fail, i am preparing a separated PR for it)

Applicable issues

  • fixes #

Additional info (benefits, drawbacks, caveats)

Checklist

  • Test coverage for new or modified code paths
  • For new Clarity features or consensus changes, add property tests (see docs/property-testing.md)
  • Changelog is updated
  • Required documentation changes (e.g., rpc/openapi.yaml for RPC endpoints, event-dispatcher.md for new events)
  • New clarity functions have corresponding PR in clarity-benchmarking repo

Comment thread stackslib/src/core/mod.rs Outdated
Copy link
Copy Markdown
Contributor

@hstove-stacks hstove-stacks left a comment

Choose a reason for hiding this comment

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

Just noting a few more changes that are blocking the tests that move into epoch 3.5

You also need to update StacksEpochId::latest in test, otherwise the miner gives the wrong block commit epoch marker:

diff --git a/stacks-common/src/types/mod.rs b/stacks-common/src/types/mod.rs
index 2ffdfc5ada..50d2902e0a 100644
--- a/stacks-common/src/types/mod.rs
+++ b/stacks-common/src/types/mod.rs
@@ -467,7 +467,7 @@ impl StacksEpochId {
 
     #[cfg(any(test, feature = "testing"))]
     pub const fn latest() -> StacksEpochId {
-        StacksEpochId::Epoch34
+        StacksEpochId::Epoch35
     }
 
     #[cfg(not(any(test, feature = "testing")))]

Comment thread stackslib/src/clarity_vm/clarity.rs
Copy link
Copy Markdown
Contributor

@hstove-stacks hstove-stacks left a comment

Choose a reason for hiding this comment

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

One more gotcha 😂 man, we really need to make a little runbook for all of these minor things!

But at least I can confirm that with this last change, tests can pass into 3.5 and the pox-5 contract is deployed

Comment thread stackslib/src/clarity_vm/clarity.rs Outdated
@rob-stacks
Copy link
Copy Markdown
Contributor Author

@hstove-stacks updated with latest fixes

Copy link
Copy Markdown
Contributor

@brice-stacks brice-stacks left a comment

Choose a reason for hiding this comment

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

This boilerplate looks good to me 👍

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 20, 2026

Codecov Report

❌ Patch coverage is 26.78133% with 298 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.17%. Comparing base (220840e) to head (4c5eac1).
⚠️ Report is 22 commits behind head on develop.

Files with missing lines Patch % Lines
stackslib/src/core/mod.rs 0.35% 279 Missing ⚠️
stacks-common/src/types/mod.rs 85.71% 3 Missing ⚠️
stackslib/src/chainstate/stacks/block.rs 0.00% 3 Missing ⚠️
stackslib/src/clarity_vm/clarity.rs 94.23% 3 Missing ⚠️
stackslib/src/config/mod.rs 0.00% 3 Missing ⚠️
stackslib/src/burnchains/mod.rs 75.00% 2 Missing ⚠️
pox-locking/src/lib.rs 50.00% 1 Missing ⚠️
stackslib/src/chainstate/burn/db/sortdb.rs 0.00% 1 Missing ⚠️
stackslib/src/chainstate/stacks/boot/mod.rs 0.00% 1 Missing ⚠️
stackslib/src/chainstate/stacks/db/blocks.rs 75.00% 1 Missing ⚠️
... and 1 more

❌ Your patch check has failed because the patch coverage (26.78%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project check has failed because the head coverage (46.17%) is below the adjusted base coverage (84.99%). You can increase the head coverage or adjust the Removed Code Behavior.

❗ There is a different number of reports uploaded between BASE (220840e) and HEAD (4c5eac1). Click for more details.

HEAD has 7 uploads less than BASE
Flag BASE (220840e) HEAD (4c5eac1)
291 284
Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #6928       +/-   ##
============================================
- Coverage    84.99%   46.17%   -38.83%     
============================================
  Files          412      412               
  Lines       219958   220326      +368     
  Branches       338      338               
============================================
- Hits        186959   101726    -85233     
- Misses       32999   118600    +85601     
Files with missing lines Coverage Δ
clarity-types/src/types/signatures.rs 62.15% <100.00%> (-29.97%) ⬇️
clarity/src/vm/analysis/mod.rs 71.57% <ø> (-21.06%) ⬇️
clarity/src/vm/analysis/type_checker/mod.rs 93.75% <100.00%> (ø)
clarity/src/vm/costs/mod.rs 64.83% <100.00%> (-18.88%) ⬇️
clarity/src/vm/functions/mod.rs 60.58% <100.00%> (-36.35%) ⬇️
clarity/src/vm/version.rs 43.33% <100.00%> (-26.16%) ⬇️
stacks-common/src/libcommon.rs 0.00% <ø> (-100.00%) ⬇️
stacks-common/src/util/macros.rs 76.73% <ø> (-11.81%) ⬇️
.../chainstate/burn/operations/leader_block_commit.rs 16.34% <ø> (-79.93%) ⬇️
stackslib/src/chainstate/coordinator/mod.rs 77.16% <100.00%> (-4.90%) ⬇️
... and 15 more

... and 320 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 220840e...4c5eac1. 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.

@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 23535279385

Details

  • 109 of 407 (26.78%) changed or added relevant lines in 21 files are covered.
  • 84553 unchanged lines in 340 files lost coverage.
  • Overall coverage decreased (-38.9%) to 46.862%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pox-locking/src/lib.rs 1 2 50.0%
stackslib/src/chainstate/burn/db/sortdb.rs 0 1 0.0%
stackslib/src/chainstate/stacks/boot/mod.rs 0 1 0.0%
stackslib/src/chainstate/stacks/db/blocks.rs 3 4 75.0%
stackslib/src/chainstate/stacks/db/transactions.rs 0 1 0.0%
stackslib/src/burnchains/mod.rs 6 8 75.0%
stacks-common/src/types/mod.rs 18 21 85.71%
stackslib/src/chainstate/stacks/block.rs 0 3 0.0%
stackslib/src/clarity_vm/clarity.rs 49 52 94.23%
stackslib/src/config/mod.rs 0 3 0.0%
Files with Coverage Reduction New Missed Lines %
clarity/src/vm/analysis/trait_checker/mod.rs 1 97.22%
clarity-types/src/token.rs 1 18.33%
stackslib/src/burnchains/bitcoin/network.rs 1 79.31%
stackslib/src/chainstate/nakamoto/coordinator/mod.rs 1 80.95%
stackslib/src/chainstate/stacks/index/profile.rs 1 68.81%
stackslib/src/net/stackerdb/mod.rs 1 87.13%
stacks-node/src/burnchains/rpc/rpc_transport/mod.rs 1 93.33%
stacks-signer/src/v0/signer_state.rs 1 92.39%
clarity/src/vm/functions/boolean.rs 2 86.36%
stacks-common/src/deps_common/bitcoin/blockdata/opcodes.rs 2 78.26%
Totals Coverage Status
Change from base Build 23400582460: -38.9%
Covered Lines: 102183
Relevant Lines: 218050

💛 - Coveralls

@rob-stacks rob-stacks closed this Apr 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

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 added the locked label Apr 9, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants