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

Add expiry time to cached SuiNS name validation #19048

Merged
merged 2 commits into from
Aug 20, 2024

Conversation

Jibz-Mysten
Copy link
Contributor

Description

Describe the changes or additions included in this PR.

Test plan

How did you test the new or updated feature?


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:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • REST API:

@Jibz-Mysten Jibz-Mysten requested a review from a team as a code owner August 20, 2024 14:18
@Jibz-Mysten Jibz-Mysten requested review from williamrobertson13 and mystieanwaya and removed request for a team August 20, 2024 14:18
Copy link

vercel bot commented Aug 20, 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 Aug 20, 2024 2:24pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Skipped (Inspect) Aug 20, 2024 2:24pm
sui-kiosk ⬜️ Skipped (Inspect) Aug 20, 2024 2:24pm
sui-typescript-docs ⬜️ Skipped (Inspect) Aug 20, 2024 2:24pm

@Jibz-Mysten Jibz-Mysten requested a review from plam-ml August 20, 2024 14:19
@vercel vercel bot temporarily deployed to Preview – sui-kiosk August 20, 2024 14:20 Inactive
@vercel vercel bot temporarily deployed to Preview – multisig-toolkit August 20, 2024 14:20 Inactive
@vercel vercel bot temporarily deployed to Preview – sui-typescript-docs August 20, 2024 14:20 Inactive
export function createSuiAddressValidation(client: SuiClient, suiNSEnabled: boolean) {
const resolveCache = new Map<string, boolean>();
const resolveCache = new Map<string, { valid: boolean; expiry: number }>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Could also use an LRU cache to do this but this is fine.

@Jibz-Mysten Jibz-Mysten merged commit bd887c6 into main Aug 20, 2024
51 checks passed
@Jibz-Mysten Jibz-Mysten deleted the gj-expire-unresolved-cache-names branch August 20, 2024 14:42
tx-tomcat pushed a commit to tx-tomcat/sui-network that referenced this pull request Aug 27, 2024
## Description 

Describe the changes or additions included in this PR.

## Test plan 

How did you test the new or updated feature?

---

## 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: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
suiwombat pushed a commit that referenced this pull request Sep 16, 2024
## Description 

Describe the changes or additions included in this PR.

## Test plan 

How did you test the new or updated feature?

---

## 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: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
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