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

[typed store] iterators: deprecate skip_to/skip_prior_to/skip_to_last/reverse methods #21289

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

phoenix-o
Copy link
Contributor

@phoenix-o phoenix-o commented Feb 19, 2025

Description

deprecates skip_to/skip_prior_to/skip_to_last/reverse methods


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

Copy link

vercel bot commented Feb 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 21, 2025 3:33pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Feb 21, 2025 3:33pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Feb 21, 2025 3:33pm

@phoenix-o phoenix-o force-pushed the db_iterators_interface_0 branch from d8c3193 to 81f33e7 Compare February 21, 2025 15:31
@phoenix-o phoenix-o temporarily deployed to sui-typescript-aws-kms-test-env February 21, 2025 15:31 — with GitHub Actions Inactive
@phoenix-o phoenix-o changed the title [typed store] iterators: deprecate skip_to callsite [typed store] iterators: deprecate skip_to/skip_prior_to/skip_to_last/reverse methods Feb 21, 2025
@phoenix-o phoenix-o marked this pull request as ready for review February 21, 2025 16:24
@phoenix-o phoenix-o requested a review from a team as a code owner February 21, 2025 16:24
@phoenix-o phoenix-o requested a review from andll February 21, 2025 16:24
@phoenix-o phoenix-o temporarily deployed to sui-typescript-aws-kms-test-env February 21, 2025 16:25 — with GitHub Actions Inactive
Copy link
Contributor

@andll andll left a comment

Choose a reason for hiding this comment

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

Added a question about iterator API

Another question I have is if we could (in future PRs) cleanup iterator API further so that at the end there is only two iterator methods left (range_iter and reverse_range_iter)?

/// Upper bound is included.
pub fn reversed_safe_iter_with_bounds(
&self,
lower_bound: Option<K>,
Copy link
Contributor

@andll andll Feb 21, 2025

Choose a reason for hiding this comment

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

I see there is two approaches in DBMap for bounds - there is either Option<> where Some(...) means included bound, and there is approach in range_iter and create_read_options_with_range method where user can select type of bounds to be either included or excluded.
Should we try to just adopt same style API for reverse iterator and name method reverse_range_iter? (e.g. allow user to select type of bounds). Especially since it looks like we are calling create_read_options_with_range internally anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe, we can further simplify and merge methods. We can do it as a followup though. This PR is already large/risky enough

@andll andll requested a review from halfprice February 21, 2025 21:24
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.

2 participants