-
Notifications
You must be signed in to change notification settings - Fork 699
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
sc-client: expose pinning API #1219
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks!
With regards to the safe abstraction, I would strongly consider to also provide it alongside and recommend its usage or something similar - otherwise people will have to implement it themselves or more likely - they don't use safe abstraction. Personally I would even prefer to only expose a safe API. EDIT: What happens if a blocks are never unpined? |
polkadot-sdk/substrate/client/api/src/client.rs Lines 359 to 364 in 4252e48
pin_block .
|
|
Substrate has its own LruMap and will unpin it eventually. But you can see ChainAPI API in #1220 prevents that from happening. |
Fair point, but then just forward the |
Closing this in favor of using UnpinHandle and #1220 (comment) |
Required for #623.
I've considered another design with RAAI similar to
lock_block
, but opted for a lower-level albeit less safe API. The reason is that the caller can provide a safer abstraction on top (see the follow-up PR).