apollo_l1_gas_price: hold strk_to_usd oracle client + strk_to_usd_rate#14158
Conversation
PR SummaryLow Risk Overview
Nothing in this diff calls Reviewed by Cursor Bugbot for commit dc3f241. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2819fb7. Configure here.
f4acf9f to
e33b1ff
Compare
2819fb7 to
1d61ff5
Compare
e33b1ff to
b274ca6
Compare
1d61ff5 to
574ee1b
Compare
b274ca6 to
d6dfb69
Compare
5fa5e1a to
486319b
Compare
1afda6d to
bb29293
Compare
25184de to
febf852
Compare
matanl-starkware
left a comment
There was a problem hiding this comment.
@matanl-starkware reviewed 2 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on ShahakShama).
febf852 to
cc63bfd
Compare
0c03914 to
74a40a0
Compare
cc63bfd to
d745a8f
Compare
d745a8f to
c997caa
Compare
matanl-starkware
left a comment
There was a problem hiding this comment.
@matanl-starkware reviewed 1 file and all commit messages, and resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on ShahakShama).
sirandreww-starkware
left a comment
There was a problem hiding this comment.
@sirandreww-starkware made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on ShahakShama).
c997caa to
bcabd9a
Compare
2a6a5dd to
fc131d4
Compare
bcabd9a to
5950d44
Compare
5950d44 to
19792bb
Compare
Merge activity
|
Goal: PR 2 of 6 in the stack moving the STRK/USD oracle from the ad-hoc wiring in SequencerConsensusContext into L1GasPriceProvider. This commit adds the field and inherent method on the provider but nothing calls it yet — the seam is established without behavior change. Change summary: - `L1GasPriceProvider` gains a second `Arc<dyn ExchangeRateOracleClientTrait>` field (`strk_to_usd_oracle_client`), positionally after the existing `eth_to_strk_oracle_client`. - `new` takes a second oracle client parameter. - `new_with_oracle` reads `config.strk_to_usd_oracle_config` (added in the previous commit on this stack) and constructs the client. - New inherent method `strk_to_usd_rate(timestamp)` mirrors the existing `eth_to_fri_rate`. - Unit tests in `l1_gas_price_provider_test.rs` updated to pass a second mock to the constructor. Decision points: - Positional constructor argument over a builder. The struct has two oracle clients now; if a third lands later, builder pattern is the right move. For two, positional is fine. - Same `ExchangeRateOracleClientError` propagation via the existing `L1GasPriceProviderError::ExchangeRateOracleClientError` variant. No new error variant needed — the two oracles are semantically identical, only differ by URL. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
19792bb to
dc3f241
Compare


Goal: PR 2 of 6 in the stack moving the STRK/USD oracle from the
ad-hoc wiring in SequencerConsensusContext into L1GasPriceProvider.
This commit adds the field and inherent method on the provider but
nothing calls it yet — the seam is established without behavior
change.
Change summary:
L1GasPriceProvidergains a secondArc<dyn ExchangeRateOracleClientTrait>field (
strk_to_usd_oracle_client), positionally after the existingeth_to_strk_oracle_client.newtakes a second oracle client parameter.new_with_oraclereadsconfig.strk_to_usd_oracle_config(added inthe previous commit on this stack) and constructs the client.
strk_to_usd_rate(timestamp)mirrors theexisting
eth_to_fri_rate.l1_gas_price_provider_test.rsupdated to pass asecond mock to the constructor.
Decision points:
oracle clients now; if a third lands later, builder pattern is the
right move. For two, positional is fine.
ExchangeRateOracleClientErrorpropagation via the existingL1GasPriceProviderError::ExchangeRateOracleClientErrorvariant.No new error variant needed — the two oracles are semantically
identical, only differ by URL.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com