Skip to content

Commit 54de9ab

Browse files
authored
Merge branch 'develop' into feat/rbf-when-config-changed
2 parents b2fe441 + e21c0dd commit 54de9ab

File tree

22 files changed

+622
-432
lines changed

22 files changed

+622
-432
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
1717

1818
- When a miner times out waiting for signatures, it will re-propose the same block instead of building a new block ([#5877](https://github.com/stacks-network/stacks-core/pull/5877))
1919
- Improve tenure downloader trace verbosity applying proper logging level depending on the tenure state ("debug" if unconfirmed, "info" otherwise) ([#5871](https://github.com/stacks-network/stacks-core/issues/5871))
20+
- Remove warning log about missing UTXOs when a node is configured as `miner` with `mock_mining` mode enabled ([#5841](https://github.com/stacks-network/stacks-core/issues/5841))
2021

2122
## [3.1.0.0.7]
2223

clarity/Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ regex = "1"
2727
lazy_static = "1.4.0"
2828
integer-sqrt = "0.1.3"
2929
slog = { version = "2.5.2", features = [ "max_level_trace" ] }
30-
stacks_common = { package = "stacks-common", path = "../stacks-common", optional = true, default-features = false }
30+
stacks_common = { package = "stacks-common", path = "../stacks-common", default-features = false }
3131
rstest = "0.17.0"
3232
rstest_reuse = "0.5.0"
3333
hashbrown = { workspace = true }
34-
rusqlite = { workspace = true, optional = true}
34+
rusqlite = { workspace = true, optional = true }
3535

3636
[dependencies.serde_json]
3737
version = "1.0"
@@ -49,11 +49,11 @@ mutants = "0.0.3"
4949
# criterion = "0.3"
5050

5151
[features]
52-
default = ["canonical"]
53-
canonical = ["rusqlite", "stacks_common/canonical"]
52+
default = ["rusqlite"]
5453
developer-mode = ["stacks_common/developer-mode"]
5554
slog_json = ["stacks_common/slog_json"]
56-
testing = ["canonical"]
55+
rusqlite = ["stacks_common/rusqlite", "dep:rusqlite"]
56+
testing = []
5757
devtools = []
5858
rollback_value_check = []
5959
disable-costs = []

clarity/src/vm/analysis/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ use self::type_checker::v2_1::TypeChecker as TypeChecker2_1;
3636
pub use self::types::{AnalysisPass, ContractAnalysis};
3737
use crate::vm::ast::{build_ast_with_rules, ASTRules};
3838
use crate::vm::costs::LimitedCostTracker;
39-
#[cfg(feature = "canonical")]
39+
#[cfg(feature = "rusqlite")]
4040
use crate::vm::database::MemoryBackingStore;
4141
use crate::vm::database::STORE_CONTRACT_SRC_INTERFACE;
4242
use crate::vm::representations::SymbolicExpression;
4343
use crate::vm::types::{QualifiedContractIdentifier, TypeSignature};
4444
use crate::vm::ClarityVersion;
4545

4646
/// Used by CLI tools like the docs generator. Not used in production
47-
#[cfg(feature = "canonical")]
47+
#[cfg(feature = "rusqlite")]
4848
pub fn mem_type_check(
4949
snippet: &str,
5050
version: ClarityVersion,

clarity/src/vm/database/clarity_store.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@
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-
#[cfg(feature = "canonical")]
17+
#[cfg(feature = "rusqlite")]
1818
use rusqlite::Connection;
1919
use stacks_common::types::chainstate::{StacksBlockId, TrieHash};
2020
use stacks_common::util::hash::{hex_bytes, to_hex, Sha512Trunc256Sum};
2121

2222
use crate::vm::analysis::AnalysisDatabase;
2323
use crate::vm::contexts::GlobalContext;
24-
#[cfg(feature = "canonical")]
2524
use crate::vm::database::{
2625
ClarityDatabase, ClarityDeserializable, ClaritySerializable, NULL_BURN_STATE_DB, NULL_HEADER_DB,
2726
};
@@ -85,7 +84,7 @@ pub trait ClarityBackingStore {
8584
fn get_open_chain_tip_height(&mut self) -> u32;
8685
fn get_open_chain_tip(&mut self) -> StacksBlockId;
8786

88-
#[cfg(feature = "canonical")]
87+
#[cfg(feature = "rusqlite")]
8988
fn get_side_store(&mut self) -> &Connection;
9089

9190
fn get_cc_special_cases_handler(&self) -> Option<SpecialCaseHandler> {
@@ -222,7 +221,7 @@ impl ClarityBackingStore for NullBackingStore {
222221
panic!("NullBackingStore can't retrieve data")
223222
}
224223

225-
#[cfg(feature = "canonical")]
224+
#[cfg(feature = "rusqlite")]
226225
fn get_side_store(&mut self) -> &Connection {
227226
panic!("NullBackingStore has no side store")
228227
}

clarity/src/vm/database/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//
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/>.
16-
#[cfg(feature = "canonical")]
16+
#[cfg(feature = "rusqlite")]
1717
pub use sqlite::MemoryBackingStore;
1818

1919
pub use self::clarity_db::{
@@ -22,7 +22,7 @@ pub use self::clarity_db::{
2222
};
2323
pub use self::clarity_store::{ClarityBackingStore, SpecialCaseHandler};
2424
pub use self::key_value_wrapper::{RollbackWrapper, RollbackWrapperPersistedLog};
25-
#[cfg(feature = "canonical")]
25+
#[cfg(feature = "rusqlite")]
2626
pub use self::sqlite::SqliteConnection;
2727
pub use self::structures::{
2828
ClarityDeserializable, ClaritySerializable, DataMapMetadata, DataVariableMetadata,
@@ -32,6 +32,6 @@ pub use self::structures::{
3232
pub mod clarity_db;
3333
pub mod clarity_store;
3434
mod key_value_wrapper;
35-
#[cfg(feature = "canonical")]
35+
#[cfg(feature = "rusqlite")]
3636
pub mod sqlite;
3737
mod structures;

clarity/src/vm/docs/contracts.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ use hashbrown::{HashMap, HashSet};
44
use stacks_common::consts::CHAIN_ID_TESTNET;
55
use stacks_common::types::StacksEpochId;
66

7-
#[cfg(feature = "canonical")]
7+
#[cfg(feature = "rusqlite")]
88
use crate::vm::analysis::mem_type_check;
99
use crate::vm::analysis::ContractAnalysis;
1010
use crate::vm::ast::{build_ast_with_rules, ASTRules};
1111
use crate::vm::contexts::GlobalContext;
1212
use crate::vm::costs::LimitedCostTracker;
13-
#[cfg(feature = "canonical")]
13+
#[cfg(feature = "rusqlite")]
1414
use crate::vm::database::MemoryBackingStore;
1515
use crate::vm::docs::{get_input_type_string, get_output_type_string, get_signature};
1616
use crate::vm::types::{FunctionType, QualifiedContractIdentifier, Value};
@@ -63,7 +63,7 @@ fn make_func_ref(func_name: &str, func_type: &FunctionType, description: &str) -
6363
}
6464
}
6565

66-
#[cfg(feature = "canonical")]
66+
#[cfg(feature = "rusqlite")]
6767
#[allow(clippy::expect_used)]
6868
fn get_constant_value(var_name: &str, contract_content: &str) -> Value {
6969
let to_eval = format!("{}\n{}", contract_content, var_name);
@@ -72,7 +72,7 @@ fn get_constant_value(var_name: &str, contract_content: &str) -> Value {
7272
.expect("BUG: failed to return constant value")
7373
}
7474

75-
#[cfg(feature = "canonical")]
75+
#[cfg(feature = "rusqlite")]
7676
fn doc_execute(program: &str) -> Result<Option<Value>, vm::Error> {
7777
let contract_id = QualifiedContractIdentifier::transient();
7878
let mut contract_context = ContractContext::new(contract_id.clone(), ClarityVersion::Clarity2);
@@ -99,7 +99,7 @@ fn doc_execute(program: &str) -> Result<Option<Value>, vm::Error> {
9999
})
100100
}
101101

102-
#[cfg(feature = "canonical")]
102+
#[cfg(feature = "rusqlite")]
103103
#[allow(clippy::expect_used)]
104104
pub fn make_docs(
105105
content: &str,
@@ -185,7 +185,7 @@ pub fn make_docs(
185185

186186
/// Produce a set of documents for multiple contracts, supplied as a list of `(contract_name, contract_content)` pairs,
187187
/// and a map from `contract_name` to corresponding `ContractSupportDocs`
188-
#[cfg(feature = "canonical")]
188+
#[cfg(feature = "rusqlite")]
189189
pub fn produce_docs_refs<A: AsRef<str>, B: AsRef<str>>(
190190
contracts: &[(A, B)],
191191
support_docs: &HashMap<&str, ContractSupportDocs>,

clarity/src/vm/docs/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,6 @@ Note: Corner cases are handled with the following rules:
499499
* if both `i1` and `i2` are `0`, return `1`
500500
* if `i1` is `1`, return `1`
501501
* if `i1` is `0`, return `0`
502-
* if `i2` is `1`, return `i1`
503502
* if `i2` is negative or greater than `u32::MAX`, throw a runtime error",
504503
example: "(pow 2 3) ;; Returns 8
505504
(pow 2 2) ;; Returns 4

clarity/src/vm/errors.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
use std::{error, fmt};
1818

19-
#[cfg(feature = "canonical")]
19+
#[cfg(feature = "rusqlite")]
2020
use rusqlite::Error as SqliteError;
2121
use serde_json::Error as SerdeJSONErr;
2222
use stacks_common::types::chainstate::BlockHeaderHash;
@@ -57,7 +57,7 @@ pub enum InterpreterError {
5757
UninitializedPersistedVariable,
5858
FailedToConstructAssetTable,
5959
FailedToConstructEventBatch,
60-
#[cfg(feature = "canonical")]
60+
#[cfg(feature = "rusqlite")]
6161
SqliteError(IncomparableError<SqliteError>),
6262
BadFileName,
6363
FailedToCreateDataDirectory,
@@ -241,7 +241,7 @@ mod test {
241241
fn error_formats() {
242242
let t = "(/ 10 0)";
243243
let expected = "DivisionByZero
244-
Stack Trace:
244+
Stack Trace:
245245
_native_:native_div
246246
";
247247

clarity/src/vm/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub mod coverage;
4242

4343
pub mod events;
4444

45-
#[cfg(feature = "canonical")]
45+
#[cfg(feature = "rusqlite")]
4646
pub mod tooling;
4747

4848
#[cfg(any(test, feature = "testing"))]

0 commit comments

Comments
 (0)