Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: cache the SPV instance to improve the performance of the JSON-RPC APIs #25

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

yangby-cryptape
Copy link
Contributor

No description provided.

@yangby-cryptape yangby-cryptape force-pushed the refactor/cache-spv-cells branch from 03f3e27 to 309b2c1 Compare April 11, 2024 08:48
@yangby-cryptape yangby-cryptape marked this pull request as ready for review April 11, 2024 08:56
@yangby-cryptape yangby-cryptape merged commit 0ab417f into master Apr 18, 2024
5 checks passed
@yangby-cryptape yangby-cryptape deleted the refactor/cache-spv-cells branch April 18, 2024 15:29

log::debug!(">>> try the cached SPV instance at first");

let spv_instance = if let Some(spv_instance) = self.load_spv_instance() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

if spv_best_height(from cache) < target_height + confirmations, the service rpc get_tx_proof will keep returning errors until the cache expires.

In other words, if the current cache doesn't hit, the api doesn't go through ckb_cli to get the latest spv client instance, but just waits for the cache to expire.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants