-
Notifications
You must be signed in to change notification settings - Fork 634
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
fix(poolmanager): only write to cache in finalize execution mode #9332
Conversation
Prevents the cache from being written to during other execution modes like CheckTx, which can lead to inconsistent state during transaction processing. The cache should only be populated during the final execution phase.
WalkthroughThe pull request introduces changes to the pool manager's logic, focusing on cache management and testing. It updates the Changes
Sequence Diagram(s)sequenceDiagram
participant Caller as Client
participant PM as GetPoolModule
participant Cache as CacheSystem
Caller->>PM: Call GetPoolModule(context)
activate PM
PM->>PM: Check if execution mode is sdk.ExecModeFinalize
alt Execution mode is finalize
PM->>Cache: Write poolModuleCacheValue to cache
else Not finalize
PM-->>Caller: Skip cache write
end
deactivate PM
PM-->>Caller: Return pool module
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (6)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
- Add getPoolRouteRaw helper to directly get pool route from storage - Modify GetPoolType to not rely on the cache via GetPoolModule - Update tests to verify behavior in both Check and Finalize execution modes - Fix test setup to ensure consistent state across execution modes
* fix(poolmanager): only write to cache in finalize execution mode Prevents the cache from being written to during other execution modes like CheckTx, which can lead to inconsistent state during transaction processing. The cache should only be populated during the final execution phase. * docs: add changelog entry for PR #9332 * fix(poolmanager): refactor GetPoolType to directly use state storage - Add getPoolRouteRaw helper to directly get pool route from storage - Modify GetPoolType to not rely on the cache via GetPoolModule - Update tests to verify behavior in both Check and Finalize execution modes - Fix test setup to ensure consistent state across execution modes --------- Co-authored-by: ghost <paddymchale@hotmail.com> (cherry picked from commit 140a57d)
* fix(poolmanager): only write to cache in finalize execution mode Prevents the cache from being written to during other execution modes like CheckTx, which can lead to inconsistent state during transaction processing. The cache should only be populated during the final execution phase. * docs: add changelog entry for PR #9332 * fix(poolmanager): refactor GetPoolType to directly use state storage - Add getPoolRouteRaw helper to directly get pool route from storage - Modify GetPoolType to not rely on the cache via GetPoolModule - Update tests to verify behavior in both Check and Finalize execution modes - Fix test setup to ensure consistent state across execution modes --------- Co-authored-by: ghost <paddymchale@hotmail.com> (cherry picked from commit 140a57d)
…) (#9337) * fix(poolmanager): only write to cache in finalize execution mode Prevents the cache from being written to during other execution modes like CheckTx, which can lead to inconsistent state during transaction processing. The cache should only be populated during the final execution phase. * docs: add changelog entry for PR #9332 * fix(poolmanager): refactor GetPoolType to directly use state storage - Add getPoolRouteRaw helper to directly get pool route from storage - Modify GetPoolType to not rely on the cache via GetPoolModule - Update tests to verify behavior in both Check and Finalize execution modes - Fix test setup to ensure consistent state across execution modes --------- Co-authored-by: ghost <paddymchale@hotmail.com> (cherry picked from commit 140a57d) Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
…) (#9338) * fix(poolmanager): only write to cache in finalize execution mode Prevents the cache from being written to during other execution modes like CheckTx, which can lead to inconsistent state during transaction processing. The cache should only be populated during the final execution phase. * docs: add changelog entry for PR #9332 * fix(poolmanager): refactor GetPoolType to directly use state storage - Add getPoolRouteRaw helper to directly get pool route from storage - Modify GetPoolType to not rely on the cache via GetPoolModule - Update tests to verify behavior in both Check and Finalize execution modes - Fix test setup to ensure consistent state across execution modes --------- Co-authored-by: ghost <paddymchale@hotmail.com> (cherry picked from commit 140a57d) Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
Prevents the cache from being written to during other execution modes like CheckTx, which can lead to inconsistent state during transaction processing. The cache should only be populated during the final execution phase.