Skip to content

Commit dec06d7

Browse files
authored
Merge branch 'develop' into fix/tenure-extend-no-sortition
2 parents 693b5da + babcc9a commit dec06d7

File tree

16 files changed

+64
-83
lines changed

16 files changed

+64
-83
lines changed

CHANGELOG.md

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

88
## [Unreleased]
99

10+
### Changed
11+
- Add index for StacksBlockId to nakamoto block headers table (improves node performance)
12+
1013
## [3.0.0.0.0]
1114

1215
### Added

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ rand = "0.8"
2121
rand_chacha = "0.3.1"
2222
tikv-jemallocator = "0.5.4"
2323
rusqlite = { version = "0.31.0", features = ["blob", "serde_json", "i128_blob", "bundled", "trace"] }
24+
thiserror = { version = "1.0.65" }
2425

2526
# Use a bit more than default optimization for
2627
# dev builds to speed up test execution

libsigner/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ slog-term = "2.6.0"
3030
slog-json = { version = "2.3.0", optional = true }
3131
stacks-common = { path = "../stacks-common" }
3232
stackslib = { path = "../stackslib"}
33-
thiserror = "1.0"
33+
thiserror = { workspace = true }
3434
tiny_http = "0.12"
3535

3636
[dev-dependencies]

stacks-common/src/util/log.rs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,13 @@ fn make_json_logger() -> Logger {
215215
panic!("Tried to construct JSON logger, but stacks-blockchain built without slog_json feature enabled.")
216216
}
217217

218-
#[cfg(not(any(test, feature = "testing")))]
219218
fn make_logger() -> Logger {
220219
if env::var("STACKS_LOG_JSON") == Ok("1".into()) {
221220
make_json_logger()
222221
} else {
223222
let debug = env::var("STACKS_LOG_DEBUG") == Ok("1".into());
224223
let pretty_print = env::var("STACKS_LOG_PP") == Ok("1".into());
225-
let decorator = slog_term::PlainSyncDecorator::new(std::io::stderr());
224+
let decorator = get_decorator();
226225
let atty = isatty(Stream::Stderr);
227226
let drain = TermFormat::new(decorator, pretty_print, debug, atty);
228227
let logger = Logger::root(drain.ignore_res(), o!());
@@ -231,17 +230,13 @@ fn make_logger() -> Logger {
231230
}
232231

233232
#[cfg(any(test, feature = "testing"))]
234-
fn make_logger() -> Logger {
235-
if env::var("STACKS_LOG_JSON") == Ok("1".into()) {
236-
make_json_logger()
237-
} else {
238-
let debug = env::var("STACKS_LOG_DEBUG") == Ok("1".into());
239-
let plain = slog_term::PlainSyncDecorator::new(slog_term::TestStdoutWriter);
240-
let isatty = isatty(Stream::Stdout);
241-
let drain = TermFormat::new(plain, false, debug, isatty);
242-
let logger = Logger::root(drain.ignore_res(), o!());
243-
logger
244-
}
233+
fn get_decorator() -> slog_term::PlainSyncDecorator<slog_term::TestStdoutWriter> {
234+
slog_term::PlainSyncDecorator::new(slog_term::TestStdoutWriter)
235+
}
236+
237+
#[cfg(not(any(test, feature = "testing")))]
238+
fn get_decorator() -> slog_term::PlainSyncDecorator<std::io::Stderr> {
239+
slog_term::PlainSyncDecorator::new(std::io::stderr())
245240
}
246241

247242
fn inner_get_loglevel() -> slog::Level {

stacks-signer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ slog-json = { version = "2.3.0", optional = true }
3838
slog-term = "2.6.0"
3939
stacks-common = { path = "../stacks-common" }
4040
stackslib = { path = "../stackslib" }
41-
thiserror = "1.0"
41+
thiserror = { workspace = true }
4242
tiny_http = { version = "0.12", optional = true }
4343
toml = "0.5.6"
4444
tracing = "0.1.37"

stacks-signer/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ Metrics endpoint: {metrics_endpoint}
335335

336336
/// Get the chain ID for the network
337337
pub fn to_chain_id(&self) -> u32 {
338-
self.chain_id.unwrap_or_else(|| match self.network {
338+
self.chain_id.unwrap_or(match self.network {
339339
Network::Mainnet => CHAIN_ID_MAINNET,
340340
Network::Testnet | Network::Mocknet => CHAIN_ID_TESTNET,
341341
})

stacks-signer/src/main.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,7 @@ fn handle_generate_stacking_signature(
157157

158158
fn handle_check_config(args: RunSignerArgs) {
159159
let config = GlobalConfig::try_from(&args.config).unwrap();
160-
println!(
161-
"Signer version: {}\nConfig: \n{}",
162-
VERSION_STRING.to_string(),
163-
config
164-
);
160+
println!("Signer version: {}\nConfig: \n{}", *VERSION_STRING, config);
165161
}
166162

167163
fn handle_generate_vote(args: GenerateVoteArgs, do_print: bool) -> MessageSignature {

stacks-signer/src/monitoring/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ pub fn update_signer_nonce(nonce: u64) {
9797
#[allow(dead_code)]
9898
/// Remove the origin from the full path to avoid duplicate metrics for different origins
9999
fn remove_origin_from_path(full_path: &str, origin: &str) -> String {
100-
let path = full_path.replace(origin, "");
101-
path
100+
full_path.replace(origin, "")
102101
}
103102

104103
/// Start a new RPC call timer.

stacks-signer/src/v0/signer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl SignerTrait<SignerMessage> for Signer {
191191
"block_height" => b.header.chain_length,
192192
"signer_sighash" => %b.header.signer_signature_hash(),
193193
);
194-
stacks_client.post_block_until_ok(self, &b);
194+
stacks_client.post_block_until_ok(self, b);
195195
}
196196
SignerMessage::MockProposal(mock_proposal) => {
197197
let epoch = match stacks_client.get_node_epoch() {

0 commit comments

Comments
 (0)