-
Notifications
You must be signed in to change notification settings - Fork 3
sync(engine): Wave 1 — port deferred items (ENG-PORT-A/B/C) for full wrapper sync #91
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
Changes from all commits
b731cff
d0f2779
c9c7070
49b8982
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -125,6 +125,17 @@ pub fn zero_fee_params() -> RiskParams { | |||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| /// Test helper: shrink the account tier of `zero_fee_params` for Kani proofs | ||||||||||||||||||||||||||||||||
| /// that need to model a small market. Mirrors toly's helper of the same name | ||||||||||||||||||||||||||||||||
| /// (Wave 1 ENG-PORT-A harness needs `small_zero_fee_params(4)` to bound the | ||||||||||||||||||||||||||||||||
| /// state space without changing solvency-envelope calibration). | ||||||||||||||||||||||||||||||||
| pub fn small_zero_fee_params(max_accounts: u64) -> RiskParams { | ||||||||||||||||||||||||||||||||
| let mut params = zero_fee_params(); | ||||||||||||||||||||||||||||||||
| params.max_accounts = max_accounts; | ||||||||||||||||||||||||||||||||
| params.max_active_positions_per_side = max_accounts; | ||||||||||||||||||||||||||||||||
| params | ||||||||||||||||||||||||||||||||
|
Comment on lines
+132
to
+136
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Enforce
Suggested fix pub fn small_zero_fee_params(max_accounts: u64) -> RiskParams {
+ assert!(
+ (max_accounts as usize) <= MAX_ACCOUNTS,
+ "small_zero_fee_params expects max_accounts <= MAX_ACCOUNTS"
+ );
let mut params = zero_fee_params();
params.max_accounts = max_accounts;
params.max_active_positions_per_side = max_accounts;
params
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| /// Test helper: materialize a user account via deposit_not_atomic (spec §10.2). | ||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||
| /// v12.18.1 removed add_user / add_lp / materialize_with_fee. The sole | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
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.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
Append new
#[repr(C)]fields at the end ofRiskEngine.Because
RiskEngineis layout-sensitive, insertingoracle_target_price_e6andoracle_target_publish_timehere shifts the offset of every trailing persisted field. That makes the schema blast radius much larger than necessary for wrappers and mirror structs. Moving these two fields to the tail would keep this as a suffix extension instead of a full offset migration.🤖 Prompt for AI Agents