feat: architecture diagram + RPC rate-limiting with exponential backoff#212
Open
miracle605 wants to merge 1 commit into
Open
feat: architecture diagram + RPC rate-limiting with exponential backoff#212miracle605 wants to merge 1 commit into
miracle605 wants to merge 1 commit into
Conversation
Dgetsylver#79 — Architecture diagram in root README - Add docs/diagrams/architecture.svg: SVG flow diagram showing User → Wallet → Frontend → Soroban RPC → Blend Pool → b/d Tokens - Create README.md embedding the diagram with a layer description table, quickstart instructions, and links to existing docs - Diagram uses inline CSS classes for fill/stroke so it renders correctly on both GitHub dark and light themes Dgetsylver#89 — Rate-limit RPC calls from frontend - Upgrade withRetry() in frontend/src/blend.ts: - Increase default retries from 2 to 4 - Switch from fixed delay to exponential backoff (baseDelay × 2^attempt) - Add up to 300 ms of random jitter per attempt to spread retry storms - Detect HTTP 429 responses (status field and message string) and emit a console.warn with the back-off duration when throttling triggers - Wrap every bare server.getAccount(), server.getLatestLedger(), and server.simulateTransaction() call in withRetry() across all transaction builders: buildApproveXdr, buildOpenPositionXdr, buildCloseSubmitXdr, buildRepayXdr, buildWithdrawXdr, buildClaimXdr, buildIncreaseLeverageXdr, buildDecreaseLeverageXdr, buildResupplyXdr Closes Dgetsylver#79 Closes Dgetsylver#89
|
@miracle605 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #79
Closes #89
#79 — Architecture diagram in root README
docs/diagrams/architecture.svg: a flow diagram showing the full request path — User → Wallet → Frontend → Soroban RPC → Blend Pool → b/d TokensREADME.mdat the repo root, embedding the SVG with a layer description table, quickstart instructions, and links to existing docsfill/strokeclasses so it renders correctly on both GitHub dark and light themes#89 — Rate-limit RPC calls from frontend
withRetry()upgrade (frontend/src/blend.ts):baseDelay × 2^attempterror.status,error.response.status, and the error message string; emitsconsole.warnwith the back-off duration when throttling triggersAll bare
server.*calls wrapped inwithRetry():buildApproveXdr—getLatestLedger,getAccount,simulateTransactionbuildOpenPositionXdr—getAccount,simulateTransactionbuildCloseSubmitXdr—getAccount,simulateTransactionbuildRepayXdr—getAccount,simulateTransactionbuildWithdrawXdr—getAccount,simulateTransactionbuildClaimXdr—getAccount,simulateTransactionbuildIncreaseLeverageXdr—getAccount,simulateTransactionbuildDecreaseLeverageXdr—getAccount,simulateTransactionbuildResupplyXdr—getAccount,simulateTransactionFiles changed
README.mddocs/diagrams/architecture.svgfrontend/src/blend.tswithRetryupgraded; all bare RPC calls wrapped