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

Allow to partially unwrap session iterator #3274

Merged
merged 4 commits into from
Dec 29, 2023

Conversation

fyfyrchik
Copy link
Contributor

@fyfyrchik fyfyrchik commented Dec 19, 2023

Close #3272

@fyfyrchik fyfyrchik changed the title Allow to partially unwrap session iterator WIP: Allow to partially unwrap session iterator Dec 19, 2023
@fyfyrchik fyfyrchik marked this pull request as draft December 19, 2023 17:37
@fyfyrchik fyfyrchik changed the title WIP: Allow to partially unwrap session iterator Allow to partially unwrap session iterator Dec 19, 2023
@fyfyrchik fyfyrchik force-pushed the partial-iterator branch 2 times, most recently from 7018c1c to ec0de6e Compare December 19, 2023 17:41
@fyfyrchik
Copy link
Contributor Author

fyfyrchik commented Dec 19, 2023

A good question is where to put tests for this? I haven't found anything for another CreateCall* script.

@fyfyrchik fyfyrchik marked this pull request as ready for review December 20, 2023 10:17
@fyfyrchik fyfyrchik force-pushed the partial-iterator branch 7 times, most recently from aa71f43 to eba7385 Compare December 20, 2023 10:42
AnnaShaleva
AnnaShaleva previously approved these changes Dec 20, 2023
pkg/smartcontract/entry.go Show resolved Hide resolved
pkg/smartcontract/entry.go Show resolved Hide resolved
pkg/smartcontract/entry.go Show resolved Hide resolved
pkg/smartcontract/entry.go Show resolved Hide resolved
pkg/rpcclient/unwrap/unwrap.go Outdated Show resolved Hide resolved
pkg/rpcclient/unwrap/unwrap.go Outdated Show resolved Hide resolved
pkg/rpcclient/unwrap/unwrap.go Outdated Show resolved Hide resolved
pkg/vm/iterator_test.go Show resolved Hide resolved
@AnnaShaleva AnnaShaleva dismissed their stale review December 20, 2023 15:45

Approve is accedent, I was going to push "Comment" button.

@AnnaShaleva
Copy link
Member

And just a side note: what do you think about extending "getversion" RPC call to be able to query RPC server settings? Then we may include SessionEnabled and a set of other RPC-specific settings to the response.

@roman-khimov
Copy link
Member

Makes sense for things that can probed from outside anyway.

pkg/rpcclient/unwrap/unwrap.go Outdated Show resolved Hide resolved
pkg/rpcclient/unwrap/unwrap_test.go Show resolved Hide resolved
Copy link

codecov bot commented Dec 26, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (3176f72) 85.16% compared to head (78050e8) 85.25%.

Files Patch % Lines
pkg/smartcontract/entry.go 92.50% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3274      +/-   ##
==========================================
+ Coverage   85.16%   85.25%   +0.08%     
==========================================
  Files         327      327              
  Lines       44267    44326      +59     
==========================================
+ Hits        37702    37790      +88     
+ Misses       5071     5039      -32     
- Partials     1494     1497       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AnnaShaleva
Copy link
Member

Linter job is unhappy about increment.

@AnnaShaleva
Copy link
Member

@fyfyrchik, could you fix the issues that are left? We'll make it a part of 0.105 and release within a several days.

There is CreateCallAndUnwrapIteratorScript() which can traverse
iterator for nodes with sessions disabled. For other nodes this may
still be beneficial: if there is a small number of items, we might read
(or prefetch) all of them in one request. However, this script continues
to work even for large collections, returning both accumulated array and
remaining iterator.

Signed-off-by: Evgenii Stratonikov <fyfyrchik@runbox.com>
It can be used to work with the results of
CreateCallAndPrefetchIteratorScript() execution. The first item must be
an array and the optional second item must be an iterator, containing
remaining elements.

Signed-off-by: Evgenii Stratonikov <fyfyrchik@runbox.com>
Check that is uses only 3 syscalls and also specify boundary behaviour.

Signed-off-by: Evgenii Stratonikov <fyfyrchik@runbox.com>
Missing piece for perfect coverage. Check that an error is returned an
no panic occurs.

Signed-off-by: Evgenii Stratonikov <fyfyrchik@runbox.com>
Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

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

💖

@AnnaShaleva AnnaShaleva merged commit 0d3f749 into nspcc-dev:master Dec 29, 2023
18 of 19 checks passed
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.

Allow to partially unwrap session iterator
3 participants