Skip to content

Commit 5029abf

Browse files
authored
Merge pull request #6499 from stacks-network/develop
merge develop -> aac-client-breaking
2 parents f183be7 + 87c4373 commit 5029abf

File tree

163 files changed

+7135
-3510
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+7135
-3510
lines changed

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[alias]
22
stacks-node = "run --package stacks-node --"
33
fmt-stacks = "fmt -- --config group_imports=StdExternalCrate,imports_granularity=Module"
4-
clippy-stacks = "clippy -p stx-genesis -p libstackerdb -p stacks-signer -p pox-locking -p clarity-serialization -p clarity -p libsigner -p stacks-common --no-deps --tests --all-features -- -D warnings"
4+
clippy-stacks = "clippy -p stx-genesis -p libstackerdb -p stacks-signer -p pox-locking -p clarity-types -p clarity -p libsigner -p stacks-common --no-deps --tests --all-features -- -D warnings"
55
clippy-stackslib = "clippy -p stackslib --no-deps -- -Aclippy::all -Wclippy::indexing_slicing -Wclippy::nonminimal_bool -Wclippy::clone_on_copy"
66

77
# Uncomment to improve performance slightly, at the cost of portability

.github/workflows/cargo-hack-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
run: |
9393
cargo hack check \
9494
-p clarity \
95-
-p clarity-serialization \
95+
-p clarity-types \
9696
-p stacks-common \
9797
--each-feature \
9898
--no-dev-deps \
@@ -102,7 +102,7 @@ jobs:
102102
- name: Run cargo hack check (WASM Deterministic)
103103
run: |
104104
cargo hack check \
105-
-p clarity-serialization \
105+
-p clarity-types \
106106
-p stacks-common \
107107
--each-feature \
108108
--no-dev-deps \

.github/workflows/clippy.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,7 @@ jobs:
4242
- name: Clippy
4343
id: clippy
4444
run: cargo clippy-stacks
45+
46+
- name: Clippy Stackslib
47+
id: clippy-stackslib
48+
run: cargo clippy-stackslib

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,29 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
99

1010
### Added
1111

12+
- Renamed `clarity-serialization` to `clarity-types`.
1213
- Add `stackerdb_timeout_secs` to miner config for limiting duration of StackerDB HTTP requests.
1314
- When determining a global transaction replay set, the state evaluator now uses a longest-common-prefix algorithm to find a replay set in the case where a single replay set has less than 70% of signer weight.
14-
- New endpoint /v3/tenures/blocks/ allowing retrieving the list of stacks blocks from a burn block
15+
- New endpoints /v3/tenures/blocks/, /v3/tenures/blocks/hash, /v3/tenures/blocks/height allowing retrieving the list of stacks blocks from a burn block
1516
- Creates epoch 3.3 and costs-4 in preparation for a hardfork to activate Clarity 4
1617
- Adds support for new Clarity 4 builtins (not activated until epoch 3.3):
1718
- `contract-hash?`
19+
- `current-contract`
20+
- `block-time`
21+
- `to-ascii?`
22+
- Added `contract_cost_limit_percentage` to the miner config file — sets the percentage of a block’s execution cost at which, if a large non-boot contract call would cause a BlockTooBigError, the miner will stop adding further non-boot contract calls and only include STX transfers and boot contract calls for the remainder of the block.
1823

1924
### Changed
2025

2126
- Clarity errors pertaining to syntax binding errors have been made more
2227
expressive (#6337)
2328
- Removed affirmation maps logic throughout, upgrading chainstate DB schema to 11 and burnchain DB schema to 3 (#6314)
2429

30+
### Fixed
31+
32+
- When running `stacks-inspect decode-tx`, print the correct version of the address (mainnet or testnet) based on the transaction passed in
33+
- When a contract deploy is analyzed, it will no longer throw a `CostError` when the contract contains an undefined top-level variable. Instead, it will throw a `UndefinedVariable` error.
34+
2535
## [3.2.0.0.1]
2636

2737
### Added

CONTRIBUTING.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ For an example of this process, see PRs
5656
test, module, function, etc.), each should be documented according
5757
to our [coding guidelines](#Coding-Guidelines).
5858

59-
> [*] The Changelog focuses on product changes. A "major change" refers to updates that have a direct impact on the end user, such as introducing new features, modifying existing functionality, or optimizing runtime performance.
59+
> [*] The Changelog focuses on product changes. A "major change" refers to updates that have a direct impact on the end user, such as introducing new features, modifying existing functionality, or optimizing runtime performance.
6060
On the other hand, changes that do not need to be reflected in the Changelog include code refactoring, writing tests, or automating processes, as these do not directly affect the user experience.
6161

6262
## Git Commit Messages
@@ -374,10 +374,10 @@ A test should be marked `#[ignore]` if:
374374
- **Integration tests need to be properly tagged** using [pinny-rs](https://github.com/BitcoinL2-Labs/pinny-rs/) crate. Tagging requires two fundamental steps:
375375
1. Define allowed tags in the package `Cargo.toml` file (if needed).
376376
2. Apply relevant tags to the tests, picking from the allowed set.
377-
377+
378378
Then it will be possible to run tests with filtering based on the tags using `cargo test` and `cargo nextest` runner.
379379
> For more information and examples on how tagging works, refer to the [pinny-rs](https://github.com/BitcoinL2-Labs/pinny-rs/) readme.
380-
380+
381381
Below the tag set currently defined with related purpose:
382382

383383
| Tag | Description |
@@ -406,16 +406,26 @@ cargo fmt-stacks
406406

407407
## Clippy Warnings
408408

409-
PRs will be checked against `clippy` and will _fail_ if any clippy warnings are generated.
410-
Unfortunately, not all existing clippy warnings have been addressed throughout stacks-core, so arguments must be passed via the command line.
411-
Therefore, we handle `clippy` configurations using a Cargo alias: `cargo clippy-stacks`
409+
All PRs are checked with `clippy`, and the CI will **fail** if any warnings are raised.
410+
Because not all existing clippy warnings in `stacks-core` have been addressed, we use Cargo aliases to standardize how clippy is run across different parts of the codebase.
411+
412+
Two commands are available:
412413

413-
You can check what warnings need to be addressed locally via:
414+
- `cargo clippy-stacks`
415+
Runs clippy across the core packages of the repository (e.g. `stx-genesis`, `clarity`, `stacks-signer`, etc.).
416+
417+
- `cargo clippy-stackslib`
418+
Runs clippy specifically on the `stackslib` package, with a different configuration.
419+
420+
To check warnings locally, run:
414421

415422
```bash
416423
cargo clippy-stacks
424+
cargo clippy-stackslib
417425
```
418426

427+
Make sure both commands pass before opening a pull request.
428+
419429
## Comments
420430

421431
Comments are very important for the readability and correctness of the codebase. The purpose of comments is:
@@ -491,7 +501,7 @@ impl<'a, 'b> ReadOnlyChecker<'a, 'b> {
491501
/// - Returns CheckErrors::WriteAttemptedInReadOnly if there is a read-only
492502
/// violation, i.e. if some function marked read-only attempts to modify
493503
/// the chainstate.
494-
pub fn run(&mut self, contract_analysis: &ContractAnalysis) -> CheckResult<()>
504+
pub fn run(&mut self, contract_analysis: &ContractAnalysis) -> Result<(), CheckError>
495505
```
496506

497507
This comment is considered positive because it explains the contract of the function in pseudo-code. Someone who understands the constructs mentioned could, e.g., write a test for this method from this description.

Cargo.lock

Lines changed: 12 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ members = [
44
"stackslib",
55
"stacks-common",
66
"pox-locking",
7-
"clarity-serialization",
7+
"clarity-types",
88
"clarity",
99
"stx-genesis",
1010
"libstackerdb",

clarity-serialization/Cargo.toml renamed to clarity-types/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
2-
name = "clarity-serialization"
2+
name = "clarity-types"
33
version = "0.0.1"
44
edition = "2024"
5-
description = "Serialization and deserialization for Stacks Clarity smart contract language types."
5+
description = "Canonical Rust representations for Clarity's core data types, error definitions, and serialization format."
66
license = "GPLv3"
77
homepage = "https://github.com/stacks-network/stacks-core"
88
repository = "https://github.com/stacks-network/stacks-core"
@@ -14,7 +14,7 @@ lazy_static = { workspace = true }
1414
regex = { version = "1", default-features = false }
1515
rusqlite = { workspace = true, optional = true }
1616
serde = { workspace = true }
17-
serde_json = { version = "1.0", default-features = false }
17+
serde_json = { version = "1.0", default-features = false, optional = true }
1818
serde_derive = { workspace = true }
1919
slog = { workspace = true }
2020
stacks_common = { package = "stacks-common", path = "../stacks-common", default-features = false }
@@ -28,7 +28,7 @@ default = []
2828
testing = []
2929
developer-mode = ["stacks_common/developer-mode"]
3030
slog_json = ["stacks_common/slog_json"]
31-
rusqlite = ["stacks_common/rusqlite", "dep:rusqlite"]
31+
rusqlite = ["stacks_common/rusqlite", "dep:rusqlite", "dep:serde_json"]
3232

3333
# Wasm-specific features for easier configuration
3434
wasm-web = ["stacks_common/wasm-web"]

clarity-serialization/README.md renamed to clarity-types/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Clarity Serialization (`clarity-serialization`)
1+
# Clarity Types (`clarity-types`)
22

33
[![License: GPLv3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
44

5-
A Rust crate for representing, serializing, and deserializing data types from the Stacks Clarity smart contract language.
5+
A Rust crate for representing all core data types, errors, and serializable structures of the Stacks Clarity smart contract language.
66

77
## Overview
88

@@ -13,6 +13,7 @@ This crate provides the core components for working with Clarity data structures
1313
* **Canonical Data Structures**: Rust representations for all Clarity types, including `int`, `uint`, `bool`, `principal`, `optional`, `response`, `tuple`, `list`, `buffer`, and strings.
1414
* **Consensus-Compatible Binary Codec**: Implements the binary serialization and deserialization format required by the Stacks blockchain.
1515
* **Type Safety**: Includes type-checking logic (`admits`, `least_supertype`) for validating values against type signatures.
16+
* **Canonical Errors**: The definitive enums for all static analysis, runtime, and internal errors that can occur during Clarity execution.
1617

1718
## Quick Start: Usage Examples
1819

@@ -21,7 +22,7 @@ This crate provides the core components for working with Clarity data structures
2122
This example demonstrates how to construct a complex Clarity `(tuple)` and serialize it to its hexadecimal string representation, which is suitable for use as a transaction argument.
2223

2324
```rust
24-
use clarity_serialization::types::{PrincipalData, TupleData, Value};
25+
use clarity_types::types::{PrincipalData, TupleData, Value};
2526

2627
fn main() -> Result<(), Box<dyn std::error::Error>> {
2728
// 1. Construct the individual values that will go into our tuple.
@@ -64,7 +65,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
6465
This example shows the reverse process: taking a hex string and deserializing it into a structured `Value` object, while validating it against an expected type.
6566

6667
```rust
67-
use clarity_serialization::types::{TypeSignature, Value};
68+
use clarity_types::types::{TypeSignature, Value};
6869

6970
fn main() -> Result<(), Box<dyn std::error::Error>> {
7071
let hex_string = "0c000000030269640100000000000000000000000000000065086d657461646174610a0200000004deadbeef056f776e65720514a46ff88886c2ef9762d970b4d2c63678835bd39d";
File renamed without changes.

0 commit comments

Comments
 (0)