Skip to content

Fix/gov cache#2862

Open
foodaka wants to merge 4 commits intomainfrom
fix/gov-cache
Open

Fix/gov cache#2862
foodaka wants to merge 4 commits intomainfrom
fix/gov-cache

Conversation

@foodaka
Copy link
Collaborator

@foodaka foodaka commented Feb 6, 2026

General Changes

  • Fixes ENS issues resolving addresses
  • Reads voter count from cache
  • Handles issues with proposal not allowing voting

Developer Notes

Add any notes here that may be helpful for reviewers.


Reviewer Checklist

Please ensure you, as the reviewer(s), have gone through this checklist to ensure that the code changes are ready to ship safely and to help mitigate any downstream issues that may occur.

  • End-to-end tests are passing without any errors
  • Code changes do not significantly increase the application bundle size
  • If there are new 3rd-party packages, they do not introduce potential security threats
  • If there are new environment variables being added, they have been added to the .env.example file as well as the pertinant .github/actions/* files
  • There are no CI changes, or they have been approved by the DevOps and Engineering team(s)

Copilot AI review requested due to automatic review settings February 6, 2026 11:58
@vercel
Copy link

vercel bot commented Feb 6, 2026

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

Project Deployment Actions Updated (UTC)
interface Ready Ready Preview, Comment Feb 6, 2026 4:46pm

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

This PR fixes governance-related issues including ENS address resolution, voter count caching, and proposal voting functionality. The changes introduce a new abstraction layer (VoteProposalData) to decouple voting UI components from data source implementations (graph vs cache), resolve block hash to block number to fix RPC provider errors, and add ENS name resolution for cached proposal voters.

Changes:

  • Converts block hashes to block numbers in service calls to resolve "number too large" errors with RPC providers
  • Introduces VoteProposalData type to abstract voting data from different sources (graph/cache)
  • Adds ENS name resolution for cached governance voters and creates getUserVoteFromCache function

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/services/WalletBalanceService.ts Converts block hash to block number for governance token balance queries
src/services/GovernanceService.ts Converts block hash to block number for token power queries
src/services/GovernanceCacheService.ts Adds votingMachineAddress field and getUserVoteFromCache function
src/modules/governance/types.ts Defines new VoteProposalData type and adds ensName to VoteDisplay
src/modules/governance/adapters.ts Implements adapter functions to build VoteProposalData from different sources
src/modules/governance/proposal/VoteInfo.tsx Refactors to use VoteProposalData instead of full Proposal object
src/modules/governance/proposal/ProposalOverview.tsx Comments out proposal author display
src/hooks/useModal.tsx Updates modal types to use VoteProposalData
src/hooks/governance/useProposalVotes.ts Extracts ENS_REVERSE_REGISTRAR constant
src/hooks/governance/useGovernanceProposals.ts Adds ENS resolution for cache voters and fetches user vote for cache detail
src/components/transactions/GovVote/GovVoteModalContent.tsx Updates to use VoteProposalData type
src/components/transactions/GovVote/GovVoteActions.tsx Updates to use VoteProposalData and adds query invalidation
pages/governance/v3/proposal/index.governance.tsx Simplifies votingChainId extraction using new abstraction

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

Comment on lines 239 to 248
console.log('[GovVote] proposal data:', {
proposalId,
blockHash,
votingChainId,
votingMachineAddress,
support,
user,
assets,
tokenPowers,
});
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

Debug console.log statement should be removed before merging to production. This logging statement appears to have been added for debugging purposes but should not be included in production code.

Suggested change
console.log('[GovVote] proposal data:', {
proposalId,
blockHash,
votingChainId,
votingMachineAddress,
support,
user,
assets,
tokenPowers,
});

Copilot uses AI. Check for mistakes.
Comment on lines +96 to +97
const match = raw.match(/FixedBytes\((0x[a-fA-F0-9]+)/);
return match ? match[1] : raw;
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The regex pattern for parseFixedBytes only captures hex strings but doesn't validate the full format strictly. If the input is a plain hex string (not in FixedBytes format), it will be returned as-is, which is the intended fallback behavior. However, consider adding validation to ensure the hex string format is valid (starts with 0x and contains only valid hex characters) to catch malformed inputs early.

Suggested change
const match = raw.match(/FixedBytes\((0x[a-fA-F0-9]+)/);
return match ? match[1] : raw;
const trimmed = raw.trim();
// Strictly match the full FixedBytes(...) format and extract the hex value
const fixedBytesMatch = trimmed.match(/^FixedBytes\(\s*(0x[0-9a-fA-F]+)\s*,\s*\d+\s*\)$/);
if (fixedBytesMatch) {
return fixedBytesMatch[1];
}
// Fallback: accept only well-formed plain hex strings (e.g. "0xabc123")
const plainHexPattern = /^0x[0-9a-fA-F]*$/;
if (plainHexPattern.test(trimmed)) {
return trimmed;
}
// Malformed input: not FixedBytes format and not a valid hex string
return null;

Copilot uses AI. Check for mistakes.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b8cf9c83e6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

📦 Next.js Bundle Analysis for aave-ui

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

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