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

rpc-alt: getObject, multiGetObjects #21041

Merged
merged 3 commits into from
Feb 3, 2025
Merged

rpc-alt: getObject, multiGetObjects #21041

merged 3 commits into from
Feb 3, 2025

Conversation

amnn
Copy link
Contributor

@amnn amnn commented Jan 31, 2025

Description

Implement unfiltered live object set look-ups. They are built on top of an obj_info data loader which detects whether the object exists in the live object set at that version.

This PR also pulls out the common loading logic from fetch_latest_for_system_state to be used for generally loading latest content by object ID.

Test plan

New E2E tests:

sui$ cargo nextest run -p sui-indexer-alt-e2e-tests \
  -- objects/get_object objects/multi_get_objects

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:

@amnn amnn requested review from emmazzz, gegaowp and wlmyng January 31, 2025 19:56
@amnn amnn self-assigned this Jan 31, 2025
Copy link

vercel bot commented Jan 31, 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 3, 2025 2:32pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Feb 3, 2025 2:32pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Feb 3, 2025 2:32pm

@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env January 31, 2025 19:56 — with GitHub Actions Inactive
.iter()
.map(|id| response::live_object(ctx, *id, &options));

Ok(future::join_all(obj_futures)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is my understanding correct that by doing future::join_all here, we'll be able to group all the load_ones in response::live_object and take advantage of the data loader?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's correct

amnn added 3 commits February 3, 2025 14:29
## Description
Pull out the data loading part of `fetch_latest_for_system_state` to be
used in other scenarios. The shared part performs one data loader
look-up to get the latest version of an object, and then another to get
the contents at that version.

The other option was to implement this as its own data loader, but I
opted against that because while that would have shared implementation
logic, requests for latest versions and contents from this new data
loader would not have been batched with requests from the existing data
loaders.

## Test plan
CI
## Description
Implementing fetching the latest version of an object. This is a
pre-cursor to implementing `multiGetObjects`, to make it easier to test
the underlying data loader.

## Test plan

New E2E test:

```
sui$ cargo nextest run -p sui-indexer-alt-e2e-tests \
  -- objects/get_object
```
## Description
Implementing multi-gets from the live object set.

## Test plan
New E2E tests:

```
sui$ cargo nextest run -p sui-indexer-alt-e2e-tests \
  -- objects/multi_get_objects
```
@amnn amnn force-pushed the amnn/rpc-get-obj branch from 502bfea to dae3d0d Compare February 3, 2025 14:30
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env February 3, 2025 14:30 — with GitHub Actions Inactive
@amnn amnn merged commit 96eb964 into main Feb 3, 2025
47 checks passed
@amnn amnn deleted the amnn/rpc-get-obj branch February 3, 2025 15:38
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