Skip to content

apollo_starknet_client: drop the feeder call-started log, add latency to the outcome - #14929

Open
matanl-starkware wants to merge 1 commit into
mainfrom
matanl/starknet-client-feeder-call-latency
Open

apollo_starknet_client: drop the feeder call-started log, add latency to the outcome#14929
matanl-starkware wants to merge 1 commit into
mainfrom
matanl/starknet-client-feeder-call-latency

Conversation

@matanl-starkware

Copy link
Copy Markdown
Collaborator

What

request_with_retry_url logged twice per feeder HTTP call:

debug!("Call to feeder started. url={url:?}");
let result = ...;
match &result {
    Ok(_)    => debug!("Call to feeder succeeded. url={url:?}"),
    Err(err) => debug!("Call to feeder failed. url={url:?}. Error = {err}"),
}

This drops the "started" line and adds the measured call duration to the outcome line (both the success and the failure branch — failures are where latency matters most, e.g. distinguishing a timeout from an immediate refusal).

Why

Part of a round of log-cost reduction. Measured over 24h of Mainnet logs via Log Analytics, these two lines are the single largest log site on sequencer-core:

site entries/24h (6 nodes) % of sequencer-core bytes
reader/mod.rs:214 "Call to feeder started" 2,205,531 5.78%
reader/mod.rs:221 "Call to feeder succeeded" 2,205,483 5.78%

Together 11.56% of the container, ~$240/month across Mainnet + Testnet. That is ~4.25 feeder calls/sec/node, each costing two log entries.

The "started" line carried no information the outcome line doesn't, other than "a call is in flight" — which the new elapsed field conveys, and more usefully.

Follow-up worth considering (not in this PR)

The surviving line still formats the URL with {url:?}, which expands a ~60-character URL into ~400 characters:

url=Url { scheme: "https", cannot_be_a_base: false, username: "", password: None,
          host: Some(Domain("feeder.alpha-mainnet.starknet.io")), port: None,
          path: "/feeder_gateway/get_block", query: Some("blockNumber=latest&..."), fragment: None }

Switching to url.as_str() would save roughly another $60/month for a one-token change. I left it out because it changes the log's shape and wasn't part of the agreed scope — happy to fold it in if reviewers want it.

Test plan

  • cargo build -p apollo_starknet_client
  • SEED=0 cargo test -p apollo_starknet_client — 76 passed, 0 failed
  • scripts/rust_fmt.sh

🤖 Generated with Claude Code

… to the outcome

`request_with_retry_url` logged twice per feeder HTTP call: once before the
call and once after. The pair is the single largest log site on
sequencer-core, at 2.21M entries per day each across the six Mainnet nodes
and 11.56% of that container's log bytes.

The "started" line only told us a call was in flight, which the outcome line
now conveys better by carrying the elapsed time.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@cursor

cursor Bot commented Aug 9, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Observability-only change in debug logging; no request, retry, or error-handling behavior changes.

Overview
Cuts feeder gateway debug logging roughly in half by removing the per-request "Call to feeder started" line from request_with_retry_url, leaving a single outcome log per HTTP call.

That outcome log now includes elapsed (via std::time::Instant) on both success and failure paths, so slow or timed-out calls are easier to spot without the extra start entry.

Reviewed by Cursor Bugbot for commit 05be00c. Bugbot is set up for automated code reviews on this repo. Configure here.

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

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.

2 participants