Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

add: redis notifier logic#568

Open
ASuciuX wants to merge 5 commits intodevelopfrom
feat/redis-notifier
Open

add: redis notifier logic#568
ASuciuX wants to merge 5 commits intodevelopfrom
feat/redis-notifier

Conversation

@ASuciuX
Copy link
Copy Markdown
Contributor

@ASuciuX ASuciuX commented Aug 25, 2025

@ASuciuX ASuciuX requested a review from rafaelcr August 25, 2025 12:58
@codecov
Copy link
Copy Markdown

codecov bot commented Aug 25, 2025

Codecov Report

❌ Patch coverage is 30.89888% with 123 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
components/bitcoind/src/utils/redis_notifier.rs 39.41% 83 Missing ⚠️
components/config/src/toml.rs 0.00% 15 Missing ⚠️
components/ordinals/src/lib.rs 0.00% 12 Missing ⚠️
components/runes/src/lib.rs 0.00% 12 Missing ⚠️
components/runes/src/db/index.rs 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 25, 2025

Vercel deployment URL: https://bitcoin-indexer-4t9up77dy-hirosystems.vercel.app 🚀

Copy link
Copy Markdown
Collaborator

@rafaelcr rafaelcr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Left a few comments

Comment on lines +37 to +38
let client = Client::open(redis.url.as_str())
.map_err(|e| format!("unable to connect to redis: {e}"))?;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this client handle reconnections? Also, we need to add support for High Availability Redis (Sentinels or Cluster) in these connection options

Comment on lines +49 to +50
bitcoin::Network::Signet => "signet",
bitcoin::Network::Regtest => "regtest",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These will not be supported for now, can you add a todo!() here instead?

apply_blocks: apply_blocks
.iter()
.map(|b| BlockIndexRef {
hash: b.hash.clone(),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to make sure these block hashes start with 0x, can you double check if this is the case?

Comment on lines +84 to +86
pub enabled: bool,
pub url: String,
pub queue: String,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here about HA Redis

}
// Notify redis with both apply and rollback blocks, if enabled
if let Some(redis_cfg) = &config_moved.redis {
let notifier = RedisNotifier::new(redis_cfg)?;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should create the notifier only once and reuse it across all block indexing

}
// Notify redis with both apply and rollback blocks, if enabled
if let Some(redis_cfg) = &config_moved.redis {
let notifier = RedisNotifier::new(redis_cfg)?;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants