Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump sor to 4.7.5 - fix: cached routes cache invalidation #747

Merged
merged 12 commits into from
Oct 28, 2024

Conversation

jsy1218
Copy link
Member

@jsy1218 jsy1218 commented Oct 11, 2024

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    Bug fix

  • What is the current behavior? (You can also link to an open issue here)
    if the cached routes is invalid, meaning it cant get any swap route at all, it does not get cache invalidated.

  • What is the new behavior (if this is a feature change)?
    we will invalidate the cached routes by checking to see if the swap route from cache is invalid

  • Other information:
    we have to roll out with percentage. because there's a chance there are many invalid cached routes in prod.

This is somewhat critical to fix prior to V4, because there's a chance that routing caches invalid v4-pool routes. Previously this wasn't much of a concern,. since V3 launched in 2021, and cached routes was rolled out in 2023, so the v2 and v3 pool TVLs won't change that much, although concentrated liquidities can change based on the market pricing.

I expect with v4, there will be more dynamics from 0 TVL to some TVLs, hence cached routes have more chance of caching invalid v4-pool routes.

@jsy1218
Copy link
Member Author

jsy1218 commented Oct 11, 2024

i will add a test in alpha-router.integ-test. i have an idea how to repro this within SOR. this kind of test setup is first time, so it may take a bit of time.

UPDATE - DONE!

src/routers/alpha-router/alpha-router.ts Outdated Show resolved Hide resolved
src/routers/alpha-router/alpha-router.ts Outdated Show resolved Hide resolved
src/routers/alpha-router/alpha-router.ts Outdated Show resolved Hide resolved
src/routers/alpha-router/alpha-router.ts Show resolved Hide resolved
@jsy1218 jsy1218 force-pushed the siyujiang/mixed-quoter-expanding-to-more-chains branch from e72f865 to ad517b2 Compare October 15, 2024 20:01
@jsy1218 jsy1218 force-pushed the siyujiang/fix-cached-routes-cached-invalidation branch from 2f638a7 to fb994e9 Compare October 15, 2024 20:01
Base automatically changed from siyujiang/mixed-quoter-expanding-to-more-chains to main October 15, 2024 20:18
@jsy1218 jsy1218 force-pushed the siyujiang/fix-cached-routes-cached-invalidation branch from fb994e9 to e093753 Compare October 17, 2024 22:32
@graphite-app graphite-app bot requested review from cgkol and a team October 17, 2024 22:34
@graphite-app graphite-app bot requested a review from xrsv October 17, 2024 22:34
Copy link

graphite-app bot commented Oct 17, 2024

Graphite Automations

"Request reviewers once CI passes on smart-order-router repo" took an action on this PR • (10/17/24)

4 reviewers were added and 1 assignee was added to this PR based on 's automation.

@jsy1218 jsy1218 changed the title chore: bump sor to 4.7.1 - fix: cached routes cache invalidation chore: bump sor to 4.7.3 - fix: cached routes cache invalidation Oct 17, 2024
Copy link
Contributor

@xrsv xrsv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks - left few comments

src/routers/alpha-router/alpha-router.ts Outdated Show resolved Hide resolved
src/routers/alpha-router/alpha-router.ts Show resolved Hide resolved
src/routers/alpha-router/alpha-router.ts Show resolved Hide resolved
src/routers/alpha-router/alpha-router.ts Outdated Show resolved Hide resolved
src/routers/alpha-router/alpha-router.ts Outdated Show resolved Hide resolved
@jsy1218 jsy1218 force-pushed the siyujiang/fix-cached-routes-cached-invalidation branch from 5236650 to fb474ba Compare October 23, 2024 14:47
@jsy1218 jsy1218 requested review from cgkol and xrsv October 23, 2024 14:47
Copy link
Contributor

@xrsv xrsv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approach looks reasonable.
Left a couple of comments

src/routers/alpha-router/alpha-router.ts Show resolved Hide resolved
src/routers/alpha-router/alpha-router.ts Show resolved Hide resolved
@jsy1218 jsy1218 changed the title chore: bump sor to 4.7.3 - fix: cached routes cache invalidation chore: bump sor to 4.7.5 - fix: cached routes cache invalidation Oct 28, 2024
Copy link
Contributor

@cgkol cgkol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

jsy1218 commented Oct 28, 2024

Merge activity

  • Oct 28, 5:01 PM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Oct 28, 5:02 PM EDT: A user merged this pull request with Graphite.

@jsy1218 jsy1218 merged commit 4067969 into main Oct 28, 2024
28 of 29 checks passed
@jsy1218 jsy1218 deleted the siyujiang/fix-cached-routes-cached-invalidation branch October 28, 2024 21:02
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