Skip to content

Commit

Permalink
Merge pull request #527 from hirosystems/chore/bump-versions
Browse files Browse the repository at this point in the history
chore: bump sdk + type versions + publish
  • Loading branch information
vabanaerytk authored Apr 5, 2024
2 parents 4cfa300 + 278df2a commit 0933322
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/chainhook-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ redis = "0.21.5"
serde-redis = "0.12.0"
hex = "0.4.3"
rand = "0.8.5"
chainhook-sdk = { version = "0.12.1", default-features = false, features = [
chainhook-sdk = { version = "0.12.6", default-features = false, features = [
"zeromq",
], path = "../chainhook-sdk" }
hiro-system-kit = "0.3.4"
Expand Down
2 changes: 2 additions & 0 deletions components/chainhook-cli/src/scan/stacks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ pub async fn consolidate_local_stacks_chainstate_using_csv(
"Building local chainstate from Stacks archive file"
);


let downloaded_new_dataset = download_stacks_dataset_if_required(config, ctx).await?;

if downloaded_new_dataset {
Expand Down Expand Up @@ -557,6 +558,7 @@ pub async fn consolidate_local_stacks_chainstate_using_csv(
) {
Ok(block) => block,
Err(e) => {

error!(
&ctx.expect_logger(),
"Failed to standardize stacks block: {e}"
Expand Down
24 changes: 24 additions & 0 deletions components/chainhook-cli/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,30 @@ impl Service {
}
};

let ctx = self.ctx.clone();
let stacks_db =
open_readonly_stacks_db_conn_with_retry(&config.expected_cache_path(), 3, &ctx)?;
let unconfirmed_blocks = match get_all_unconfirmed_blocks(&stacks_db, &ctx) {
Ok(blocks) => {
let confirmed_tip = get_last_block_height_inserted(&stacks_db, &ctx).unwrap_or(0);
// any unconfirmed blocks that are earlier than confirmed blocks are invalid
Some(
blocks
.iter()
.filter(|&b| b.block_identifier.index > confirmed_tip)
.cloned()
.collect(),
)
}
Err(e) => {
info!(
self.ctx.expect_logger(),
"Failed to get stacks blocks from db to seed block pool: {}", e
);
None
}
};

let observer_event_tx_moved = observer_event_tx.clone();
let moved_observer_command_tx = observer_command_tx.clone();
let _ = start_event_observer(
Expand Down
4 changes: 2 additions & 2 deletions components/chainhook-sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chainhook-sdk"
version = "0.12.5"
version = "0.12.7"
description = "Stateless Transaction Indexing Engine for Stacks and Bitcoin"
license = "GPL-3.0"
edition = "2021"
Expand All @@ -15,7 +15,7 @@ serde_derive = "1"
stacks-codec = { git = "https://github.com/hirosystems/clarinet.git" }
# hiro-system-kit = { version = "0.1.0", path = "../../../clarinet/components/hiro-system-kit" }
hiro-system-kit = { version = "0.3.4", optional = true }
chainhook-types = { version = "1.3.3", path = "../chainhook-types-rs" }
chainhook-types = { version = "1.3.6", path = "../chainhook-types-rs" }
rocket = { version = "=0.5.0-rc.3", features = ["json"] }
bitcoincore-rpc = "0.18.0"
bitcoincore-rpc-json = "0.18.0"
Expand Down
1 change: 1 addition & 0 deletions components/chainhook-sdk/src/observer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ pub fn start_event_observer(
let context_cloned = ctx.clone();
let event_observer_config_moved = config.clone();
let observer_commands_tx_moved = observer_commands_tx.clone();

let _ = hiro_system_kit::thread_named("Chainhook event observer")
.spawn(move || {
let future = start_stacks_event_observer(
Expand Down
2 changes: 1 addition & 1 deletion components/chainhook-types-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "chainhook-types"
description = "Bitcoin and Stacks data schemas, based on the Rosetta specification"
license = "MIT"
version = "1.3.3"
version = "1.3.6"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down

0 comments on commit 0933322

Please sign in to comment.