Skip to content

Commit 4d661fc

Browse files
committed
Merge branch 'develop' into feat/clarity-4
2 parents 36e71aa + 1393537 commit 4d661fc

File tree

271 files changed

+11570
-23094
lines changed

Some content is hidden

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

271 files changed

+11570
-23094
lines changed

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
stacks-node = "run --package stacks-node --"
33
fmt-stacks = "fmt -- --config group_imports=StdExternalCrate,imports_granularity=Module"
44
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"
5-
clippy-stackslib = "clippy -p stackslib --no-deps -- -Aclippy::all -Wclippy::indexing_slicing"
5+
clippy-stackslib = "clippy -p stackslib --no-deps -- -Aclippy::all -Wclippy::indexing_slicing -Wclippy::nonminimal_bool"
66

77
# Uncomment to improve performance slightly, at the cost of portability
88
# * Note that native binaries may not run on CPUs that are different from the build machine

.github/workflows/bitcoin-tests.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,6 @@ jobs:
8080
- test-name: tests::epoch_205::test_dynamic_db_method_costs
8181
- test-name: tests::epoch_205::test_exact_block_costs
8282
- test-name: tests::epoch_205::transition_empty_blocks
83-
- test-name: tests::epoch_21::test_pox_missing_five_anchor_blocks
84-
- test-name: tests::epoch_21::test_pox_reorg_flap_duel
85-
- test-name: tests::epoch_21::test_pox_reorg_flap_reward_cycles
86-
- test-name: tests::epoch_21::test_pox_reorg_one_flap
87-
- test-name: tests::epoch_21::test_pox_reorgs_three_flaps
8883
- test-name: tests::epoch_21::test_sortition_divergence_pre_21
8984
- test-name: tests::epoch_21::test_v1_unlock_height_with_current_stackers
9085
- test-name: tests::epoch_21::test_v1_unlock_height_with_delay_and_current_stackers
@@ -99,7 +94,6 @@ jobs:
9994
- test-name: tests::epoch_21::transition_removes_pox_sunset
10095
- test-name: tests::epoch_22::disable_pox
10196
- test-name: tests::epoch_22::pox_2_unlock_all
102-
- test-name: tests::epoch_22::test_pox_reorg_one_flap
10397
- test-name: tests::epoch_23::trait_invocation_behavior
10498
- test-name: tests::epoch_24::fix_to_pox_contract
10599
- test-name: tests::epoch_24::verify_auto_unlock_behavior

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

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@ jobs:
3838
with:
3939
persist-credentials: false
4040

41-
- name: Setup Rust with Cache
41+
- name: Setup Rust
4242
uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 # v1.10.1
4343
with:
4444
toolchain: ${{ needs.setup.outputs.rust-toolchain }}
4545
target: x86_64-pc-windows-gnu,x86_64-unknown-linux-gnu
46-
cache: true
47-
cache-key: cargo-hack-native-${{ needs.setup.outputs.rust-toolchain }}-${{ hashFiles('**/Cargo.lock') }}
46+
cache: false
4847

4948
- name: Install cargo-hack
5049
uses: taiki-e/install-action@2383334cf567d78771fc7d89b6b3802ef1412cf6 # v2.56.8
@@ -66,56 +65,49 @@ jobs:
6665
--target x86_64-pc-windows-gnu \
6766
--target x86_64-unknown-linux-gnu
6867
69-
# WASM targets - separate cache since dependencies differ
68+
# WASM targets - No caching needed as it runs in parallel with longer jobs
7069
wasm-targets:
71-
name: ${{ matrix.name }}
70+
name: WASM targets
7271
runs-on: ubuntu-latest
7372
needs: setup
74-
strategy:
75-
fail-fast: false
76-
matrix:
77-
include:
78-
- name: "Clarity & Stacks-Common WASM Web"
79-
command: |
80-
cargo hack check \
81-
-p clarity-serialization \
82-
-p stacks-common \
83-
--each-feature \
84-
--no-dev-deps \
85-
--exclude-features=default,rusqlite,ctrlc-handler,wasm-deterministic \
86-
--features=wasm-web
87-
88-
- name: "Clarity & Stacks-Common WASM Deterministic"
89-
command: |
90-
cargo hack check \
91-
-p clarity-serialization \
92-
-p stacks-common \
93-
--each-feature \
94-
--no-dev-deps \
95-
--include-features=wasm-deterministic,slog_json \
96-
--features=wasm-deterministic
97-
9873
steps:
9974
- name: Checkout
10075
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
10176
with:
10277
persist-credentials: false
10378

104-
- name: Setup Rust with Cache
79+
- name: Setup Rust
10580
uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 # v1.10.1
10681
with:
10782
toolchain: ${{ needs.setup.outputs.rust-toolchain }}
10883
target: wasm32-unknown-unknown
109-
cache: true
110-
cache-key: cargo-hack-wasm-${{ matrix.name }}-${{ needs.setup.outputs.rust-toolchain }}-${{ hashFiles('**/Cargo.lock') }}
84+
cache: false
11185

11286
- name: Install cargo-hack
11387
uses: taiki-e/install-action@2383334cf567d78771fc7d89b6b3802ef1412cf6 # v2.56.8
11488
with:
11589
tool: cargo-hack
11690

117-
- name: Run cargo hack check
118-
run: ${{ matrix.command }}
91+
- name: Run cargo hack check (WASM Web)
92+
run: |
93+
cargo hack check \
94+
-p clarity \
95+
-p clarity-serialization \
96+
-p stacks-common \
97+
--each-feature \
98+
--no-dev-deps \
99+
--exclude-features=default,rusqlite,ctrlc-handler,wasm-deterministic,testing \
100+
--features=wasm-web
101+
102+
- name: Run cargo hack check (WASM Deterministic)
103+
run: |
104+
cargo hack check \
105+
-p clarity-serialization \
106+
-p stacks-common \
107+
--each-feature \
108+
--no-dev-deps \
109+
--include-features=wasm-deterministic,slog_json \
110+
--features=wasm-deterministic
119111
120112
fuzz-targets:
121113
name: Fuzz targets (nightly)
@@ -130,10 +122,18 @@ jobs:
130122
uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 # v1.13.0
131123
with:
132124
toolchain: nightly
125+
cache: false
133126

134-
- name: Check fuzz targets
127+
- name: Check fuzz targets (clarity)
135128
run: |
136129
cargo +nightly check \
137130
--manifest-path clarity/fuzz/Cargo.toml \
138131
--bins \
139132
--locked
133+
134+
- name: Check fuzz targets (stackslib)
135+
run: |
136+
cargo +nightly check \
137+
--manifest-path stackslib/fuzz/Cargo.toml \
138+
--bins \
139+
--locked

.github/workflows/clippy.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,19 @@ jobs:
2626
- name: Checkout the latest code
2727
id: git_checkout
2828
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
2930
- name: Define Rust Toolchain
3031
id: define_rust_toolchain
3132
run: echo "RUST_TOOLCHAIN=$(cat ./rust-toolchain)" >> $GITHUB_ENV
33+
3234
- name: Setup Rust Toolchain
3335
id: setup_rust_toolchain
3436
uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 # v1.10.1
3537
with:
3638
toolchain: ${{ env.RUST_TOOLCHAIN }}
3739
components: clippy
40+
cache: false
41+
3842
- name: Clippy
3943
id: clippy
4044
run: cargo clippy-stacks

.github/workflows/constants-check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@ jobs:
1717
- name: Checkout the latest code
1818
id: git_checkout
1919
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
2021
- name: Define Rust Toolchain
2122
id: define_rust_toolchain
2223
run: echo "RUST_TOOLCHAIN=$(cat ./rust-toolchain)" >> $GITHUB_ENV
24+
2325
- name: Setup Rust Toolchain
2426
id: setup_rust_toolchain
2527
uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 # v1.10.1
2628
with:
2729
toolchain: ${{ env.RUST_TOOLCHAIN }}
30+
cache: false
2831

2932
- name: Dump constants JSON
3033
id: consts-dump

.github/workflows/nix-check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@ jobs:
3838
- uses: DeterminateSystems/magic-nix-cache-action@e1c1dae8e170ed20fd2e6aaf9979ca2d3905d636 # v12
3939
with:
4040
use-flakehub: false # Remove error when trying to authenticate without credentials
41+
use-gha-cache: false # Disable uploading cache to gha cache
4142
- run: nix flake check ./contrib/nix

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,21 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
99

1010
### Added
1111

12+
- Add `stackerdb_timeout_secs` to miner config for limiting duration of StackerDB HTTP requests.
1213
- 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
1315
- Creates epoch 3.3 and costs-4 in preparation for a hardfork to activate Clarity 4
1416
- Adds support for new Clarity 4 builtins (not activated until epoch 3.3):
1517
- `contract-hash?`
1618

19+
### Changed
20+
21+
- Clarity errors pertaining to syntax binding errors have been made more
22+
expressive (#6337)
23+
- Removed affirmation maps logic throughout, upgrading chainstate DB schema to 11 and burnchain DB schema to 3 (#6314)
24+
1725
## [3.2.0.0.1]
26+
1827
### Added
1928

2029
- Adds node-config-docsgen to automatically create config documentation (#6227)

Cargo.lock

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

clarity-serialization/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ readme = "README.md"
1212
[dependencies]
1313
lazy_static = { workspace = true }
1414
regex = { version = "1", default-features = false }
15+
rusqlite = { workspace = true, optional = true }
1516
serde = { workspace = true }
17+
serde_json = { version = "1.0", default-features = false }
1618
serde_derive = { workspace = true }
1719
slog = { workspace = true }
1820
stacks_common = { package = "stacks-common", path = "../stacks-common", default-features = false }
19-
thiserror = { workspace = true }
2021

2122
[dev-dependencies]
2223
mutants = "0.0.3"
@@ -25,7 +26,9 @@ rstest = "0.17.0"
2526
[features]
2627
default = []
2728
testing = []
29+
developer-mode = ["stacks_common/developer-mode"]
2830
slog_json = ["stacks_common/slog_json"]
31+
rusqlite = ["stacks_common/rusqlite", "dep:rusqlite"]
2932

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

clarity-serialization/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,15 @@ This crate provides the core components for working with Clarity data structures
2121
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.
2222

2323
```rust
24-
use clarity_serialization::types::{Value, TupleData, PrincipalData};
24+
use clarity_serialization::types::{PrincipalData, TupleData, Value};
2525

2626
fn main() -> Result<(), Box<dyn std::error::Error>> {
2727
// 1. Construct the individual values that will go into our tuple.
2828
let id = Value::UInt(101);
29-
let owner = Value::Principal(
30-
PrincipalData::parse("SM2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQVX8X0G")?
31-
);
32-
let metadata = Value::some(
33-
Value::buff_from(vec![0xde, 0xad, 0xbe, 0xef])?
34-
)?;
29+
let owner = Value::Principal(PrincipalData::parse(
30+
"SM2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQVX8X0G",
31+
)?);
32+
let metadata = Value::some(Value::buff_from(vec![0xde, 0xad, 0xbe, 0xef])?)?;
3533

3634
// 2. Create a vec of name-value pairs for the tuple.
3735
let tuple_fields = vec![
@@ -44,7 +42,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
4442
let my_tuple = Value::from(TupleData::from_data(tuple_fields)?);
4543

4644
// 4. Serialize the tuple to its consensus-cricital hex string.
47-
let hex_string = my_tuple.serialize_to_hex()?;
45+
let hex_string = my_tuple
46+
.serialize_to_hex()
47+
.map_err(|e| format!("Error serializing tuple to hex: {e:?}"))?;
4848

4949
println!("Clarity Tuple: {my_tuple}");
5050
println!("Serialized Hex: {hex_string}");
@@ -64,7 +64,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
6464
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.
6565

6666
```rust
67-
use clarity_serialization::types::{Value, TypeSignature};
67+
use clarity_serialization::types::{TypeSignature, Value};
6868

6969
fn main() -> Result<(), Box<dyn std::error::Error>> {
7070
let hex_string = "0c000000030269640100000000000000000000000000000065086d657461646174610a0200000004deadbeef056f776e65720514a46ff88886c2ef9762d970b4d2c63678835bd39d";

0 commit comments

Comments
 (0)