fix(provider): adaptive HTTP polling for local/Anvil endpoints#114
Merged
Conversation
Drop the HTTP fallback poll interval from 1s to 100ms when ETH_RPC_URL points at 127.0.0.1 / localhost / host.docker.internal / [::1]. Mainnet RPC stays at 1s. Override via AETHER_HTTP_POLL_MS for tests. On the historical replay e2e script this closes the last catch-rate gap vs the aether-replay oracle: block 24643151 now captures the post-CoW AAVE arb at +17,920 ETH gross (bundle arb-24643154-1-5-1), detection throughput rises from 988 to 4,600 cycles and shadow bundles from 68 to 1,459 in the same ~10s replay window. 3 unit tests cover the heuristic, env-var override, and remote URL default. No behaviour change for mainnet HTTP fallback.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
14 tasks
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
ETH_RPC_URLpoints at127.0.0.1/localhost/host.docker.internal/[::1]. Mainnet HTTP fallback stays at 1 s.AETHER_HTTP_POLL_MSenv var for explicit override (tests, tuning).aether-replayoracle: at 1 s cadence the detector batches an entire Anvil-replayed block into a single scrape and misses short-lived intra-block arbs.Why
Anvil replays a full historical block in hundreds of ms. The pre-existing 1 s
connect_httpcadence collapsed all intra-block state transitions into one batched scrape, so on block24643151the pipeline caught the post-CoW AAVE arb at +11.87 ETH instead of the tx-1 peak +17,044 ETH thataether-replaycaptures. Real mainnet RPC (12 s/block) is unaffected — the heuristic only kicks in for local hosts.Files Changed
crates/grpc-server/src/provider.rsresolve_http_poll_interval()+is_local_rpc()helpers;connect_http()calls them; 3 new unit testsAcceptance criteria
127.0.0.1,localhost,host.docker.internal,[::1]) poll at 100 msAETHER_HTTP_POLL_MSenv var overrides both heuristic and default; unparseable values fall through to defaultconnect_httppolling loop unchanged structurallyTest plan
cargo build --release -p aether-grpc-servercargo clippy -p aether-grpc-server --all-targets --release -- -D warningscargo test -p aether-grpc-server --release— 23 provider unit tests + 3 ws-subscription integration tests passis_local_rpcmatrix, default routing, env-var override, unparseable env-var fallback./scripts/historical_replay_e2e.sh --block 24643151and confirm tx-1 AAVE arb captured at full +17 k ETH gross (parity withaether-replay --block 24643151 --sim-on-chain)Refs #107 (Fix 6).