github stacks-network/stacks-core 4.1.0
Release 4.1.0

51 minutes ago

This release contains the Epoch 4.1 hard fork described in SIP-046. Epoch 4.1 is set to activate on mainnet at Bitcoin block 979,500, which we expect around December 9, 2026.

⚠️ Required upgrade before Bitcoin block 979,500

  • This is a required upgrade for every mainnet node, miner and signer. Both the stacks-node and stacks-signer binaries must be on 4.1.0 before Bitcoin block 979,500.
  • A node that has not upgraded by then will stop following the Stacks chain at the activation height. A signer paired with such a node will stop signing blocks.
  • 4.1.0 works with chainstate directories from 4.0.x, so you do not need to resync.
  • If you are upgrading from 4.0.5 or earlier, the upgrade notes from 4.0.6 also apply to you: upgrade the stacks-node before its signer (or both together), and note that you can't roll back to 4.0.5 or earlier once the node has migrated its databases.

⚠️ Testnet: earlier hard fork and a required config change

Epoch 4.1 activates on testnet first, at testnet burn block 45,300, which we expect around December 3, 2026.

Unlike mainnet, the testnet epoch schedule is not built into the binary. It comes from the [[burnchain.epochs]] entries in each node's config file. Every testnet node operator needs to do both of the following before burn block 45,300:

  1. Upgrade to 4.1.0.

  2. Add this entry to the node's config file, after the existing 4.0 entry, and restart the node:

    [[burnchain.epochs]]
    epoch_name = "4.1"
    start_height = 45300

Do both steps together. A 4.1.0 testnet node will not start without this entry: it exits at startup with FATAL: no Epoch41 defined in epoch list. Do not add the entry to a node still running 4.0.x. A testnet node left on 4.0.x will fork away from the testnet at burn block 45,300.

The sample testnet configs in the repository (sample/conf/testnet-follower-conf.toml, testnet-miner-conf.toml and testnet-signer.toml) already include the new entry.

What changes at Epoch 4.1

These rules take effect at the activation height. Many of them shipped in the 4.0.x releases and have been waiting for Epoch 4.1.

For contract developers:

  • Clarity 7 is the default Clarity version from Epoch 4.1.
  • Contract deploys that pin a Clarity version (the VersionedSmartContract payload) are rejected. Deploy new contracts with the unversioned SmartContract payload, which uses the epoch's default Clarity version.
  • A contract-call transaction can only call define-public functions. A transaction that targets a define-read-only function fails with a NoSuchPublicFunction runtime error. The mempool already rejected these transactions.
  • Contract analysis is more strict for new deploys. It rejects calls with the wrong number of arguments, mixing tuples with different fields where a type is inferred, and duplicate or shadowed names that were previously missed. Contracts deployed before Epoch 4.1 execute unchanged.
  • Contract principals inside Clarity values are limited to 40-byte contract names, matching deployed contracts. A transaction that carries a longer one is invalid.
  • A contract can call contract-call? through a trait it defines while it deploys, at the top level.

For miners and stakers:

  • The defunct stack-stx, delegate-stx and vote-for-aggregate-key Bitcoin operations are rejected. transfer-stx and pre-stx are unaffected.
  • A block-commit whose parent is at vtxindex 0 of a non-genesis block is only accepted if that parent block-commit exists.
  • Sortition draws the winning block-commit and the null miner's challenge from separate digests.
  • Nakamoto blocks with exactly 2 MiB of transaction data are allowed.
  • The PoX-5 sBTC recipient for each cycle is derived from the sBTC registry's signer set and signature threshold, as an sBTC v2 Taproot multisig deposit, instead of from the registry's aggregate public key. The switch happens at the first reward cycle whose prepare phase begins in Epoch 4.1.

The full list is in SIP-046 and in the changelogs for 4.0.1 through 4.1.0.

This release includes the following changes:
https://github.com/stacks-network/stacks-core/blob/4.1.0/CHANGELOG.md

Added

  • The p2p network poller can now be woken up by readiness sources that are not sockets, and can reserve event IDs for their connections.
  • Added fuzz targets for the signer's handling of StackerDB messages, event-observer payloads and global state evaluation (libsigner/fuzz).

Changed

  • Set the mainnet Epoch 4.1 activation height to Bitcoin block 979,500, per SIP-046.
  • Starting in Epoch 4.1, the sortition DB rejects the defunct stack-stx, delegate-stx, and vote-for-aggregate-key burnchain operations. Operations mined in earlier epochs are still accepted so that sortition history replays unchanged; transfer-stx and pre-stx are unaffected.
  • Starting in Epoch 4.1, the PoX-5 per-cycle sBTC waterfall recipient is derived from the sBTC registry's signer set and signature threshold (get-current-signer-data) as an sBTC v2 Taproot script-path multisig deposit, instead of from the registry's WSTS aggregate public key (get-current-aggregate-pubkey). The recipient switches at the first reward cycle whose prepare phase begins in Epoch 4.1; after activation the node no longer reads the aggregate pubkey, so sBTC may rotate to v2 key sets.
  • If the registry does not return a usable signer set and threshold when an Epoch 4.1 reward set is computed, that cycle's block-commits pay the standard burn address instead of the node failing to process the block.
  • Beginning in Epoch 4.1, a contract-call transaction can only call define-public functions. A transaction that targets a define-read-only function now fails with a NoSuchPublicFunction runtime error, like one that targets a define-private function. Mempool admission already rejected such transactions.

Fixed

  • Fixes the runtime checks for let and match binding name conflicts to not only look at global functions, but all global definitions. This is only a defense-in-depth measure; the type checker should already prevent this much earlier. This applies starting in Clarity 7.
  • When the miner is about to extend its tenure into a new Bitcoin block (after an empty sortition, a sortition won with a block-commit that does not build on the ongoing tenure, or a new winner that does not produce a block in time) while a block it proposed is still waiting for signatures, it now waits for that block to land or be rejected (for at most block_found_in_flight_wait) before extending, instead of extending on the same parent. The extend was a sibling of the pending block, and a split between the two could stall the tenure until the next sortition.
  • Fixed the Nakamoto block downloader handing a reply meant for its unconfirmed-tenure downloader to its confirmed-tenure downloader, or taking a reply meant for another user of the same HTTP connection, such as mempool sync. A node that missed a block in a finished tenure could reject every peer's reply as the wrong block, disconnect from those peers, and never fetch the missing block.
  • Outbound p2p connection attempts that exceed connect_timeout are now dropped and their sockets closed. Previously they were left pending until the operating system gave up on the connection, and the node would not retry that neighbor in the meantime.
  • Signers no longer reject a block with SortitionViewMismatch when the rest of the signer set signed it, and the node processed it, before their own validation of it returned.
  • Signers and miners now ignore block rejections whose chain id is for another network (mainnet vs. testnet). Previously such a rejection was still counted, since its signature recovers to the same signer key.

Removed

  • Removed an unused test flag in SIP 031 support code.

Docker images have been published to GitHub Container Registry:

stacks-core

docker pull ghcr.io/stacks-network/stacks-core:4.1.0@sha256:cfed9f75fac76b76247da59cd9a2479123e1243dae083e20c8248e3d875a1fb2
docker pull ghcr.io/stacks-network/stacks-core:4.1.0-alpine@sha256:7dc8c316f19024f50e340e2880d57f0d0425b9cc4b86b65a03c145dc55526ebb

stacks-signer

docker pull ghcr.io/stacks-network/stacks-signer:4.1.0@sha256:5fbccfed4bc5ae9b3175fa52c4169ae17da271be9e5662ee14c6d5f17a1fcc28
docker pull ghcr.io/stacks-network/stacks-signer:4.1.0-alpine@sha256:5f81034cd6257471afe56d1d403d747ccdd6e65e6ab8d1eeb630554fe5f3e62f

Don't miss a new stacks-core release

NewReleases is sending notifications on new releases.