apollo_l1_gas_price_types: currency pair and rate kind - #14979
Open
asaf-sw wants to merge 1 commit into
Open
Conversation
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
asaf-sw
marked this pull request as ready for review
August 18, 2026 00:01
This was referenced Aug 18, 2026
Open
Contributor
Author
|
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.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
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.

Adds the currency-pair vocabulary the Chainlink oracle work is built on, as the leaf of that stack. No behavior change: nothing constructs or reads these types yet, and
config_schema.jsonis untouched.Two artifacts, both
pubinapollo_l1_gas_price_types:CurrencyPair(EthUsd,StrkUsd,EthStrk) names which pair a reading, rate or guard trip belongs to. Without it a stale ETH/USD leg and a stale STRK/USD leg are indistinguishable, since the ETH/STRK rate reads both.EthStrkhas no Chainlink feed on Starknet, so it is derived from the two USD pairs. It carries two accessors with distinct consumers:labels()returns thesnake_casestrum name underLABEL_NAME_CURRENCY_PAIR, read by the per-pair guard counters in the oracle metrics PR.pair_name()returns the display form (ETH/USD) used in guard error messages and as the per-pair key for the rate bounds in the rate-bounds PR.RateKindwith the marker typesEthToFriandStrkToUsdcarries the pair a rate quotes as a type parameter rather than a field, so a client cannot be handed another rate's config and a pair with no impl fails to compile rather than at runtime. The rate arithmetic PR is generic overRateKind; the Chainlink client PR instantiates it per marker.Each artifact carries a
[Temporary comment]naming its consumer, to be dropped as the consumers land.strumwith thederivefeature was already a dependency, soCargo.tomlis unchanged.Tests
New
crates/apollo_l1_gas_price_types/src/test.rs, the crate's first tests:pair_name_is_distinct_per_variant: everypair_namearm is a string literal, so a copy-paste between them compiles and passes every other test in the stack. Distinctness is what catches it.labels_yield_snake_case_variant_name: pins the label values the metrics PR will register permutations against.enum_iter_and_variant_names_cover_all_variants: pins theEnumIterorder and theVariantNameslist, so a new pair added later cannot silently skip a consumer that iterates.rate_kind_markers_map_to_their_pair: pins each marker'sPAIR, since a transposed mapping compiles and passes every other test.Verification
./scripts/rust_fmt.sh: clean.RUSTFLAGS="-D warnings" cargo clippy -p apollo_l1_gas_price_types --all-targets --all-features: clean.SEED=0 cargo nextest run -p apollo_l1_gas_price_types: 4 tests run, 4 passed.