Commit 2a8a70c
apollo_consensus_orchestrator,apollo_consensus_manager: route STRK/USD via L1GasPriceProvider
Goal: PR 5 of 5 in the stack moving the STRK/USD oracle into
L1GasPriceProvider. This is the behavior flip: `compute_snip35_fee_proposal`
now asks the gas-price provider client for the STRK/USD rate instead
of holding its own `ExchangeRateOracleClientTrait` object. With this
in, the orchestrator no longer has direct oracle plumbing — every
external rate goes through the existing `SharedL1GasPriceClient` seam.
Change summary:
- `SequencerConsensusContext::compute_snip35_fee_proposal` calls
`self.deps.l1_gas_price_provider.get_strk_to_usd_rate(timestamp)`.
The previous `Option<Arc<dyn ExchangeRateOracleClientTrait>>` outer
match collapses into a plain `Result` match; the "freeze fee_proposal"
fallback is preserved on `Err` and zero-rate.
- `SequencerConsensusContextDeps::strk_to_usd_oracle` removed.
- `TestDeps::strk_to_usd_oracle` removed and the `From` impl simplified.
- `consensus_manager.rs` drops the now-invalid `strk_to_usd_oracle: None`
field initializer.
- Unused imports cleaned up: `ExchangeRateOracleClientTrait` and
`MockExchangeRateOracleClientTrait` from orchestrator; `debug` from
`tracing` (only used by the dead `None` branch).
- `setup_default_gas_price_provider` registers a catch-all
`expect_get_strk_to_usd_rate` returning `DEFAULT_STRK_TO_USD_RATE`
so existing build_proposal tests keep working without per-test
expectations.
- The two SNIP-35 fee-proposal tests reorder their per-test mock
registration to run BEFORE `setup_default_expectations`, since
mockall matches expectations in oldest-first order — same pattern
the codebase already uses for state_sync_client.expect_get_block.
- `OracleBehavior::NotConfigured` variant removed; the
`no_oracle_freezes_at_fee_actual` test case removed (redundant with
`oracle_err_freezes_at_fee_actual` — both freeze at fee_actual now
that there is no on/off switch).
Decision points:
- Original 6-PR plan included a "cleanup" PR removing the oracle
wiring from `apollo_consensus_manager`. That PR collapsed into this
one because this branch forks from BEFORE the wiring was added, so
the cleanup is one line and shares the same compile-unit constraint.
- The `setup_default_gas_price_provider` catch-all is needed because
every build_proposal test now hits `compute_snip35_fee_proposal`,
which always queries the provider. The alternative (per-test
expectations) would have churned ~9 build_proposal call sites.
- `DEFAULT_STRK_TO_USD_RATE = 3e17` was picked because the SNIP-35
test cases treat it as in-bounds.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 911b2ee commit 2a8a70c
4 files changed
Lines changed: 39 additions & 58 deletions
File tree
- crates
- apollo_consensus_manager/src
- apollo_consensus_orchestrator/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
312 | 311 | | |
313 | 312 | | |
314 | 313 | | |
| |||
Lines changed: 13 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | 274 | | |
279 | 275 | | |
280 | 276 | | |
| |||
457 | 453 | | |
458 | 454 | | |
459 | 455 | | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
473 | 463 | | |
474 | | - | |
475 | | - | |
476 | | - | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
477 | 468 | | |
478 | 469 | | |
479 | 470 | | |
| |||
Lines changed: 19 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 30 | + | |
35 | 31 | | |
36 | 32 | | |
37 | 33 | | |
| |||
1619 | 1615 | | |
1620 | 1616 | | |
1621 | 1617 | | |
1622 | | - | |
1623 | | - | |
1624 | | - | |
| 1618 | + | |
1625 | 1619 | | |
1626 | | - | |
| 1620 | + | |
1627 | 1621 | | |
1628 | 1622 | | |
1629 | 1623 | | |
1630 | 1624 | | |
1631 | 1625 | | |
1632 | 1626 | | |
1633 | 1627 | | |
1634 | | - | |
| 1628 | + | |
1635 | 1629 | | |
1636 | 1630 | | |
1637 | 1631 | | |
1638 | | - | |
1639 | | - | |
1640 | | - | |
1641 | | - | |
1642 | | - | |
1643 | | - | |
1644 | 1632 | | |
1645 | 1633 | | |
1646 | 1634 | | |
| |||
1679 | 1667 | | |
1680 | 1668 | | |
1681 | 1669 | | |
1682 | | - | |
1683 | | - | |
1684 | | - | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
1685 | 1673 | | |
1686 | | - | |
1687 | | - | |
1688 | | - | |
| 1674 | + | |
1689 | 1675 | | |
1690 | 1676 | | |
1691 | | - | |
1692 | | - | |
1693 | | - | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
1694 | 1681 | | |
1695 | | - | |
1696 | 1682 | | |
1697 | | - | |
| 1683 | + | |
| 1684 | + | |
1698 | 1685 | | |
1699 | 1686 | | |
1700 | 1687 | | |
| |||
1713 | 1700 | | |
1714 | 1701 | | |
1715 | 1702 | | |
1716 | | - | |
1717 | | - | |
| 1703 | + | |
| 1704 | + | |
1718 | 1705 | | |
1719 | 1706 | | |
1720 | | - | |
| 1707 | + | |
| 1708 | + | |
1721 | 1709 | | |
1722 | 1710 | | |
1723 | 1711 | | |
1724 | 1712 | | |
1725 | | - | |
| 1713 | + | |
1726 | 1714 | | |
1727 | 1715 | | |
1728 | 1716 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
96 | 100 | | |
97 | 101 | | |
98 | 102 | | |
| |||
129 | 133 | | |
130 | 134 | | |
131 | 135 | | |
132 | | - | |
133 | | - | |
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
| |||
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
148 | | - | |
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
| |||
325 | 326 | | |
326 | 327 | | |
327 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
328 | 332 | | |
329 | 333 | | |
330 | 334 | | |
| |||
381 | 385 | | |
382 | 386 | | |
383 | 387 | | |
384 | | - | |
385 | 388 | | |
386 | 389 | | |
387 | 390 | | |
| |||
0 commit comments