Skip to content

feat: governance cache SDK, payloads panel, and gasless voting#3063

Open
JoaquinBattilana wants to merge 9 commits into
mainfrom
feat/governance-cache-sdk
Open

feat: governance cache SDK, payloads panel, and gasless voting#3063
JoaquinBattilana wants to merge 9 commits into
mainfrom
feat/governance-cache-sdk

Conversation

@JoaquinBattilana

@JoaquinBattilana JoaquinBattilana commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

Migrates governance/proposal pages off the TheGraph subgraph onto the governance-v3-cache GraphQL API, adds a payloads panel with executable targets and Seatbelt links, revives gasless voting behind a server-side Gelato relay, and adds an experimental redesigned proposal timeline.

Changes

Governance cache SDK

  • New typed fetching layer in src/services/governance-cache-sdk/ (raw fetch + gql authoring + hand-written types) over the curated cache endpoints, plus the auto-generated/derived fields needed to fully replace the subgraph.
  • React Query hooks consolidated into src/hooks/governance/useGovernanceCache.ts; query keys centralized in queryKeysFactory.governanceCache*.
  • Old subgraph data path removed from governance.

Payloads panel

  • New ProposalPayloads panel: per-payload chain, id, state, access level, creator, controller, executable targets, and Seatbelt report link.
  • Lifecycle panel heading renamed to "Timeline"; the Seatbelt link moved into the payloads panel.
  • SDK now surfaces PayloadAction[] (target/signature/callData/value/withDelegateCall/accessLevel) per payload.

Gasless voting

  • New pages/api/gelato/relay.ts server route holds the Gelato sponsor key server-side (never bundled to the client) and relays via Gelato's sponsored-call REST endpoint.
  • The route whitelists the target against known voting machines and requires the submitVoteBySignature selector, so sponsored gas can't be spent on arbitrary transactions.
  • Client gasless path is a single step (sign EIP-712 -> relay -> poll public task status); the dead two-step approval scaffolding was removed.
  • Gated by NEXT_PUBLIC_ENABLE_GASLESS_VOTING (public on/off) plus the server-side GELATO_SPONSOR_KEY; dormant unless both are set.

Proposal timeline (experimental)

  • New src/modules/governance/proposal/ProposalTimeline.tsx: a single-spine timeline that weaves the three state machines (proposal core / voting machine / per-chain payloads) onto one line, driven entirely by existing cache data.
  • Each step renders a date when done, a live countdown while it's the active wait (creation cooldown, voting window, execution/payload timelocks), or a "Ready to X" badge when a permissionless crank is due.
  • Future steps show a forward-projected approximate date (~) chained from the known durations, floored at now so a step that's ready-but-awaiting-its-tx never reads as a past/overdue date.
  • Every underlying transaction is a plain-language, collapsible substep with a block-explorer link slot; per-chain payload breakdown lives in the expand.
  • Payload outcomes: green when all executed, solid yellow when settled with some expired/cancelled (e.g. 2 / 3 executed · 1 expired), hollow while still waiting.
  • Mounted alongside the existing ProposalLifecycleCache for side-by-side comparison, plus a dev-only preview route /governance/timeline-preview rendering all lifecycle states with mocked data.

Notes

  • Payload actions depend on the cache backend exposing the field (already live on staging).
  • The timeline is a preview: it ships next to the current one and behind a dev route, so it does not change the shipped proposal page. Some countdowns/links use placeholders (proposal cooldownPeriod, payload delay/gracePeriod, tx hashes) pending cache exposure — marked with TODOs. Before it replaces the current timeline we'd remove the old component and the preview page.
  • No new npm dependencies.

@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
interface Ready Ready Preview, Comment Jul 17, 2026 5:08am

Request Review

sammdec
sammdec previously approved these changes Jul 6, 2026
@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

📦 Next.js Bundle Analysis for aave-ui

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

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 1.33 MB (🟡 +827 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

New Page Added

The following page was added to the bundle from the code in this PR:

Page Size (compressed) First Load
/governance/timeline-preview 9.85 KB 1.34 MB

Thirteen Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/ 95.93 KB (🟡 +53 B) 1.42 MB
/bridge 38.1 KB (🟢 -51 B) 1.36 MB
/dashboard 85.5 KB (-4 B) 1.41 MB
/faucet 15.05 KB (-1 B) 1.34 MB
/governance 43.1 KB (🟢 -46.97 KB) 1.37 MB
/governance/ipfs-preview 100.36 KB (🟢 -1.44 KB) 1.42 MB
/governance/v3/proposal 91.2 KB (🟢 -42.71 KB) 1.42 MB
/markets 54.81 KB (🟡 +53 B) 1.38 MB
/reserve-overview 39.85 KB (-2 B) 1.37 MB
/safety-module 56.37 KB (🟡 +2 B) 1.38 MB
/sentry-example 2.78 KB (🟡 +36 B) 1.33 MB
/sgho 95.81 KB (🟡 +156 B) 1.42 MB
/staking 33.48 KB (-2 B) 1.36 MB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

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