-
Notifications
You must be signed in to change notification settings - Fork 10
feat: Update Status page to use CGW #215
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on November 29
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| // Execute the task | ||
| try { | ||
| this.lastRequestTime = Date.now(); | ||
| nextTask.lastExecuted = this.lastRequestTime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Drifted Timing After Rate-Limit Delay Resets
Race condition: After waiting for rate limiting delay, the code updates lastRequestTime and lastExecuted to Date.now() instead of the original 'now' timestamp from before the delay. This causes timing drift - if the delay is 200ms, the next task will be scheduled 200ms later than intended, compounding over time and reducing effective polling rate.
Context
We are now redirecting the Transaction Service public endpoint to the new api.safe.global, which has some implications for rate limiting. We decided to start using CGW instead because we can use to have broader limits.
How this PR solve the issue ?
This pull request introduces several improvements and refactors to the application's configuration handling, API polling, and UI styling. The most significant changes are the switch to using the Client Gateway URL for chain status queries, the introduction of a rate-limited polling manager for API calls, and updates to the UI for a more modern look and improved performance.
✨ Key change: We are making one request every 200 ms (within a 5 RPS range) and one loop of requests every 30 seconds
Configuration and API Refactoring:
VITE_CLIENT_GATEWAY_URLinstead of the previous config service URL and removes the config service selector, simplifying environment configuration and chain status fetching.getChainStatus) is refactored to use the client gateway endpoint and chain ID, aligning with the new configuration approach.API Polling Improvements:
PollingManagerutility is introduced to manage rate-limited polling for API calls, preventing excessive requests and improving performance. TheuseApihook is refactored to leverage this manager for all polling tasks.UI and Styling Updates:
Polling Interval Adjustment:
Note
Switches chain status queries to Client Gateway with centralized rate-limited polling and updates UI/fonts/logo and env configuration.
getChainStatus(clientGatewayUrl, chain)->GET /v1/chains/{chainId}/about/indexing.clientGatewayUrlthroughApp->ChainStatusTable->ChainStatusRow.PollingManagerwith ~5 RPS limit, visibility-aware pausing, and managed aborts.useApito usePollingManager; add task lifecycle management.60_000ms.VITE_CLIENT_GATEWAY_URL; keepVITE_CONFIG_SERVICE_URL; remove config service selector usage.example.envaccordingly.public/fonts/fonts.css) and set as default typography; adjust primary color.index.html.0.5.0.Written by Cursor Bugbot for commit 9e0e27b. This will update automatically on new commits. Configure here.