Skip to content

Comments

Only check allowance of liquidity sources that are actually used#4190

Merged
MartinquaXD merged 6 commits intomainfrom
only-fetch-allowances-for-used-liquidity
Feb 24, 2026
Merged

Only check allowance of liquidity sources that are actually used#4190
MartinquaXD merged 6 commits intomainfrom
only-fetch-allowances-for-used-liquidity

Conversation

@MartinquaXD
Copy link
Contributor

@MartinquaXD MartinquaXD commented Feb 20, 2026

Description

Currently a lot of CPU time (~3.5%) is spent on fetching allowances for the liquidity sources we index. This is problematic for 2 reasons:

  • most liquidity sources are not used so fetching the settlement contract's allowance is wasted time
  • the driver seems to not use the fetched allowance and fetches them again when encoding the tx (see 1, 2, 3, 4)

Changes

deleted solver::interactions::allowances and it's usages

How to test

e2e tests still work

@MartinquaXD MartinquaXD marked this pull request as ready for review February 20, 2026 20:57
@MartinquaXD MartinquaXD requested a review from a team as a code owner February 20, 2026 20:57
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request removes the pre-fetching of allowances for liquidity sources to improve performance, based on the assumption that these allowances are fetched again later in the transaction encoding process. The implementation correctly removes the solver::interactions::allowances module and its usages across various liquidity source implementations. However, a critical issue has been identified: tests in multiple files have been commented out instead of being updated or removed. This significantly reduces test coverage and confidence in the correctness of the changes. The tests must be restored and adapted to the new logic.

@MartinquaXD MartinquaXD marked this pull request as draft February 20, 2026 21:10
@MartinquaXD MartinquaXD marked this pull request as ready for review February 23, 2026 19:54
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The changes remove allowance fetching logic from the solver, deferring it to the driver. This has been applied consistently across all liquidity sources. No critical issues found.

Copy link
Contributor

@jmg-duarte jmg-duarte left a comment

Choose a reason for hiding this comment

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

🧹

@MartinquaXD MartinquaXD added this pull request to the merge queue Feb 24, 2026
Merged via the queue into main with commit c336771 Feb 24, 2026
19 checks passed
@MartinquaXD MartinquaXD deleted the only-fetch-allowances-for-used-liquidity branch February 24, 2026 16:04
@github-actions github-actions bot locked and limited conversation to collaborators Feb 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants