-
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
Remove uncommitted stateful orders from equity tier check #1569
Conversation
WalkthroughThe changes across the files aim to streamline and simplify the codebase within the Changes
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 (
|
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- protocol/x/clob/keeper/equity_tier_limit.go (3 hunks)
Files skipped from review due to trivial changes (1)
- protocol/x/clob/keeper/equity_tier_limit.go
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- protocol/x/clob/e2e/equity_tier_limit_test.go (1 hunks)
Files skipped from review due to trivial changes (1)
- protocol/x/clob/e2e/equity_tier_limit_test.go
@@ -162,24 +160,6 @@ func (k Keeper) ValidateSubaccountEquityTierLimitForStatefulOrder(ctx sdk.Contex | |||
} | |||
|
|||
equityTierCount := k.GetStatefulOrderCount(ctx, order.OrderId.SubaccountId) | |||
// If this is `CheckTx` then we must also add the number of uncommitted stateful orders that this validator | |||
// is aware of (orders that are part of the mempool but have yet to proposed in a block). | |||
if !lib.IsDeliverTxMode(ctx) { |
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.
just to make sure - we still have the onchain equity tier limit check in deliver tx, right?
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- protocol/x/clob/keeper/orders.go (2 hunks)
- protocol/x/clob/keeper/uncommitted_stateful_order_state.go (2 hunks)
Additional Context Used
Path-based Instructions (2)
protocol/x/clob/keeper/uncommitted_stateful_order_state.go (1)
Pattern
**/**
: Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.protocol/x/clob/keeper/orders.go (1)
Pattern
**/**
: Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.
Additional comments not posted (2)
protocol/x/clob/keeper/uncommitted_stateful_order_state.go (1)
Line range hint
106-106
: LGTM! The functionMustAddUncommittedStatefulOrderCancellation
correctly handles the addition of new order cancellations and decrements the order count.protocol/x/clob/keeper/orders.go (1)
Line range hint
106-106
: LGTM! The functionPerformOrderCancellationStatefulValidation
correctly performs all necessary checks to validate an order cancellation.
ca5acbc
to
24f1e91
Compare
TODO: remove |
further pr will remove write path
Summary by CodeRabbit
Bug Fixes
Tests