PLA-563: Fix SQD vendor endpoint preference#10
Conversation
The SQD vendor now always prefers the endpoint from settings if it
contains {chainId}, rather than only using it when upstream.Endpoint
is empty. This fixes an issue where overrides could inadvertently
set an empty endpoint that prevented the settings endpoint from
being used.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 13a945703c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if b, ok := m.batchers[key]; ok { | ||
| m.mu.RUnlock() | ||
| return b |
There was a problem hiding this comment.
Refresh batcher when network instance/config changes
GetOrCreate returns any existing batcher purely by projectId+networkId, so once a batcher is created it keeps the original forwarder and aggregation config forever. If a project/network is reloaded with updated upstreams or new multicall settings (same IDs), subsequent requests still use the stale batcher and can be routed through old network state with outdated batching limits. This makes config reloads ineffective for multicall behavior and can forward calls to the wrong upstream set until process restart.
Useful? React with 👍 / 👎.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Summary
{chainId}Problem
The SQD vendor was checking
upstream.Endpoint == ""before reading from settings. However, when provider overrides are applied viabuildBaseUpstreamConfig, an empty string endpoint could be set on the upstream, causing the settings endpoint to be ignored and the{chainId}check to fail.Solution
Changed the logic to always prefer
settings["endpoint"]if it contains{chainId}, regardless of what's set on the upstream. This ensures the provider's configured endpoint takes precedence.Linear Ticket
https://linear.app/morpho-labs/issue/PLA-563/fix-sqd-vendor-endpoint-preference-to-use-settings
🤖 Generated with Claude Code