Skip to content

feat: architecture diagram + RPC rate-limiting with exponential backoff#212

Open
miracle605 wants to merge 1 commit into
Dgetsylver:mainfrom
miracle605:feat/arch-diagram-rpc-rate-limit
Open

feat: architecture diagram + RPC rate-limiting with exponential backoff#212
miracle605 wants to merge 1 commit into
Dgetsylver:mainfrom
miracle605:feat/arch-diagram-rpc-rate-limit

Conversation

@miracle605
Copy link
Copy Markdown

Summary

Closes #79
Closes #89


#79 — Architecture diagram in root README

  • Added docs/diagrams/architecture.svg: a flow diagram showing the full request path — User → Wallet → Frontend → Soroban RPC → Blend Pool → b/d Tokens
  • Created README.md at the repo root, embedding the SVG with a layer description table, quickstart instructions, and links to existing docs
  • SVG uses inline CSS fill/stroke classes so it renders correctly on both GitHub dark and light themes

#89 — Rate-limit RPC calls from frontend

withRetry() upgrade (frontend/src/blend.ts):

  • Retries increased from 2 → 4
  • Fixed delay replaced with exponential backoff: baseDelay × 2^attempt
  • Up to 300 ms random jitter added per attempt to prevent retry storms
  • 429 detection: checks error.status, error.response.status, and the error message string; emits console.warn with the back-off duration when throttling triggers

All bare server.* calls wrapped in withRetry():

  • buildApproveXdrgetLatestLedger, getAccount, simulateTransaction
  • buildOpenPositionXdrgetAccount, simulateTransaction
  • buildCloseSubmitXdrgetAccount, simulateTransaction
  • buildRepayXdrgetAccount, simulateTransaction
  • buildWithdrawXdrgetAccount, simulateTransaction
  • buildClaimXdrgetAccount, simulateTransaction
  • buildIncreaseLeverageXdrgetAccount, simulateTransaction
  • buildDecreaseLeverageXdrgetAccount, simulateTransaction
  • buildResupplyXdrgetAccount, simulateTransaction

Files changed

File Change
README.md Created — root readme with embedded diagram
docs/diagrams/architecture.svg Created — architecture flow SVG
frontend/src/blend.ts withRetry upgraded; all bare RPC calls wrapped

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
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@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! 🚀

Learn more about application limits

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.

H5: Rate-limit RPC calls from frontend G2: Architecture diagram in root README

1 participant