Remove tick validation in collect processing for pool profiler #3010
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.
Pull Request
This change aligns
PoolProfiler::process_collectwith Uniswap V3's actual behavior by removing tick validation for collect events.Problem
The profiler was validating ticks in
process_collect, causing it to fail on legitimate on-chain collect events with invalid or edge-case tick values (e.g.,tick_lower == tick_upper). This validation doesn't exist in Uniswap V3's collect functionbecause invalid positions never accumulate fees to collect.
Example transaction that caused the error:
https://arbiscan.io/tx/0x9d8d8511ea136be6758bf7cdfb71e18297ebfc54273552c7c4ddf2c8e40387e2#eventlog#31
Error logs:
Solution
validate_ticks()call fromprocess_collectOk(())when position doesn't exist (instead of throwing error)Why This Is Correct
In Uniswap V3, the
collectfunction doesn't validate tick ranges because:This change makes the profiler more resilient when processing real-world blockchain data that may contain edge cases.
Type of change
Testing
Ensure new or changed logic is covered by tests.