Skip to content

Comments

feat: improve ens caching of treasury votes table#561

Open
ECWireless wants to merge 3 commits intomainfrom
feat/improve-treasury-votes-caching-behavior
Open

feat: improve ens caching of treasury votes table#561
ECWireless wants to merge 3 commits intomainfrom
feat/improve-treasury-votes-caching-behavior

Conversation

@ECWireless
Copy link
Collaborator

Co-authored-by: Rick Staa rick.staa@outlook.com

Description

Module-level cache to avoid repeated ENS lookups across renders/navigations.

Type of Change

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation update
  • style: Code style/formatting changes (no logic changes)
  • refactor: Code refactoring (no behavior change)
  • perf: Performance improvement
  • test: Adding or updating tests
  • build: Build system or dependency changes
  • ci: CI/CD changes
  • chore: Other changes

Related Issue(s)

Related: #539

^ closes and replaces the above PR

Changes Made

  • Adds memory caching for ens lookups in the TreasuryVoteTable
  • Includes ENS_CACHE_MAX_ENTRIES for edge case memory bloating
  • Includes in-flight dedupes in case the same 2 address get looked up at the same time

Testing

  • Tested locally
  • Added/updated tests
  • All tests passing

How to test (optional unless test is not trivial)

  • Check the voting history of a proposal on a treasury proposal page; ensure ens names load quickly

Impact / Risk

Risk level: Low

Impacted areas: UI

User impact: faster ens name loads

Rollback plan: hotfix or Vercel rollback

Screenshots / Recordings (if applicable)

NA

Additional Notes

NA

Co-authored-by: Rick Staa <rick.staa@outlook.com>
Copilot AI review requested due to automatic review settings February 25, 2026 00:58
@vercel
Copy link
Contributor

vercel bot commented Feb 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
explorer-arbitrum-one Ready Ready Preview, Comment Feb 25, 2026 1:46am

Request Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a module-level ENS lookup cache for the TreasuryVoteTable to reduce repeated ENS provider calls across re-renders/navigations.

Changes:

  • Introduces a bounded module-level Map cache for resolved ENS names (with LRU-like eviction).
  • Adds in-flight request de-duplication so concurrent lookups for the same address share a single promise.
  • Updates Apollo query fetchPolicy for treasury votes/events to "cache-and-network".

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

1 participant