-
Notifications
You must be signed in to change notification settings - Fork 101
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
Refactor perpetual upgrade handlers in v5.0.0
#1442
Conversation
WalkthroughThe recent update involves enhancing the perpetuals trading protocol by introducing methods to validate and set perpetual positions within the PerpetualsKeeper interface. It also includes setting all perpetuals to a cross-market type, initializing their open interest based on current values, and aggregating data by iterating through subaccounts. Changes
Recent Review DetailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Additional Context UsedPath-based Instructions (1)
Additional comments not posted (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
@@ -238,69 +288,6 @@ func voteExtensionsUpgrade( | |||
) | |||
} | |||
|
|||
// Initialize open interest for perpetuals | |||
func initializePerpOpenInterest( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Combined into perpetaulUpgrade
perpetuals := perpetualsKeeper.GetAllPerpetuals(ctx) | ||
for _, p := range perpetuals { | ||
_, err := perpetualsKeeper.SetPerpetualMarketType( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid two separate calls of SetPerpetualMarketType
here and ModifyOpenInterest
below; just use validateAndSetPerpetual
once.
@@ -1,5 +1,3 @@ | |||
//go:build all || container_test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add this back
@mergify backport release/backport/v5.x |
❌ No backport have been created
GitHub error: |
@mergify backport release/protocol/v5.x |
✅ Backports have been created
|
Changelist
MarketType
andOpenInterest
initialization logic so that each perpetual are only written to state once.OpenInterest
iniitializing logicOpenInterest
pre-upgrade handler since it's expected to beNil
OpenInterest
to zero if market has no OITest Plan
[Describe how this PR was tested (if applicable)]
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