feat(config): add remote config layer fetched from S3 - #328
Open
zizou0x wants to merge 1 commit into
Open
Conversation
Per-chain tuned values are pulled at startup and applied between the embedded defaults and the local config file. Fetching is fail-safe: bounded retries, size cap, explicit redirect handling, and any error falls back to the lower layers with a warning. Lib users get config::get_default(chain) for embedded + remote in one call. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
brunoguerios
self-requested a review
July 20, 2026 20:22
brunoguerios
approved these changes
Jul 21, 2026
brunoguerios
left a comment
Contributor
There was a problem hiding this comment.
Nice one!
Fits in nicely on top of the previous PR 👏
LGTM ✅
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.
Stacked on #320 (config centralization).
What
Adds a remote config layer to the resolution stack. Per-chain tuned values are
pulled from S3 at startup and applied right above the embedded defaults:
Default URL (per chain, overridable via
--remote-config-url/REMOTE_CONFIG_URL;--no-remote-configdisables):The payload is a
PartialConfigin the same schema asfynd.toml. Empty payloadsare published for all six supported chains (verified end to end against the live
bucket, including a tuned-value round trip).
Fail-safe behavior
The remote layer can never take a solver down:
the caller bounds the fetch with a timeout (binary: 2 s)
unfollowable 301 on region mismatches)
whose pools reference an unknown algorithm is rejected wholesale so outdated
binaries fall back instead of failing at solver build
Library API
Config::apply_remote(url, timeout)— async layer application; returnsselfunchanged on any fetch problem
config::get_default(chain)— embedded + remote with default URL and built-in2 s budget, in one call
config::remote::fetch_remote_config(url)— raw fetch for custom error handlingCovered by mock-server tests: valid payload, 5xx retry, 4xx no-retry, unfollowable
redirect, oversized body, garbage TOML, unknown algorithm, and fallback-on-timeout.
🤖 Generated with Claude Code