Release 2.1.0.0.0: Stacks 2.1 Hard Fork

29 views
Skip to first unread message

Jude Nelson

unread,
Feb 20, 2023, 1:08:30 PM2/20/23
to announce
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hello,

We have released Stacks version 2.1.0.0.0, available here: https://github.com/blockstack/stacks-blockchain/releases/tag/2.1.0.0.
This is a **consensus-breaking** release that introduces a _lot_ of new
functionality.  Details on the how and why can be found in [SIP-015](https://github.com/stacksgov/sips/blob/feat/sip-015/sips/sip-015/sip-015-network-upgrade.md),
[SIP-018](https://github.com/MarvinJanssen/sips/blob/feat/signed-structured-data/sips/sip-018/sip-018-signed-structured-data.md),
and [SIP-20](https://github.com/obycode/sips/blob/bitwise-ops/sips/sip-020/sip-020-bitwise-ops.md).

Since this is a hard fork upgrade, *attempting to upgrade an existing chainstate will fail*.
Node operators must perform a full genesis sync when booting a 2.1-series node.  A 2.05-series chainstate will not work.

The block height at which the 2.1.0.0.0 rules take effect is Bitcoin block 781,551.  This should happen around March 20, 2023, but please be sure to
monitor the Bitcoin blockchain until then to get a better time estimate as the chain height gets closer to this value.

Changelog:

## [2.1]

This is a **consensus-breaking** release that introduces a _lot_ of new
functionality.  Details on the how and why can be found in [SIP-015](https://github.com/stacksgov/sips/blob/feat/sip-015/sips/sip-015/sip-015-network-upgrade.md),
[SIP-018](https://github.com/MarvinJanssen/sips/blob/feat/signed-structured-data/sips/sip-018/sip-018-signed-structured-data.md),
and [SIP-20](https://github.com/obycode/sips/blob/bitwise-ops/sips/sip-020/sip-020-bitwise-ops.md).

The changelog for this release is a high-level summary of these SIPs.

### Added

- - There is a new `.pox-2` contract for implementing proof-of-transfer.  This PoX
  contract enables re-stacking while the user's STX are locked, and incrementing
the amount stacked on top of a locked batch of STX.
- - The Clarity function `stx-account` has been added, which returns the account's
  locked and unlocked balances.
- - The Clarity functions `principal-destruct` and `principal-construct?`
  functions have been added, which provide the means to convert between a
`principal` instance and the `buff`s and `string-ascii`s that constitute it.
- - The Clarity function `get-burn-block-info?` has been added to support
  fetching the burnchain header hash of _any_ burnchain block starting from the
sortition height of the Stacks genesis block, and to support fetching the PoX
addresses and rewards paid by miners for a particular burnchain block height.
- - The Clarity function `slice` has been added for obtaining a sub-sequence of a
  `buff`, `string-ascii`, `string-utf8`, or `list`.
- - Clarity functions for converting between `string-ascii`, `string-utf8`,
  `uint`, and `int` have been added.
- - Clarity functions for converting between big- and little-endian
`buff`  representations of `int` and `uint` have been added.
- - The Clarity function `stx-transfer-memo?` has been added, which behaves the
  same as `stx-transfer?` but also takes a memo argument.
- - The Clarity function `is-standard` has been added to identify whether or not a
  `principal` instance is a standard or contract principal.
- - Clarity functions have been added for converting an arbitrary Clarity type to
  and from its canonical byte string representation.
- - The Clarity function `replace-at?` has been added for replacing a single item
  in a `list`, `string-ascii`, `string-utf8`, or `buff`.
- - The Clarity global variable `tx-sponsor?` has been added, which evaluates to
  the sponsor of the transaction if the transaction is sponsored.
- - The Clarity global variable `chain-id` has been added, which evaluates to the
  4-byte chain ID of this Stacks network.
- - The Clarity parser has been rewritten to be about 3x faster than the parser in
  Stacks 2.05.x.x.x.
- - Clarity trait semantics have been refined and made more explicit, so as to
  avoid certain corner cases where a trait reference might be downgraded to a
`principal` in Clarity 1.
  * Trait values can be passed to compatible sub-trait types
  * Traits can be embedded in compound types, e.g. `(optional <my-trait>)`
  * Traits can be assigned to a let-variable
- - Fixes to unexpected behavior in traits
  * A trait with duplicate function names is now an error
  * Aliased trait names do not interfere with local trait definitions
- - The comparison functions `<`, `<=`, `>`, and `>=` now work on `string-ascii`,
  `string-utf8`, and `buff` based on byte-by-byte comparison (note that this is
_not_ lexicographic comparison).
- - It is now possible to call `delegate-stx` from a burnchain transaction, just
  as it is for `stack-stx` and `transfer-stx`.

### Changed

- - The `delegate-stx` function in `.pox-2` can be called while the user's STX are
  locked.
- - If a batch of STX is not enough to clinch even a single reward slot, then the
  STX are automatically unlocked at the start of the reward cycle in which they
are rendered useless in this capacity.
- - The PoX sunset has been removed.  PoX rewards will continue in perpetuity.
- - Support for segwit and taproot addresses (v0 and v1 witness programs) has been
  added for Stacking.
- - The Clarity function `get-block-info?` now supports querying a block's total
  burnchain spend by miners who tried to mine it, the spend by the winner, and
the total block reward (coinbase plus transaction fees).
- - A block's coinbase transaction may specify an alternative recipient principal,
  which can be either a standard or contract principal.
- - A smart contract transaction can specify which version of Clarity to use.  If
  no version is given, then the epoch-default version will be used (in Stacks
2.1, this is Clarity 2).
- - The Stacks node now includes the number of PoX anchor blocks in its
  fork-choice rules. The best Stacks fork is the fork that (1) is on the best
Bitcoin fork, (2) has the most PoX anchor blocks known, and (3) is the longest.
- - On-burnchain operations -- `stack-stx`, `delegate-stx`, and `transfer-stx` --
  can take effect within six (6) burnchain blocks in which they are mined,
instead of one.
- - Transaction fees are debited from accounts _before_ the transaction is
  processed.
- - All smart contract analysis errors are now treated as runtime errors, meaning
  that smart contract transactions which don't pass analysis will still be mined
(so miners get paid for partially validating them).
- - The default Clarity version is now 2.  Users can opt for version 1 by using
  the new smart contract transaction wire format and explicitly setting version

### Fixed

- - The authorization of a `contract-caller` in `.pox-2` for stacking will now
  expire at the user-specified height, if given.
- - The Clarity function `principal-of?` now works on mainnet.
- - One or more late block-commits no longer result in the miner losing its
  sortition weight.
- - Documentation will indicate explicitly which Clarity version introduced each
  keyword or function.

Git commit hash: f0ed1b950ae1bafe1b23b68bced9f1eff66d7a99
SHA512SUMS:
10a7e3f83cbb4f63301a8e5ceb41716e9b83cffae0c325d4418b3d8c4db738f28445ad10f6c974e0051507bdf51b7c81af782aff9f543ce728643a1d0aa4cea6  linux-arm64.zip
6dfead0ffd324d23a0549c3cd6d9f0ab0d98f60466d678b6b9d594bf6e35d774c432139f8c9d5e4349a5a9193e179f3be8350cf8f78a38d419c2002f96059dce  linux-armv7.zip
e56b92431de79eaa720695799ea46d83d7706064f4a7cff3e9554832b5e2047c12444dfe8ca207c15956abbdbe447712032f56545550a4fbb638b757d61b36b2  linux-musl-x64.zip
c51eee2120e9c47a848b56357fc7fc13f4b306bb69b89612bbbb76b1efcb556724c33baaa480341acfc6a0f624fb2200066f6172b293bf3f37975026991c4f83  linux-x64.zip
e6babd78082d60fb04496d5ff605ce3650fda3a995d722206c33f8e94353c2f48f16082274bf21a7e7fd33c39aa509c610064dc1d958ea25af6ccdbb79ea5387  macos-arm64.zip
e981e36915cc13255cc58c2ff208ccdd66aa3282a807e541330a6a2e9ac8c02599802346829932a7ca14011f291703e5fcc7fff0747146971598f7b089f270c7  macos-x64.zip
b8200c53685f62e8f26540ec5e77bc638aa39917d340bbe004b74712530ed1d6fc1a02f3795155980320b4e52b71c619f322bb78dca364c75140b3e9a195c0a9  stacks-blockchain-2.1.0.0.0.tar.gz
80dc20bc25711a1f0946d899155485fdf2fcb304b455c19b694943c3aec7a8260132a0219afac9267cc20675546063ce7434d1bfeb2c9ba43f34e6d2e187cd9e  stacks-blockchain-2.1.0.0.0.zip
08cce9ec29c0f4ca408c91d895fe2aa8fa38a96e8dbac79699a324f76a05b46e86812a67c3a26afde68d63c53d371882826b3083b8856eec08e355b80fcf5122  windows-x64.zip

Best,
Jude Nelson
Research Scientist, Stacks Foundation
-----BEGIN PGP SIGNATURE-----

iQJIBAEBCgAyFiEE+sxHzEvL+E3rJvk7PXTWiNCCJ4QFAmPzuF4UHGp1ZGVAYmxv
Y2tzdGFjay5jb20ACgkQPXTWiNCCJ4RbPxAAjuxR6otVNUnAvdc/5EeVnIG6+uhN
vQf85XoyAW53qgFH6V8kYtyxNO/WMWiYU3h6/gi1mjlDqIOQaNjHgRomi+RtINT0
YkYG6KWUPgBwIxH9vUc4iWqynsOu5KaJ0Nq7rFfWvqMT7P7/3JorAaBR3G/k7hWC
OwjNRi6AgCQke1S1sh6wjy378AE6Ipv+OZIDnxkc9hKrBIcQenrsenJ25DWkmUo5
gbrMFcADNDBPpjCMw/4h1TvwiHiEAnsJkC1sLi19L3a6WR9I2oSvlEoi917zjriQ
NYCft9J/9RZBASebitOe4gQf66mrZ0GePhi2ucsRGvVuwBg1+yTDibScGBHUkDY6
Uq+KHdsTjVJZ1wGesPbi1TVoAsIRJWr+Eik9jrGpdxC77NFYWtUAX7w+KfEQKrYN
vRkJJbDh5Sylg7EYSQE4eTFqhBdT0dtVo9YLpZxXh7LbMnv8GTBsRe4CHPQTGLxF
nGXmFZWLiQ+ov6WJ9I7eKXQ9BcwS+XLUAVw3V3hyc4jMCth3gFrt7mc7U80qii7S
rSve/zqiY5MWr4EAKH2S4ybZRmrEOeP3AbrrKT0cr83Rw1T70cVh3d/EWWBZ/nNB
IBH/yEVXMXG0rq9p3XWBtD0CU7mOGjPSw/PvDvOjX5wAGIrdhJDnbfH/9ngO8pQ7
wRlRQNnOwTSqxwo=
=mKBu
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages