Skip to content

Commit 1f94451

Browse files
committed
Merge branch develop into chore/clippy-collection-is-never-read and fix conflicts
2 parents 9f1c431 + a46254d commit 1f94451

File tree

297 files changed

+5400
-5570
lines changed

Some content is hidden

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

297 files changed

+5400
-5570
lines changed

.cargo/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +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 libstackerdb -p stacks-signer -p pox-locking -p clarity -p libsigner -p stacks-common --no-deps --tests --all-features -- -D warnings"
45

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

.github/workflows/bitcoin-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ jobs:
167167
- tests::nakamoto_integrations::sip029_coinbase_change
168168
- tests::nakamoto_integrations::clarity_cost_spend_down
169169
- tests::nakamoto_integrations::v3_blockbyheight_api_endpoint
170+
- tests::nakamoto_integrations::mine_invalid_principal_from_consensus_buff
170171
- tests::nakamoto_integrations::test_tenure_extend_from_flashblocks
171172
# TODO: enable these once v1 signer is supported by a new nakamoto epoch
172173
# - tests::signer::v1::dkg

.github/workflows/clippy.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,4 @@ jobs:
3434
components: clippy
3535
- name: Clippy
3636
id: clippy
37-
uses: actions-rs/clippy-check@v1
38-
with:
39-
token: ${{ secrets.GITHUB_TOKEN }}
40-
args: -p libstackerdb -p stacks-signer -p pox-locking -p clarity -p libsigner -p stacks-common --no-deps --tests --all-features -- -D warnings
37+
run: cargo clippy-stacks

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ 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-
## [Unreleased]
8+
## [3.1.0.0.4]
99

1010
### Added
1111

1212
- The stacks-node miner now performs accurate tenure-extensions in certain bitcoin block production
1313
cases: when a bitcoin block is produced before the previous bitcoin block's Stacks tenure started.
1414
Previously, the miner had difficulty restarting their missed tenure and extending into the new
1515
bitcoin block, leading to 1-2 bitcoin blocks of missed Stacks block production.
16+
- The event dispatcher now includes `consensus_hash` in the `/new_block` and `/new_burn_block` payloads. ([#5677](https://github.com/stacks-network/stacks-core/pull/5677))
1617

1718
## Changed
1819

CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,18 @@ You can automatically reformat your commit via:
387387
cargo fmt-stacks
388388
```
389389

390+
## Clippy Warnings
391+
392+
PRs will be checked against `clippy` and will _fail_ if any clippy warnings are generated.
393+
Unfortunately, not all existing clippy warnings have been addressed throughout stacks-core, so arguments must be passed via the command line.
394+
Therefore, we handle `clippy` configurations using a Cargo alias: `cargo clippy-stacks`
395+
396+
You can check what warnings need to be addressed locally via:
397+
398+
```bash
399+
cargo clippy-stacks
400+
```
401+
390402
## Comments
391403

392404
Comments are very important for the readability and correctness of the codebase. The purpose of comments is:

clarity/src/libclarity.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,19 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17-
#![allow(unused_imports)]
1817
#![allow(dead_code)]
1918
#![allow(non_camel_case_types)]
2019
#![allow(non_snake_case)]
2120
#![allow(non_upper_case_globals)]
2221
#![cfg_attr(test, allow(unused_variables, unused_assignments))]
2322

23+
#[allow(unused_imports)]
2424
#[macro_use(o, slog_log, slog_trace, slog_debug, slog_info, slog_warn, slog_error)]
2525
extern crate slog;
2626

2727
#[macro_use]
2828
extern crate serde_derive;
2929

30-
#[macro_use]
3130
extern crate serde_json;
3231

3332
#[cfg(any(test, feature = "testing"))]
@@ -61,7 +60,8 @@ pub mod boot_util {
6160
pub fn boot_code_id(name: &str, mainnet: bool) -> QualifiedContractIdentifier {
6261
let addr = boot_code_addr(mainnet);
6362
QualifiedContractIdentifier::new(
64-
addr.into(),
63+
addr.try_into()
64+
.expect("FATAL: boot contract addr is not a legal principal"),
6565
ContractName::try_from(name.to_string())
6666
.expect("FATAL: boot contract name is not a legal ContractName"),
6767
)

clarity/src/vm/analysis/analysis_db.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ use std::collections::{BTreeMap, BTreeSet};
1818

1919
use stacks_common::types::StacksEpochId;
2020

21-
use crate::vm::analysis::errors::{CheckError, CheckErrors, CheckResult};
21+
use crate::vm::analysis::errors::{CheckErrors, CheckResult};
2222
use crate::vm::analysis::type_checker::ContractAnalysis;
2323
use crate::vm::database::{
2424
ClarityBackingStore, ClarityDeserializable, ClaritySerializable, RollbackWrapper,
2525
};
2626
use crate::vm::representations::ClarityName;
2727
use crate::vm::types::signatures::FunctionSignature;
28-
use crate::vm::types::{FunctionType, QualifiedContractIdentifier, TraitIdentifier, TypeSignature};
28+
use crate::vm::types::{FunctionType, QualifiedContractIdentifier, TraitIdentifier};
2929
use crate::vm::ClarityVersion;
3030

3131
pub struct AnalysisDatabase<'a> {

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,16 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17-
use hashbrown::HashMap;
18-
1917
pub use super::errors::{
2018
check_argument_count, check_arguments_at_least, CheckError, CheckErrors, CheckResult,
2119
};
22-
use super::AnalysisDatabase;
23-
use crate::vm::analysis::types::{AnalysisPass, ContractAnalysis};
20+
use crate::vm::analysis::types::ContractAnalysis;
2421
use crate::vm::functions::define::{DefineFunctions, DefineFunctionsParsed};
25-
use crate::vm::functions::{tuples, NativeFunctions};
22+
use crate::vm::functions::NativeFunctions;
2623
use crate::vm::representations::SymbolicExpressionType::{
2724
Atom, AtomValue, Field, List, LiteralValue, TraitReference,
2825
};
29-
use crate::vm::representations::{ClarityName, SymbolicExpression, SymbolicExpressionType};
30-
use crate::vm::types::{
31-
parse_name_type_pairs, PrincipalData, TupleTypeSignature, TypeSignature, Value,
32-
};
26+
use crate::vm::representations::{ClarityName, SymbolicExpression};
3327
use crate::vm::variables::NativeVariables;
3428
use crate::vm::ClarityVersion;
3529

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,12 @@ pub use super::errors::{
2323
use super::AnalysisDatabase;
2424
use crate::vm::analysis::types::{AnalysisPass, ContractAnalysis};
2525
use crate::vm::functions::define::DefineFunctionsParsed;
26-
use crate::vm::functions::{tuples, NativeFunctions};
26+
use crate::vm::functions::NativeFunctions;
2727
use crate::vm::representations::SymbolicExpressionType::{
2828
Atom, AtomValue, Field, List, LiteralValue, TraitReference,
2929
};
3030
use crate::vm::representations::{ClarityName, SymbolicExpression, SymbolicExpressionType};
31-
use crate::vm::types::{
32-
parse_name_type_pairs, PrincipalData, TupleTypeSignature, TypeSignature, Value,
33-
};
34-
use crate::vm::variables::NativeVariables;
31+
use crate::vm::types::{PrincipalData, Value};
3532
use crate::vm::ClarityVersion;
3633

3734
#[cfg(test)]

clarity/src/vm/analysis/read_only_checker/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use rstest_reuse::{self, *};
2121
use stacks_common::types::StacksEpochId;
2222

2323
use crate::vm::analysis::type_checker::v2_1::tests::mem_type_check;
24-
use crate::vm::analysis::{type_check, CheckError, CheckErrors};
24+
use crate::vm::analysis::{type_check, CheckErrors};
2525
use crate::vm::ast::parse;
2626
use crate::vm::database::MemoryBackingStore;
2727
use crate::vm::tests::test_clarity_versions;

0 commit comments

Comments
 (0)