Skip to content

apollo_l1_gas_price,apollo_l1_gas_price_config: move exchange_rate_decimals const to config#13881

Open
sirandreww-starkware wants to merge 1 commit into04-20-apollo_consensus_orchestrator_add_snip-35_proposer-validator_symmetry_testsfrom
04-26-apollo_l1_gas_price_apollo_l1_gas_price_config_move_exchange_rate_decimals_const_to_config
Open

apollo_l1_gas_price,apollo_l1_gas_price_config: move exchange_rate_decimals const to config#13881
sirandreww-starkware wants to merge 1 commit into04-20-apollo_consensus_orchestrator_add_snip-35_proposer-validator_symmetry_testsfrom
04-26-apollo_l1_gas_price_apollo_l1_gas_price_config_move_exchange_rate_decimals_const_to_config

Conversation

@sirandreww-starkware
Copy link
Copy Markdown
Contributor

No description provided.

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

@sirandreww-starkware sirandreww-starkware self-assigned this Apr 26, 2026
Copy link
Copy Markdown
Contributor Author

sirandreww-starkware commented Apr 26, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

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

@sirandreww-starkware sirandreww-starkware marked this pull request as ready for review April 26, 2026 16:25
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 26, 2026

PR Summary

Medium Risk
Changes L1 gas price oracle validation to depend on a new config field; misconfigured exchange_rate_decimals could cause rate fetch failures and downstream gas price calculation issues.

Overview
Moves the ETH/STRK oracle decimals expectation from a hardcoded constant to a new ExchangeRateOracleConfig.exchange_rate_decimals field (defaulting to 18) and updates ExchangeRateOracleClient to validate responses against this config value.

Updates generated config schema (config_schema.json) accordingly, and simplifies integration tests by dropping the apollo_l1_gas_price crate dependency and hardcoding the mocked oracle response decimals to 18.

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

Copy link
Copy Markdown
Collaborator

@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 reviewed 4 files and all commit messages, and made 3 comments.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on ob1337 and sirandreww-starkware).


a discussion (no related file):
I'll make sure with @ob1337 that this is indeed needed


crates/apollo_integration_tests/src/utils.rs line 573 at r1 (raw file):

    // tests.
    let price = format!("0x{DEFAULT_ETH_TO_FRI_RATE:x}");
    let response = json!({ "timestamp": query.timestamp ,"price": price, "decimals": 18 });

If the decimals are already part of the response, why do we need them as config?


crates/apollo_l1_gas_price_config/src/config.rs line 31 at r1 (raw file):

    pub max_cache_size: usize,
    pub query_timeout_sec: u64,
    pub exchange_rate_decimals: u64,

I prefer this won't be a config and will instead be a separate parameter in the ctor. Then, when you initialize eth to strk you'll use 10^18 constant and when you use strk to usd you'll use a different constant

@sirandreww-starkware sirandreww-starkware changed the base branch from 04-26-apollo_l1_gas_price_deployment_rename_eth_to_strk_oracle_to_price_oracle to graphite-base/13881 April 27, 2026 08:06
@sirandreww-starkware sirandreww-starkware force-pushed the 04-26-apollo_l1_gas_price_apollo_l1_gas_price_config_move_exchange_rate_decimals_const_to_config branch from af7a9a3 to 4c28248 Compare April 27, 2026 08:06
@sirandreww-starkware sirandreww-starkware force-pushed the 04-20-apollo_consensus_orchestrator_add_snip-35_proposer-validator_symmetry_tests branch from 8148825 to 6768f3a Compare May 1, 2026 15:11
@sirandreww-starkware sirandreww-starkware force-pushed the 04-26-apollo_l1_gas_price_apollo_l1_gas_price_config_move_exchange_rate_decimals_const_to_config branch 2 times, most recently from f2218f7 to 102b640 Compare May 1, 2026 15:59
@sirandreww-starkware sirandreww-starkware force-pushed the 04-20-apollo_consensus_orchestrator_add_snip-35_proposer-validator_symmetry_tests branch from 2d7839e to 045b217 Compare May 1, 2026 15:59
@sirandreww-starkware sirandreww-starkware force-pushed the 04-26-apollo_l1_gas_price_apollo_l1_gas_price_config_move_exchange_rate_decimals_const_to_config branch from 102b640 to a212b4d Compare May 1, 2026 17:08
@sirandreww-starkware sirandreww-starkware force-pushed the 04-20-apollo_consensus_orchestrator_add_snip-35_proposer-validator_symmetry_tests branch 2 times, most recently from 95db906 to e5738d6 Compare May 3, 2026 07:17
@sirandreww-starkware sirandreww-starkware force-pushed the 04-26-apollo_l1_gas_price_apollo_l1_gas_price_config_move_exchange_rate_decimals_const_to_config branch from a212b4d to 29bdf7a Compare May 3, 2026 07:17
@sirandreww-starkware sirandreww-starkware force-pushed the 04-20-apollo_consensus_orchestrator_add_snip-35_proposer-validator_symmetry_tests branch from e5738d6 to bf81ef7 Compare May 3, 2026 12:59
@sirandreww-starkware sirandreww-starkware force-pushed the 04-26-apollo_l1_gas_price_apollo_l1_gas_price_config_move_exchange_rate_decimals_const_to_config branch from 29bdf7a to 6afda0a Compare May 3, 2026 12:59
@sirandreww-starkware sirandreww-starkware force-pushed the 04-20-apollo_consensus_orchestrator_add_snip-35_proposer-validator_symmetry_tests branch from bf81ef7 to cc0fccb Compare May 3, 2026 13:11
@sirandreww-starkware sirandreww-starkware force-pushed the 04-26-apollo_l1_gas_price_apollo_l1_gas_price_config_move_exchange_rate_decimals_const_to_config branch 2 times, most recently from 48944e0 to cafe0b9 Compare May 3, 2026 14:34
@sirandreww-starkware sirandreww-starkware force-pushed the 04-20-apollo_consensus_orchestrator_add_snip-35_proposer-validator_symmetry_tests branch from cc0fccb to 085c1f6 Compare May 3, 2026 14:34
@sirandreww-starkware sirandreww-starkware force-pushed the 04-26-apollo_l1_gas_price_apollo_l1_gas_price_config_move_exchange_rate_decimals_const_to_config branch 2 times, most recently from c4353ed to e6ed317 Compare May 4, 2026 11:14
@sirandreww-starkware sirandreww-starkware force-pushed the 04-20-apollo_consensus_orchestrator_add_snip-35_proposer-validator_symmetry_tests branch from 2a30b4a to 8d0d084 Compare May 4, 2026 11:14
@sirandreww-starkware sirandreww-starkware force-pushed the 04-26-apollo_l1_gas_price_apollo_l1_gas_price_config_move_exchange_rate_decimals_const_to_config branch 3 times, most recently from cbc60f5 to cccdd35 Compare May 6, 2026 06:29
@sirandreww-starkware sirandreww-starkware force-pushed the 04-26-apollo_l1_gas_price_apollo_l1_gas_price_config_move_exchange_rate_decimals_const_to_config branch from cccdd35 to 906347d Compare May 6, 2026 10:28
@sirandreww-starkware sirandreww-starkware force-pushed the 04-26-apollo_l1_gas_price_apollo_l1_gas_price_config_move_exchange_rate_decimals_const_to_config branch from 906347d to 88cb588 Compare May 6, 2026 12:00
@sirandreww-starkware sirandreww-starkware force-pushed the 04-20-apollo_consensus_orchestrator_add_snip-35_proposer-validator_symmetry_tests branch from 2a7878e to 38bafeb Compare May 6, 2026 12:00
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