Skip to content

fix Alice/bob signed context for clear3()#458

Open
rouzwelt wants to merge 1 commit into
masterfrom
2026-07-07-fix-clear-signed-context
Open

fix Alice/bob signed context for clear3()#458
rouzwelt wants to merge 1 commit into
masterfrom
2026-07-07-fix-clear-signed-context

Conversation

@rouzwelt

@rouzwelt rouzwelt commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Solution

Checks

By submitting this for review, I'm confirming I've done the following:

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

Summary by CodeRabbit

  • Bug Fixes
    • Corrected the order of signed order data used during orderbook simulation, so “clear” calls now match the expected input format.
    • Updated test expectations to reflect the corrected argument order.

@rouzwelt rouzwelt self-assigned this Jul 7, 2026
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 974e7d1a-83ba-4dc2-b80e-449dcb2032d5

📥 Commits

Reviewing files that changed from the base of the PR and between 62c725d and aab2336.

📒 Files selected for processing (2)
  • src/core/modes/intra/simulation.test.ts
  • src/core/modes/intra/simulation.ts

Walkthrough

Reorders the signedContext arguments passed into clear calldata construction for both V6 and V5 order flows in IntraOrderbookTradeSimulator, so the counterparty's signedContext is now supplied before the order's own signedContext. The corresponding test expectation is updated to match.

Changes

SignedContext Ordering Fix

Layer / File(s) Summary
Reorder signedContext in clear calldata
src/core/modes/intra/simulation.ts
In both getCalldataForV4OrderV6 and getCalldataForV4Order, the signedContext arguments in the clear3 parameters are swapped so the counterparty's signedContext is passed first, followed by the order's own signedContext.
Update test expectations
src/core/modes/intra/simulation.test.ts
Updates the expected clear3 call arguments in the getCalldataForV4Order test to reflect the new signedContext ordering.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: hardyjosh

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: fixing the Alice/Bob signed context ordering for clear3().
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-07-07-fix-clear-signed-context

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.

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