Skip to content

fix: use withdraw4 for Orderbook V6 in intra-orderbook calldata#437

Merged
rouzwelt merged 3 commits into
masterfrom
2026-03-27-v6-calldata-fix
Jun 15, 2026
Merged

fix: use withdraw4 for Orderbook V6 in intra-orderbook calldata#437
rouzwelt merged 3 commits into
masterfrom
2026-03-27-v6-calldata-fix

Conversation

@Siddharth2207

@Siddharth2207 Siddharth2207 commented Mar 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • getCalldata was routing all V4 orders to getCalldataForV4Order, which hardcodes withdraw3 (Orderbook V5)
  • Orderbook V6 replaced withdraw3 with withdraw4, causing a revert in the multicall
  • Added getCalldataForV4OrderV6 using ABI.Orderbook.V6.Primary.Orderbook with withdraw4 and clear3
  • Updated dispatch to check Pair.isV4OrderbookV6 before falling through to the V5 path
  • Bumped lib/sushiswap submodule to 1b2b675 (add cbBTC to Base routing bases sushiswap#44) — adds cbBTC to Base routing bases so tokens only paired with cbBTC on Hydrex (e.g. wtMSTR) can be priced in ETH terms

The getCalldata dispatch was falling through to getCalldataForV4Order
for all V4 orders, which hardcodes withdraw3 (V5). V6 replaced withdraw3
with withdraw4, causing a revert. Added getCalldataForV4OrderV6 using
the V6 ABI and updated the dispatch to route V6 pairs correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@rouzwelt, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 34 minutes and 15 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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 44c0517c-6929-4962-af81-2775d46e424a

📥 Commits

Reviewing files that changed from the base of the PR and between 9a50606 and 16b4dd9.

📒 Files selected for processing (2)
  • lib/sushiswap
  • src/core/modes/intra/simulation.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-03-27-v6-calldata-fix

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Picks up rainlanguage/sushiswap#44 so wtMSTR (and other tokens only
paired with cbBTC on Hydrex) can be priced in ETH terms by the solver.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Siddharth2207 Siddharth2207 requested a review from hardyjosh April 2, 2026 16:45
@rouzwelt rouzwelt changed the base branch from 2026-02-12-sushi-price-impact to master June 15, 2026 16:21
@rouzwelt rouzwelt merged commit b586282 into master Jun 15, 2026
3 of 12 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai assess this PR size classification for the totality of the PR with the following criterias and report it in your comment:

S/M/L PR Classification Guidelines:

This guide helps classify merged pull requests by effort and complexity rather than just line count. The goal is to assess the difficulty and scope of changes after they have been completed.

Small (S)

Characteristics:

  • Simple bug fixes, typos, or minor refactoring
  • Single-purpose changes affecting 1-2 files
  • Documentation updates
  • Configuration tweaks
  • Changes that require minimal context to review

Review Effort: Would have taken 5-10 minutes

Examples:

  • Fix typo in variable name
  • Update README with new instructions
  • Adjust configuration values
  • Simple one-line bug fixes
  • Import statement cleanup

Medium (M)

Characteristics:

  • Feature additions or enhancements
  • Refactoring that touches multiple files but maintains existing behavior
  • Breaking changes with backward compatibility
  • Changes requiring some domain knowledge to review

Review Effort: Would have taken 15-30 minutes

Examples:

  • Add new feature or component
  • Refactor common utility functions
  • Update dependencies with minor breaking changes
  • Add new component with tests
  • Performance optimizations
  • More complex bug fixes

Large (L)

Characteristics:

  • Major feature implementations
  • Breaking changes or API redesigns
  • Complex refactoring across multiple modules
  • New architectural patterns or significant design changes
  • Changes requiring deep context and multiple review rounds

Review Effort: Would have taken 45+ minutes

Examples:

  • Complete new feature with frontend/backend changes
  • Protocol upgrades or breaking changes
  • Major architectural refactoring
  • Framework or technology upgrades

Additional Factors to Consider

When deciding between sizes, also consider:

  • Test coverage impact: More comprehensive test changes lean toward larger classification
  • Risk level: Changes to critical systems bump up a size category
  • Team familiarity: Novel patterns or technologies increase complexity

Notes:

  • the assessment must be for the totality of the PR, that means comparing the base branch to the last commit of the PR
  • the assessment output must be exactly one of: S, M or L (single-line comment) in format of: SIZE={S/M/L}
  • do not include any additional text, only the size classification
  • your assessment comment must not include tips or additional sections
  • do NOT tag me or anyone else on your comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants