Skip to content

Commit

Permalink
use optimisticCachedRoutes = false to indicate its intent=caching
Browse files Browse the repository at this point in the history
  • Loading branch information
jsy1218 committed Oct 11, 2024
1 parent f197cf4 commit 2069e5c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/routers/alpha-router/alpha-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1667,12 +1667,13 @@ export class AlphaRouter
this.routeCachingProvider &&
routingConfig.writeToCachedRoutes &&
cacheMode !== CacheMode.Darkmode &&
!swapRouteFromCache
!swapRouteFromCache &&
!routingConfig.optimisticCachedRoutes
) {
// we do want to rollout with percent control though
// because we don't know how many cached routes in prod are actually invalid cached routes (that could make swapRouteFromCache null)
// if there are many, then this bug fix might have a chance to slow down routing lambda
// this code path although can only run in the quote=caching (because of routingConfig.writeToCachedRoutes)
// this code path although can only run in the quote=caching (because of routingConfig.optimisticCachedRoutes = false)
// but it will invoke the on-chain-quote provider, which is the most expensive part of the routing lambda network wise
// so the intent=caching lambda execution has some chance to impact intent=quote lambda execution
const swapRouteFromChain = await this.getSwapRouteFromChain(
Expand Down

0 comments on commit 2069e5c

Please sign in to comment.