-
Notifications
You must be signed in to change notification settings - Fork 74
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
Change max number of pinned blocks to max number of finalized pinned blocks #2373
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.
Automatically approving tomaka's pull requests. This auto-approval will be removed once more maintainers are active.
twiggy diff reportDifference in .wasm size before and after this pull request.
|
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.
👍
Close #2217
As suggested here: #2215 (comment)
Since the user can't control the number of non-finalized blocks, it makes sense for the non-finalized blocks to not be counted towards the limit. It is entirely smoldot's fault if the number of non-finalized blocks becomes too high (well, it might be because of a problem with the chain itself, but basically it's smoldot's problem and not the JSON-RPC client's problem).
The limit is now a
NonZeroUsize
. Previously, if the limit passed as parameter was too low, we would immediately close the subscription. Now, it is impossible to have a limit that is too low, because we always start with exactly 1 finalized pinned block, which is always <= the value inside of aNonZeroUsize
.Note that this doesn't require any change to https://github.com/paritytech/json-rpc-interface-spec/, as the number of pinned blocks is at the discretion of the implementation.
I've also reduced the hardcoded limits at some places, since we no longer take the non-finalized blocks into account.