Skip to content

Commit 261d603

Browse files
Merge branch 'develop' into refactor/stacks-inspect-clap
2 parents 465631d + 68c6703 commit 261d603

File tree

275 files changed

+64455
-554
lines changed

Some content is hidden

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

275 files changed

+64455
-554
lines changed

.github/workflows/bitcoin-tests.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ jobs:
3232
with:
3333
btc-version: "25.0"
3434

35-
- name: Build Test Archive
36-
run: |
37-
set -euo pipefail
38-
cargo nextest archive --archive-file ~/test_archive.tar.zst --bin stacks-node
39-
4035
- name: List ignored tests
4136
id: list
4237
run: |

CHANGELOG.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,35 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to the versioning scheme outlined in the [README.md](README.md).
77

8-
## [3.3.0.0.4]
8+
## [Unreleased]
99

1010
### Added
1111

12-
- New `/v3/tenures/tip_metadata` endpoint for returning some metadata along with the normal tenure tip information.
12+
- Setup for epoch 3.4 and Clarity version 5. Epoch 3.4 is currently set to activate at Bitcoin height 3,400,000 (very far in the future) until an activation height is selected. Clarity will activate with epoch 3.4.
1313

14-
15-
## [3.3.0.0.3]
14+
## [3.3.0.0.5]
1615

1716
### Added
1817

19-
- In the `/v3/transaction/{txid}` RPC endpoint, added `block_height` and `is_canonical` to the response.
18+
- New endpoint `/v3/blocks/simulate/{block_id}` allows to simulate the execution of a specific block with a brand new set of transactions
2019
- Improved block validation in `stacks-inspect`.
2120

2221
### Changed
2322

2423
- Removed `validate-naka-block` option in `stacks-inspect`, merging it with `validate-block` so that users do not need to differentiate between the two.
2524

25+
## [3.3.0.0.4]
26+
27+
### Added
28+
29+
- New `/v3/tenures/tip_metadata` endpoint for returning some metadata along with the normal tenure tip information.
30+
31+
## [3.3.0.0.3]
32+
33+
### Added
34+
35+
- In the `/v3/transaction/{txid}` RPC endpoint, added `block_height` and `is_canonical` to the response.
36+
2637
### Fixed
2738

2839
- When mining, do not try to extend (or initiate) a tenure that did not commit to the ongoing chain tip (see #6744)

CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,25 @@ A test should be marked `#[ignore]` if:
386386
| `bitcoind` | tests requiring bitcoin daemon |
387387
| `flaky` | tests that exhibit flaky behavior |
388388

389+
- **Consensus tests use `insta` to record snapshots** and then compare results across runs to ensure that there are no accidental consensus changes.
390+
1. Install `insta`:
391+
392+
```bash
393+
cargo install cargo-insta
394+
```
395+
396+
2. Run snapshot tests with `insta`:
397+
398+
```bash
399+
cargo insta test -p stackslib --unreferenced=delete -- chainstate::tests --include-ignored
400+
```
401+
402+
3. Review/accept snapshot updates:
403+
404+
```bash
405+
cargo insta review
406+
```
407+
389408
## Formatting
390409

391410
PRs will be checked against `rustfmt` and will _fail_ if not properly formatted.

clarity-types/src/types/signatures.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,8 @@ impl TypeSignature {
455455
| StacksEpochId::Epoch30
456456
| StacksEpochId::Epoch31
457457
| StacksEpochId::Epoch32
458-
| StacksEpochId::Epoch33 => self.admits_type_v2_1(other),
458+
| StacksEpochId::Epoch33
459+
| StacksEpochId::Epoch34 => self.admits_type_v2_1(other),
459460
StacksEpochId::Epoch10 => Err(ClarityTypeError::UnsupportedEpoch(*epoch)),
460461
}
461462
}
@@ -663,7 +664,8 @@ impl TypeSignature {
663664
| StacksEpochId::Epoch30
664665
| StacksEpochId::Epoch31
665666
| StacksEpochId::Epoch32
666-
| StacksEpochId::Epoch33 => self.canonicalize_v2_1(),
667+
| StacksEpochId::Epoch33
668+
| StacksEpochId::Epoch34 => self.canonicalize_v2_1(),
667669
}
668670
}
669671

@@ -1002,7 +1004,8 @@ impl TypeSignature {
10021004
| StacksEpochId::Epoch30
10031005
| StacksEpochId::Epoch31
10041006
| StacksEpochId::Epoch32
1005-
| StacksEpochId::Epoch33 => Self::least_supertype_v2_1(a, b),
1007+
| StacksEpochId::Epoch33
1008+
| StacksEpochId::Epoch34 => Self::least_supertype_v2_1(a, b),
10061009
StacksEpochId::Epoch10 => Err(ClarityTypeError::UnsupportedEpoch(*epoch)),
10071010
}
10081011
}

clarity/src/vm/analysis/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ pub fn run_analysis(
150150
| StacksEpochId::Epoch30
151151
| StacksEpochId::Epoch31
152152
| StacksEpochId::Epoch32
153-
| StacksEpochId::Epoch33 => {
153+
| StacksEpochId::Epoch33
154+
| StacksEpochId::Epoch34 => {
154155
TypeChecker2_1::run_pass(&epoch, &mut contract_analysis, db, build_type_map)
155156
}
156157
StacksEpochId::Epoch10 => {

clarity/src/vm/analysis/type_checker/mod.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ impl FunctionType {
4747
| StacksEpochId::Epoch30
4848
| StacksEpochId::Epoch31
4949
| StacksEpochId::Epoch32
50-
| StacksEpochId::Epoch33 => self.check_args_2_1(accounting, args, clarity_version),
50+
| StacksEpochId::Epoch33
51+
| StacksEpochId::Epoch34 => self.check_args_2_1(accounting, args, clarity_version),
5152
StacksEpochId::Epoch10 => Err(StaticCheckErrorKind::ExpectsRejectable(
5253
"Epoch10 is not supported".into(),
5354
)
@@ -74,7 +75,8 @@ impl FunctionType {
7475
| StacksEpochId::Epoch30
7576
| StacksEpochId::Epoch31
7677
| StacksEpochId::Epoch32
77-
| StacksEpochId::Epoch33 => {
78+
| StacksEpochId::Epoch33
79+
| StacksEpochId::Epoch34 => {
7880
self.check_args_by_allowing_trait_cast_2_1(db, clarity_version, func_args)
7981
}
8082
StacksEpochId::Epoch10 => Err(StaticCheckErrorKind::ExpectsRejectable(
@@ -96,6 +98,8 @@ fn is_reserved_word_v3(word: &str) -> bool {
9698
pub fn is_reserved_word(word: &str, version: ClarityVersion) -> bool {
9799
match version {
98100
ClarityVersion::Clarity1 | ClarityVersion::Clarity2 => false,
99-
ClarityVersion::Clarity3 | ClarityVersion::Clarity4 => is_reserved_word_v3(word),
101+
ClarityVersion::Clarity3 | ClarityVersion::Clarity4 | ClarityVersion::Clarity5 => {
102+
is_reserved_word_v3(word)
103+
}
100104
}
101105
}

clarity/src/vm/analysis/type_checker/v2_1/contexts.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ impl TraitContext {
4040
pub fn new(clarity_version: ClarityVersion) -> TraitContext {
4141
match clarity_version {
4242
ClarityVersion::Clarity1 => Self::Clarity1(HashMap::new()),
43-
ClarityVersion::Clarity2 | ClarityVersion::Clarity3 | ClarityVersion::Clarity4 => {
44-
Self::Clarity2 {
45-
defined: HashSet::new(),
46-
all: HashMap::new(),
47-
}
48-
}
43+
ClarityVersion::Clarity2
44+
| ClarityVersion::Clarity3
45+
| ClarityVersion::Clarity4
46+
| ClarityVersion::Clarity5 => Self::Clarity2 {
47+
defined: HashSet::new(),
48+
all: HashMap::new(),
49+
},
4950
}
5051
}
5152

clarity/src/vm/analysis/type_checker/v2_1/tests/contracts.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2545,7 +2545,10 @@ fn clarity_trait_experiments_downcast_literal_2(
25452545
})
25462546
.unwrap_err();
25472547
match version {
2548-
ClarityVersion::Clarity2 | ClarityVersion::Clarity3 | ClarityVersion::Clarity4 => {
2548+
ClarityVersion::Clarity2
2549+
| ClarityVersion::Clarity3
2550+
| ClarityVersion::Clarity4
2551+
| ClarityVersion::Clarity5 => {
25492552
assert!(err.starts_with("ExpectedCallableType(PrincipalType)"))
25502553
}
25512554
ClarityVersion::Clarity1 => {
@@ -2747,7 +2750,10 @@ fn clarity_trait_experiments_trait_cast_incompatible(
27472750
assert!(err.starts_with("TypeError(CallableType(Trait(TraitIdentifier"))
27482751
}
27492752
}
2750-
ClarityVersion::Clarity2 | ClarityVersion::Clarity3 | ClarityVersion::Clarity4 => {
2753+
ClarityVersion::Clarity2
2754+
| ClarityVersion::Clarity3
2755+
| ClarityVersion::Clarity4
2756+
| ClarityVersion::Clarity5 => {
27512757
assert!(err.starts_with("IncompatibleTrait"))
27522758
}
27532759
}

clarity/src/vm/ast/mod.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -478,14 +478,14 @@ mod test {
478478
write_length: u64::MAX,
479479
runtime: 1,
480480
};
481-
let mut tracker = LimitedCostTracker::new_with_limit(StacksEpochId::Epoch33, limit);
481+
let mut tracker = LimitedCostTracker::new_with_limit(StacksEpochId::latest(), limit);
482482

483483
let err = build_ast(
484484
&QualifiedContractIdentifier::transient(),
485485
"(define-constant my-const u1)",
486486
&mut tracker,
487-
ClarityVersion::Clarity4,
488-
StacksEpochId::Epoch33,
487+
ClarityVersion::latest(),
488+
StacksEpochId::latest(),
489489
)
490490
.unwrap_err();
491491

@@ -508,14 +508,14 @@ mod test {
508508
write_length: u64::MAX,
509509
runtime: expected_ast_parse_cost,
510510
};
511-
let mut tracker = LimitedCostTracker::new_with_limit(StacksEpochId::Epoch33, limit);
511+
let mut tracker = LimitedCostTracker::new_with_limit(StacksEpochId::latest(), limit);
512512

513513
let err = build_ast(
514514
&QualifiedContractIdentifier::transient(),
515515
"(define-constant a 0)(define-constant b 1)", // no dependency = 0 graph edge
516516
&mut tracker,
517-
ClarityVersion::Clarity4,
518-
StacksEpochId::Epoch33,
517+
ClarityVersion::latest(),
518+
StacksEpochId::latest(),
519519
)
520520
.expect_err("Expected parse error, but found success!");
521521

@@ -540,14 +540,14 @@ mod test {
540540
write_length: u64::MAX,
541541
runtime: expected_ast_parse_cost,
542542
};
543-
let mut tracker = LimitedCostTracker::new_with_limit(StacksEpochId::Epoch33, limit);
543+
let mut tracker = LimitedCostTracker::new_with_limit(StacksEpochId::latest(), limit);
544544

545545
let err = build_ast(
546546
&QualifiedContractIdentifier::transient(),
547547
"(define-constant a 0)(define-constant b a)", // 1 dependency = 1 graph edge
548548
&mut tracker,
549-
ClarityVersion::Clarity4,
550-
StacksEpochId::Epoch33,
549+
ClarityVersion::latest(),
550+
StacksEpochId::latest(),
551551
)
552552
.expect_err("Expected parse error, but found success!");
553553

@@ -573,8 +573,8 @@ mod test {
573573
&QualifiedContractIdentifier::transient(),
574574
&contract,
575575
&mut (),
576-
ClarityVersion::Clarity4,
577-
StacksEpochId::Epoch33,
576+
ClarityVersion::latest(),
577+
StacksEpochId::latest(),
578578
)
579579
.expect_err("Expected parse error, but found success!");
580580

@@ -595,8 +595,8 @@ mod test {
595595
&QualifiedContractIdentifier::transient(),
596596
&contract,
597597
&mut (),
598-
ClarityVersion::Clarity4,
599-
StacksEpochId::Epoch33,
598+
ClarityVersion::latest(),
599+
StacksEpochId::latest(),
600600
)
601601
.expect_err("Expected parse error, but found success!");
602602

clarity/src/vm/costs/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ impl LimitedCostTracker {
851851
| StacksEpochId::Epoch30
852852
| StacksEpochId::Epoch31
853853
| StacksEpochId::Epoch32 => COSTS_3_NAME.to_string(),
854-
StacksEpochId::Epoch33 => COSTS_4_NAME.to_string(),
854+
StacksEpochId::Epoch33 | StacksEpochId::Epoch34 => COSTS_4_NAME.to_string(),
855855
};
856856
Ok(result)
857857
}

0 commit comments

Comments
 (0)