fix(abi): update stale v12.19 ACCOUNTS_RESOLVE_MARKET + ACCOUNTS_CONVERT_RELEASED_PNL specs - #342
Conversation
…ERT_RELEASED_PNL specs
Both account specs still documented their v12.19 4-account layouts
even though their paired encoders were confirmed rewritten for v17:
- ACCOUNTS_RESOLVE_MARKET still listed [admin(s+w), slab(w), clock,
oracle] (src/percolator.rs:9748), but encodeResolveMarket's own doc
says "v17 wire: tag(1) only... BREAKING vs v12.x ... the mode byte
has been REMOVED" — the spec was never updated to match, unlike
every other v17-rewritten spec in this file (each carries an
explicit "v17 wire account layout" comment).
- ACCOUNTS_CONVERT_RELEASED_PNL still listed [user(s+w), slab(w),
clock, oracle] (src/percolator.rs:10636), but
encodeConvertReleasedPnl's own doc says "BREAKING vs v12.x:
userIdx(u16) removed... v17 portfolios are identified by account
key alone" and points directly back to this constant ("Accounts:
see ACCOUNTS_CONVERT_RELEASED_PNL") — but the spec was never
updated to add the account-key-identified portfolio its own paired
encoder's doc describes.
Both fixes are evidence-based inferences, not confirmed v17 wrapper
reads (no percolator-prog source is available in this repo to verify
directly):
- ResolveMarket: every one of the 13 other "v17 wire account layout"
specs in this file drops clock/oracle as standalone accounts with
no exception. The closest structural analog,
ACCOUNTS_RESTART_ASSET_ORACLE — also admin-gated, market-level,
no-token-movement — is exactly [authority(signer), market(w)].
Inferred as [admin(s+w), market(w)].
- ConvertReleasedPnl: owner-initiated, moves no real tokens — the
exact same category as ACCOUNTS_INIT_USER (InitPortfolio) and
ACCOUNTS_CLOSE_ACCOUNT (ClosePortfolio), both confirmed
v17-rewritten to the identical 3-account shape [owner(signer,w),
market(w), portfolio(w)]. Inferred as the same shape.
Both inferences are flagged explicitly in their code comments and
should be verified against an actual v17 handle_resolve_market /
handle_convert_released_pnl decode (devnet dry-run or program source)
before being relied on in production. Leaving the old, definitely-
stale 4-account specs in place was not a safer default — both
encoders no longer emit payloads that match what the v12.19 account
counts were paired with, so the old specs were already known wrong,
just wrong in a less-examined way.
Added regression tests for both asserting no standalone clock/oracle
accounts and the new shapes. Confirmed both fail against the prior
4-account specs and pass against this fix.
Full suite: 853 passed | 31 skipped (882 -> 884, +2 new tests).
|
Warning Review limit reached
More reviews will be available in 37 minutes and 41 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Both account specs still documented their v12.19 4-account layouts even though their paired encoders were confirmed rewritten for v17:
ACCOUNTS_RESOLVE_MARKETstill listed[admin(s+w), slab(w), clock, oracle](src/percolator.rs:9748), butencodeResolveMarket's own doc says "v17 wire: tag(1) only... BREAKING vs v12.x ... the mode byte has been REMOVED" — the spec was never updated to match, unlike every other v17-rewritten spec in this file (each carries an explicit "v17 wire account layout" comment).ACCOUNTS_CONVERT_RELEASED_PNLstill listed[user(s+w), slab(w), clock, oracle](src/percolator.rs:10636), butencodeConvertReleasedPnl's own doc says "BREAKING vs v12.x: userIdx(u16) removed... v17 portfolios are identified by account key alone" and points directly back to this constant ("Accounts: see ACCOUNTS_CONVERT_RELEASED_PNL") — but the spec was never updated to add the account-key-identified portfolio its own paired encoder's doc describes.Fix (with confidence caveat)
Both fixes are evidence-based inferences, not confirmed v17 wrapper reads (no percolator-prog source is available in this repo to verify directly):
ResolveMarket: every one of the 13 other "v17 wire account layout" specs in this file drops clock/oracle as standalone accounts with no exception. The closest structural analog,
ACCOUNTS_RESTART_ASSET_ORACLE— also admin-gated, market-level, no-token-movement — is exactly[authority(signer), market(w)]. Inferred as[admin(s+w), market(w)].ConvertReleasedPnl: owner-initiated, moves no real tokens — the exact same category as
ACCOUNTS_INIT_USER(InitPortfolio) andACCOUNTS_CLOSE_ACCOUNT(ClosePortfolio), both confirmed v17-rewritten to the identical 3-account shape[owner(signer,w), market(w), portfolio(w)]. Inferred as the same shape.Both inferences are flagged explicitly in their code comments and should be verified against an actual v17
handle_resolve_market/handle_convert_released_pnldecode (devnet dry-run or program source) before being relied on in production. Leaving the old, definitely-stale 4-account specs in place was not a safer default — both encoders no longer emit payloads that match what the v12.19 account counts were paired with, so the old specs were already known wrong, just wrong in a less-examined way.Test plan