Skip to content

Commit 0f7c000

Browse files
authored
Merge branch 'develop' into feat/cargo_check_workflow
2 parents 868ba77 + 92bd39e commit 0f7c000

Some content is hidden

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

46 files changed

+3580
-1178
lines changed

CHANGELOG.md

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

88
## [Unreleased]
99

10+
### Added
11+
- Persisted tracking of StackerDB slot versions for mining. This improves miner p2p performance.
12+
13+
## [3.1.0.0.9]
14+
1015
### Added
1116

1217
- Added field `vm_error` to EventObserver transaction outputs
1318
- Added new `ValidateRejectCode` values to the `/v3/block_proposal` endpoint
1419
- Added `StateMachineUpdateContent::V1` to support a vector of `StacksTransaction` expected to be replayed in subsequent Stacks blocks
1520
- Include a reason string in the transaction receipt when a transaction is rolled back due to a post-condition. This should help users in understanding what went wrong.
21+
- Updated `StackerDBListener` to monitor signer state machine updates and store signer global state information, enabling miners to perform transaction replays.
22+
- Added a testnet `replay_transactions` flag to the miner configuration to feature-gate transaction replay. When enabled, the miner will construct a replay block if a threshold of signers signals that a transaction set requires replay.
1623

1724
### Changed
1825

clarity/src/vm/analysis/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,16 @@ use self::trait_checker::TraitChecker;
3434
use self::type_checker::v2_05::TypeChecker as TypeChecker2_05;
3535
use self::type_checker::v2_1::TypeChecker as TypeChecker2_1;
3636
pub use self::types::{AnalysisPass, ContractAnalysis};
37+
#[cfg(feature = "rusqlite")]
3738
use crate::vm::ast::{build_ast_with_rules, ASTRules};
3839
use crate::vm::costs::LimitedCostTracker;
3940
#[cfg(feature = "rusqlite")]
4041
use crate::vm::database::MemoryBackingStore;
4142
use crate::vm::database::STORE_CONTRACT_SRC_INTERFACE;
4243
use crate::vm::representations::SymbolicExpression;
43-
use crate::vm::types::{QualifiedContractIdentifier, TypeSignature};
44+
use crate::vm::types::QualifiedContractIdentifier;
45+
#[cfg(feature = "rusqlite")]
46+
use crate::vm::types::TypeSignature;
4447
use crate::vm::ClarityVersion;
4548

4649
/// Used by CLI tools like the docs generator. Not used in production

clarity/src/vm/docs/contracts.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@ use hashbrown::{HashMap, HashSet};
44
use stacks_common::consts::CHAIN_ID_TESTNET;
55
use stacks_common::types::StacksEpochId;
66

7-
#[cfg(feature = "rusqlite")]
8-
use crate::vm::analysis::mem_type_check;
9-
use crate::vm::analysis::ContractAnalysis;
7+
use crate::vm::analysis::{mem_type_check, ContractAnalysis};
108
use crate::vm::ast::{build_ast_with_rules, ASTRules};
119
use crate::vm::contexts::GlobalContext;
1210
use crate::vm::costs::LimitedCostTracker;
13-
#[cfg(feature = "rusqlite")]
1411
use crate::vm::database::MemoryBackingStore;
1512
use crate::vm::docs::{get_input_type_string, get_output_type_string, get_signature};
1613
use crate::vm::types::{FunctionType, QualifiedContractIdentifier, Value};
@@ -63,7 +60,6 @@ fn make_func_ref(func_name: &str, func_type: &FunctionType, description: &str) -
6360
}
6461
}
6562

66-
#[cfg(feature = "rusqlite")]
6763
#[allow(clippy::expect_used)]
6864
fn get_constant_value(var_name: &str, contract_content: &str) -> Value {
6965
let to_eval = format!("{}\n{}", contract_content, var_name);
@@ -72,7 +68,6 @@ fn get_constant_value(var_name: &str, contract_content: &str) -> Value {
7268
.expect("BUG: failed to return constant value")
7369
}
7470

75-
#[cfg(feature = "rusqlite")]
7671
fn doc_execute(program: &str) -> Result<Option<Value>, vm::Error> {
7772
let contract_id = QualifiedContractIdentifier::transient();
7873
let mut contract_context = ContractContext::new(contract_id.clone(), ClarityVersion::Clarity2);
@@ -99,7 +94,6 @@ fn doc_execute(program: &str) -> Result<Option<Value>, vm::Error> {
9994
})
10095
}
10196

102-
#[cfg(feature = "rusqlite")]
10397
#[allow(clippy::expect_used)]
10498
pub fn make_docs(
10599
content: &str,
@@ -185,7 +179,6 @@ pub fn make_docs(
185179

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

clarity/src/vm/docs/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ use crate::vm::types::{FixedFunction, FunctionType};
2323
use crate::vm::variables::NativeVariables;
2424
use crate::vm::ClarityVersion;
2525

26+
#[cfg(feature = "rusqlite")]
2627
pub mod contracts;
2728

2829
#[derive(Serialize)]

libsigner/src/events.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ pub enum SignerEvent<T: SignerEventTrait> {
214214
consensus_hash: ConsensusHash,
215215
/// the time at which this event was received by the signer's event processor
216216
received_time: SystemTime,
217+
/// the parent burn block hash for the newly processed burn block
218+
parent_burn_block_hash: BurnchainHeaderHash,
217219
},
218220
/// A new processed Stacks block was received from the node with the given block hash
219221
NewBlock {
@@ -585,6 +587,8 @@ struct BurnBlockEvent {
585587
burn_amount: u64,
586588
#[serde(with = "prefix_hex")]
587589
consensus_hash: ConsensusHash,
590+
#[serde(with = "prefix_hex")]
591+
parent_burn_block_hash: BurnchainHeaderHash,
588592
}
589593

590594
impl<T: SignerEventTrait> TryFrom<BurnBlockEvent> for SignerEvent<T> {
@@ -596,6 +600,7 @@ impl<T: SignerEventTrait> TryFrom<BurnBlockEvent> for SignerEvent<T> {
596600
received_time: SystemTime::now(),
597601
burn_header_hash: burn_block_event.burn_block_hash,
598602
consensus_hash: burn_block_event.consensus_hash,
603+
parent_burn_block_hash: burn_block_event.parent_burn_block_hash,
599604
})
600605
}
601606
}

libsigner/src/tests/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (C) 2013-2020 Blockstack PBC, a public benefit corporation
2-
// Copyright (C) 2020-2023 Stacks Open Internet Foundation
2+
// Copyright (C) 2020-2025 Stacks Open Internet Foundation
33
//
44
// This program is free software: you can redistribute it and/or modify
55
// it under the terms of the GNU General Public License as published by
@@ -15,6 +15,7 @@
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

1717
mod http;
18+
mod signer_state;
1819

1920
use std::fmt::Debug;
2021
use std::io::{Read, Write};

0 commit comments

Comments
 (0)