-
Notifications
You must be signed in to change notification settings - Fork 115
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: deterministically fetch perp info from state (backport #2341) #2354
Fix: deterministically fetch perp info from state (backport #2341) #2354
Conversation
(cherry picked from commit cc1b795) # Conflicts: # protocol/testutil/constants/positions.go # protocol/x/subaccounts/keeper/subaccount.go # protocol/x/subaccounts/keeper/subaccount_test.go
Cherry-pick of cc1b795 has failed:
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 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 (
|
Changelist
Problem: The ordering a map iteration in go is not deterministic. If the iteration loop completes, the final result is the same. However, if the loop exits in the middle (ie goes over the gas limit -> abort), then the different sets of perp ids have been iterated on; therefore creates a non-deterministic behavior in terms of gas usage.
Fix: deterministically order the perp ids to iterate over by sorting first.
Test Plan
Unit test
Author/Reviewer Checklist
state-breaking
label.indexer-postgres-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.Summary by CodeRabbit
New Features
Bug Fixes
Tests
GetAllRelevantPerpetuals
method, ensuring reliability under varying conditions.This is an automatic backport of pull request #2341 done by [Mergify](https://mergify.com).