Skip to content

apollo_l1_gas_price_config,apollo_node: add strk_to_usd_oracle_config#14157

Merged
ShahakShama merged 2 commits into
mainfrom
shahak/strk_usd_oracle_01_config_field
May 26, 2026
Merged

apollo_l1_gas_price_config,apollo_node: add strk_to_usd_oracle_config#14157
ShahakShama merged 2 commits into
mainfrom
shahak/strk_usd_oracle_01_config_field

Conversation

@ShahakShama
Copy link
Copy Markdown
Collaborator

apollo_l1_gas_price_config,apollo_node: add strk_to_usd_oracle_config

Goal: relocate the STRK/USD oracle currently wired ad-hoc into
SequencerConsensusContext to live inside L1GasPriceProvider alongside
the existing eth_to_strk oracle. This commit is PR 1 of a 6-PR
Graphite stack; later PRs construct the oracle client in the
provider, expose it on the client trait, switch the orchestrator to
call it, and remove the dead wiring in apollo_consensus_manager.

Change summary: adds strk_to_usd_oracle_config: ExchangeRateOracleConfig
to L1GasPriceProviderConfig next to eth_to_strk_oracle_config,
extends Default, dumps it as a nested sub-config, and registers the
four new entries in config_schema.json. Pure additive; the field is
unused.

Decision points:

  • Kept the existing "eth to strk" wording in ExchangeRateOracleConfig::dump
    rather than generalizing to "exchange rate oracle". Generalizing would
    churn the eth-to-strk schema entries and force a regeneration of
    config_secrets_schema.json. Doing it here would balloon the diff;
    punting to a separate cosmetic PR.

Action required after merge: run
cargo run --bin update_apollo_node_config_schema
to regenerate config_secrets_schema.json (sandbox cannot access it).
The new private parameter strk_to_usd_oracle_config.url_header_list
needs a matching schema entry, otherwise the default_config_file_is_up_to_date
test will fail.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

apollo_deployments: add strk_to_usd_oracle_config entries to provider JSONs

Add the same three non-secret overrides (lag_interval_seconds=900,
max_cache_size=100, query_timeout_sec=10) for strk_to_usd_oracle_config
that already exist for eth_to_strk_oracle_config, in both the base
and replacer L1GasPriceProvider deployment JSONs. The new
strk_to_usd_oracle_config field on L1GasPriceProviderConfig (added
earlier in this PR) needs these production-default overrides to
behave consistently with the existing eth_to_strk oracle.

The url_header_list belongs in the secrets files (testing_secrets.json,
config_secrets_schema.json) — those are harness-blocked from this
sandbox; regenerate locally with cargo run --bin deployment_generator
and cargo run --bin update_apollo_node_config_schema.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

@cursor
Copy link
Copy Markdown

cursor Bot commented May 24, 2026

PR Summary

Medium Risk
Touches L1 gas price provider configuration (economically sensitive), but changes are additive config/schema only with no runtime oracle wiring in this commit.

Overview
Adds strk_to_usd_oracle_config to L1GasPriceProviderConfig as a nested ExchangeRateOracleConfig (same shape as eth_to_strk_oracle_config), with defaults, validation, and config dump/schema entries. ExchangeRateOracleConfig dump text is generalized to “exchange rate oracle” (including existing eth-to-strk schema keys).

Deployment and test harness JSON gain matching public overrides (lag_interval_seconds, max_cache_size, query_timeout_sec) and a private url_header_list (testing secrets + secrets schema + test_utils). Purely additive—the new field is not consumed at runtime in this PR (stack PR 1/6).

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

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

Copy link
Copy Markdown
Collaborator Author

ShahakShama commented May 24, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ShahakShama ShahakShama changed the base branch from graphite-base/14157 to main May 25, 2026 08:53
@ShahakShama ShahakShama force-pushed the shahak/strk_usd_oracle_01_config_field branch 2 times, most recently from bb29293 to 03a775e Compare May 25, 2026 11:04
Copy link
Copy Markdown
Collaborator

@matanl-starkware matanl-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matanl-starkware reviewed 7 files and all commit messages, and made 3 comments.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on ShahakShama).


crates/apollo_node/resources/config_schema.json line 3318 at r4 (raw file):

  },
  "l1_gas_price_provider_config.strk_to_usd_oracle_config.lag_interval_seconds": {
    "description": "The size of the interval (seconds) that the eth to strk rate is taken on. The lag refers to the fact that the interval `[T, T+k)` contains the conversion rate for queries in the interval `[T+k, T+2k)`. Should be configured in alignment with relevant query parameters in `url_header_list`, if required.",

copy-paste error

Code quote:

eth to strk

crates/apollo_node/resources/config_schema.json line 3328 at r4 (raw file):

  },
  "l1_gas_price_provider_config.strk_to_usd_oracle_config.query_timeout_sec": {
    "description": "The timeout (seconds) for the query to the eth to strk oracle.",

ditto

Code quote:

eth to strk

crates/apollo_node/resources/config_schema.json line 3333 at r4 (raw file):

  },
  "l1_gas_price_provider_config.strk_to_usd_oracle_config.url_header_list": {
    "description": "A list of Url+HTTP headers for the eth to strk oracle. The url is followed by a comma and then headers as key^value pairs, separated by commas. For example: `https://api.example.com/api,key1^value1,key2^value2`. Each URL+headers is separated by a pipe `|` character. The `timestamp` parameter is appended dynamically when making requests, in order to have a stable mapping from block timestamp to conversion rate. ",

Same

Code quote:

eth to strk

Goal: relocate the STRK/USD oracle currently wired ad-hoc into
SequencerConsensusContext to live inside L1GasPriceProvider alongside
the existing eth_to_strk oracle. This commit is PR 1 of a 6-PR
Graphite stack; later PRs construct the oracle client in the
provider, expose it on the client trait, switch the orchestrator to
call it, and remove the dead wiring in apollo_consensus_manager.

Change summary: adds `strk_to_usd_oracle_config: ExchangeRateOracleConfig`
to `L1GasPriceProviderConfig` next to `eth_to_strk_oracle_config`,
extends `Default`, dumps it as a nested sub-config, and registers the
four new entries in `config_schema.json`. Pure additive; the field is
unused.

Decision points:
- Kept the existing "eth to strk" wording in `ExchangeRateOracleConfig::dump`
  rather than generalizing to "exchange rate oracle". Generalizing would
  churn the eth-to-strk schema entries and force a regeneration of
  config_secrets_schema.json. Doing it here would balloon the diff;
  punting to a separate cosmetic PR.

Action required after merge: run
  cargo run --bin update_apollo_node_config_schema
to regenerate config_secrets_schema.json (sandbox cannot access it).
The new private parameter `strk_to_usd_oracle_config.url_header_list`
needs a matching schema entry, otherwise the `default_config_file_is_up_to_date`
test will fail.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ShahakShama ShahakShama force-pushed the shahak/strk_usd_oracle_01_config_field branch from 03a775e to 0c03914 Compare May 25, 2026 14:42
… JSONs

Add the same three non-secret overrides (lag_interval_seconds=900,
max_cache_size=100, query_timeout_sec=10) for strk_to_usd_oracle_config
that already exist for eth_to_strk_oracle_config, in both the base
and replacer L1GasPriceProvider deployment JSONs. The new
strk_to_usd_oracle_config field on L1GasPriceProviderConfig (added
earlier in this PR) needs these production-default overrides to
behave consistently with the existing eth_to_strk oracle.

The url_header_list belongs in the secrets files (testing_secrets.json,
config_secrets_schema.json) — those are harness-blocked from this
sandbox; regenerate locally with `cargo run --bin deployment_generator`
and `cargo run --bin update_apollo_node_config_schema`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ShahakShama ShahakShama force-pushed the shahak/strk_usd_oracle_01_config_field branch from 0c03914 to 74a40a0 Compare May 25, 2026 14:52
Copy link
Copy Markdown
Collaborator Author

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ShahakShama made 3 comments.
Reviewable status: 0 of 7 files reviewed, 3 unresolved discussions (waiting on matanl-starkware).


crates/apollo_node/resources/config_schema.json line 3318 at r4 (raw file):

Previously, matanl-starkware (Matan Lior) wrote…

copy-paste error

It needs to be identical in both of them because it's the same config struct. Reworded to be more generic


crates/apollo_node/resources/config_schema.json line 3328 at r4 (raw file):

Previously, matanl-starkware (Matan Lior) wrote…

ditto

Done.


crates/apollo_node/resources/config_schema.json line 3333 at r4 (raw file):

Previously, matanl-starkware (Matan Lior) wrote…

Same

Done.

Copy link
Copy Markdown
Collaborator

@matanl-starkware matanl-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matanl-starkware reviewed 7 files and all commit messages, and resolved 3 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on ShahakShama).

@sirandreww-starkware sirandreww-starkware added this pull request to the merge queue May 26, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks May 26, 2026
@ShahakShama ShahakShama added this pull request to the merge queue May 26, 2026
Merged via the queue into main with commit d539c96 May 26, 2026
27 checks passed
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.

3 participants