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

The spv instance cache not invalidate properly #38

Closed
EthanYuan opened this issue May 21, 2024 · 0 comments · Fixed by #37
Closed

The spv instance cache not invalidate properly #38

EthanYuan opened this issue May 21, 2024 · 0 comments · Fixed by #37

Comments

@EthanYuan
Copy link
Collaborator

The intent of the spv instance cache is to improve the performance of the JSON-RPC API getTxProof, so that each time it is called by the user, if the spv instance in the cache can be satisfied, there is no need to query the network for the current spv instance (a time-consuming operation).

It was introduced from the following pr

But the spv instance cache is not properly invalidated. This pr was accidentally merged but not deployed. The expiration of the cache is completely dependent on a hard-coded expiration time(10 minutes). In other words, if the current cache is not hit, instead of getting the latest spv client instance via ckb_cli, the API will just return a failure each time until the cache expires.


A simple idea for a fix would be to get the latest spv instance over the network and update the cache as soon as a suitable spv client does not exist in the cache.

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 a pull request may close this issue.

1 participant