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

[indexer] properly set key for cache in indexer reader #17649

Merged
merged 1 commit into from
May 11, 2024

Conversation

emmazzz
Copy link
Contributor

@emmazzz emmazzz commented May 11, 2024

Description

Right now we are setting the key of the cache to be the raw string "{ format!("{}{}", package_id, obj_type) }", which does not change with the input causing the cache to essentially store the first entry and always returning it. This PR fixes that. I've scanned the code base and changed the only two occurrences of cache_get_or_set_with

Test plan

tested locally


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):
  • Indexer: Now the cache is properly set and indexer reader will behave correctly and return the correct data.
  • JSON-RPC: Now JSON-RPC will respond with the correct coin metadata and total supply information when queried.
  • GraphQL:
  • CLI:
  • Rust SDK:

Copy link

vercel bot commented May 11, 2024

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 May 11, 2024 1:15am
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview May 11, 2024 1:15am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview May 11, 2024 1:15am
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview May 11, 2024 1:15am

@emmazzz emmazzz merged commit 16624f1 into main May 11, 2024
48 checks passed
@emmazzz emmazzz deleted the emma/fix-indexer-reader-cache branch May 11, 2024 01:45
emmazzz added a commit that referenced this pull request May 11, 2024
## Description 

Right now we are setting the key of the cache to be the raw string `"{
format!("{}{}", package_id, obj_type) }"`, which does not change with
the input causing the cache to essentially store the first entry and
always returning it. This PR fixes that. I've scanned the code base and
changed the only two occurrences of `cache_get_or_set_with`

## Test plan 

tested locally

---

## 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): 
- [x] Indexer: 
- [x] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
emmazzz added a commit that referenced this pull request May 11, 2024
## Description 

Right now we are setting the key of the cache to be the raw string `"{
format!("{}{}", package_id, obj_type) }"`, which does not change with
the input causing the cache to essentially store the first entry and
always returning it. This PR fixes that. I've scanned the code base and
changed the only two occurrences of `cache_get_or_set_with`

## Test plan 

tested locally

---

## 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): 
- [x] Indexer: 
- [x] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
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.

None yet

3 participants