This PR provides comprehensive implementations resolving issues across financial smart contract governance security, microservices GraphQL Federation gateway, Redis token-bucket rate limiting middleware, and React Server Components (RSC) dashboard architecture.
-
[CONTRACTS] Governance Double-Voting and Infinite Inflation Vulnerability (#680):
- Updated
votefunction incontracts/governance/src/lib.rsto query storage for existing vote record (DataKey::Vote(voter, proposal_id)). - Rejects duplicate voting attempts with
Err("Already voted")to prevent voting power inflation. - Added unit test suite in
contracts/governance/src/lib.rsverifying double-voting prevention.
- Updated
-
[BACKEND] Implement GraphQL Federation for Microservices (#683):
- Implemented
GraphQLFederationGatewayinbackend/src/api/handlers/graphql.rsunifying subgraphs across Contracts, Governance, Indexing, and Auth. - Added schema introspection support (
__schema) and federated query entity resolution. - Registered
POST /api/v1/graphqlendpoint inbackend/src/router.rs.
- Implemented
-
[BACKEND] Redis-backed Token Bucket Rate Limiting (#684):
- Implemented
TokenBucketRateLimiterinbackend/src/api/middleware/rate_limit.rsusing Redis Lua script execution with in-memory token bucket fallback. - Created Axum
rate_limit_middlewareevaluating token consumption per client IP / API key and emittingX-RateLimit-*response headers or returning HTTP 429 (Too Many Requests). - Exported
rate_limitinbackend/src/api/middleware/mod.rs.
- Implemented
-
[FRONTEND] React Server Components (RSC) Migration (#691):
- Implemented RSC primitives and server-side data fetchers (
fetchDashboardDataServer,fetchEventListenerDataServer) infrontend/src/components/rsc/rsc.ts. - Built
RscDashboard.tsxcomponent offloading data fetching to server components and reducing client-side bundle size. - Added
RscDashboard.test.tsxtesting RSC loading and data rendering.
- Implemented RSC primitives and server-side data fetchers (
Closes #680 Closes #683 Closes #684 Closes #691