Skip to content

Reduce duplicate bridge quote requests - #4145

Open
ChiTimesChi wants to merge 4 commits into
masterfrom
codex/bridge-quote-rpc-load
Open

ChiTimesChi wants to merge 4 commits into
masterfrom
codex/bridge-quote-rpc-load

Conversation

@ChiTimesChi

@ChiTimesChi ChiTimesChi commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Repeated renders recreate bridge providers and SDK instances, and simultaneous identical quote requests repeat the same SDK work. Reuse providers, SDK instances, and context while the chain/RPC configuration is unchanged, and share in-flight bridgeV2 requests between consumers of the same SDK and full parameter set.

Provider configuration changes, including widget custom RPC changes, still rebuild the SDK and trigger a fresh interface quote. Successful and failed requests leave the sharing map when they settle, so later refreshes fetch fresh quotes. Each thunk retains its own request ID.

Additional context

  • Quote sharing is used by the bridge quote thunk and gas estimator. Different amounts, recipients, parameters, and SDK instances remain separate.
  • Allowance fetching and stale-quote scheduling are unchanged.
  • Addresses SonarCloud S2871 with an explicit string comparator and S6544 with an explicit cached-Promise presence check.
  • Independent of the SYN SDK changes in Reduce HyperCore SYN quote RPC load #4144; this PR targets master directly.

Validation

  • Six targeted suites passed: 35 tests across interface quote/provider integration and widget providers/quote updates.
  • Interface TypeScript passed with explicit Next.js ambient types for the fresh worktree. Widget TypeScript passed with --skipLibCheck.
  • Scoped lint, including the new test imports, passed with the unavailable local @typescript-eslint/no-shadow rule disabled. Formatting and git diff --check passed.

937a238: synapse-interface preview link

@vercel

vercel Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
sanguine Error Error Sep 28, 2026 1:12pm UTC

@coderabbitai

coderabbitai Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 56 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: synapsecns/sanguine/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 51183fb6-90cf-4c0f-bed8-d8d919866983

📥 Commits

Reviewing files that changed from the base of the PR and between 7c81262 and 5a5cd10.

📒 Files selected for processing (10)
  • packages/synapse-interface/__tests__/bridgeQuoteSingleFlight.test.ts
  • packages/synapse-interface/__tests__/synBridgeQuote.test.ts
  • packages/synapse-interface/__tests__/synapseProvider.test.tsx
  • packages/synapse-interface/pages/state-managed-bridge/index.tsx
  • packages/synapse-interface/slices/bridgeQuote/thunks.ts
  • packages/synapse-interface/utils/bridgeQuoteSingleFlight.ts
  • packages/synapse-interface/utils/hooks/useGasEstimator.ts
  • packages/synapse-interface/utils/providers/SynapseProvider.tsx
  • packages/widget/src/providers/SynapseProvider.test.tsx
  • packages/widget/src/providers/SynapseProvider.tsx

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 57.99574%. Comparing base (fc3e96f) to head (5a5cd10).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
packages/widget/src/providers/SynapseProvider.tsx 91.66667% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##              master       #4145         +/-   ##
===================================================
+ Coverage   57.57648%   57.99574%   +0.41926%     
===================================================
  Files            147         147                 
  Lines           4217        4221          +4     
  Branches         809         809                 
===================================================
+ Hits            2428        2448         +20     
+ Misses          1699        1682         -17     
- Partials          90          91          +1     
Flag Coverage Δ
packages 57.99574% <91.66667%> (+0.41926%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying sanguine-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5a5cd10
Status: ✅  Deploy successful!
Preview URL: https://2c5d35b7.sanguine-fe.pages.dev
Branch Preview URL: https://codex-bridge-quote-rpc-load.sanguine-fe.pages.dev

View logs

@codecov

codecov Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 62.99kB (0.19%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sdk-router-@synapsecns/sdk-router-esm 485.37kB 24.46kB (5.31%) ⬆️
sdk-router-@synapsecns/sdk-router-cjs 220.11kB 9.91kB (4.71%) ⬆️
synapse-interface-server-cjs 2.29MB 14.12kB (0.62%) ⬆️
synapse-interface-edge-server-array-push 92.94kB 138 bytes (0.15%) ⬆️
synapse-interface-client-array-push 8.04MB 14.36kB (0.18%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sdk-router-@synapsecns/sdk-router-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
sdk-router.cjs.production.min.js 9.91kB 220.11kB 4.71%
view changes for bundle: synapse-interface-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
6814.js 12.23kB 486.34kB 2.58%
../pages/index.js 695 bytes 77.24kB 0.91%
2007.js 983 bytes 59.72kB 1.67%
4248.js -1 bytes 45.67kB -0.0%
8580.js 303 bytes 14.81kB 2.09%
2595.js 1 bytes 11.71kB 0.01%
5009.js (New) 10.62kB 10.62kB 100.0% 🚀
3773.js (Deleted) -10.7kB 0 bytes -100.0% 🗑️

Files in 6814.js:

  • ./slices/bridgeQuote/thunks.ts → Total Size: 5.64kB

  • ./utils/bridgeQuoteSingleFlight.ts → Total Size: 920 bytes

Files in 2007.js:

  • ./utils/hooks/useGasEstimator.ts → Total Size: 5.71kB

  • ./pages/state-managed-bridge/index.tsx → Total Size: 24.73kB

view changes for bundle: synapse-interface-edge-server-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
pages/api/rpc/[chainId].js 138 bytes 90.44kB 0.15%
view changes for bundle: sdk-router-@synapsecns/sdk-router-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
sdk-router.esm.js 24.46kB 485.37kB 5.31% ⚠️
view changes for bundle: synapse-interface-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js 12.52kB 2.41MB 0.52%
static/css/*.css 185 bytes 157.58kB 0.12%
static/chunks/pages/index-*.js 691 bytes 66.84kB 1.04%
static/chunks/4089-*.js 1.04kB 52.89kB 2.0%
static/chunks/7846-*.js (New) 11.62kB 11.62kB 100.0% 🚀
static/pkI-CebtxTNsP3nki21aS/_buildManifest.js (New) 6.67kB 6.67kB 100.0% 🚀
static/chunks/pages/pools-*.js 4 bytes 6.32kB 0.06%
static/pkI-CebtxTNsP3nki21aS/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/chunks/3230-*.js (Deleted) -11.7kB 0 bytes -100.0% 🗑️
static/3hQklxM09vkYek63F_SRq/_buildManifest.js (Deleted) -6.67kB 0 bytes -100.0% 🗑️
static/3hQklxM09vkYek63F_SRq/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

Files in static/chunks/pages/_app-*.js:

  • ./utils/bridgeQuoteSingleFlight.ts → Total Size: 920 bytes

  • ./slices/bridgeQuote/thunks.ts → Total Size: 6.84kB

Files in static/css/*.css:

  • ./utils/bridgeQuoteSingleFlight.ts → Total Size: 920 bytes

  • ./slices/bridgeQuote/thunks.ts → Total Size: 6.84kB

This branch had an error being deployed

1 failed deployment
Preview — 5a5cd10c Deployed Sep 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant