Skip to content

chore(devnet): bump Perp OB routers to 1.1.2#495

Merged
arturbeg merged 11 commits into
mainfrom
agent/devnet-router-1-1-2
Jul 21, 2026
Merged

chore(devnet): bump Perp OB routers to 1.1.2#495
arturbeg merged 11 commits into
mainfrom
agent/devnet-router-1-1-2

Conversation

@arturbeg

@arturbeg arturbeg commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • bump the devnet omnibus from 1.0.9 to 1.0.10
  • bump Core, PassivePerp, OrdersGateway, and Periphery routers to 1.1.2
  • align the perpOB fork harness with the nested SignedOrder fill envelope and opaque metadata bytes from reya-network #698
  • sign the matching-engine Fill digest against both order hashes and the exact metadata
  • align devnet fee checks with fee model V3: taker-only fees, OG/VLTZ taker rebates, deprecated maker-field storage compatibility, deprecated zero-fee flags, and LM post-fill checks
  • serialize the devnet Forge suites to prevent concurrent fork reads from overwhelming the shared local Anvil

This upgrades the devnet OrdersGateway to the ABI used by Reya-Labs/reya-chain#195. The generated batchExecuteFill selector is 0x7e3e0fd1.

Fork-check enrichment

The refreshed suite now proves:

  • metadata mutation invalidates the matching-engine Fill signature
  • the taker pays the configured fee while the maker remains fee-neutral
  • OG and VLTZ rebates reduce the taker's fee multiplicatively
  • legacy marketZeroFees and exchangeZeroFees state cannot bypass fee model V3
  • deprecated maker fee/rebate slots round-trip but do not affect settlement
  • taker fees above 100% are rejected
  • underfunded fills fail the current LM post-fill check on the correct account

Validation

Local:

  • yarn lint:check
  • yarn build
  • forge build
  • direct Cannon devnet test, which first performs the full dry-run upgrade of reya-devnet-omnibus:1.0.10 against the devnet fork
  • serialized fork suite: 43 passed, 0 failed, 0 skipped across 8 suites in 118.68 seconds end-to-end
  • forge inspect IOrdersGatewayProxyV2 methods confirms batchExecuteFill = 0x7e3e0fd1
  • fresh Cannon builds of all four 1.1.2@router packages from reya-network #698 head 1b09e14698f2ab83f2ad9a4dd63d265bf0efde32 on chain ID 13370

The workflow retains its existing warning-only devnet semantics while we agree the required-check policy separately. A clean hosted devnet run also depends on the four exact router packages being published to the Cannon registry; they currently exist only in the local Cannon cache used for this validation.

This PR stays draft until the exact-head GitHub checks are reviewed and the router-package publication prerequisite is resolved.

No package was published and no environment was deployed.

Fork-check follow-ups

This PR covers the immediate router, ABI, signing, and fee-model regressions. Broader checks remain intentionally separate:

  • PRO-637: explicit old-router to new-router state snapshot/survival
  • PRO-656: final Cronos/mainnet migration fork package
  • PRO-403: all-market and collateral oracle freshness
  • PRO-393: one-time funding timestamp initialization

Summary by CodeRabbit

  • New Features

    • Added support for V2 order signing with metadata-bound fill validation.
    • Added configurable taker rebates and global fee parameters.
    • Added market-close execution handling.
  • Bug Fixes

    • Deprecated maker and zero-fee settings are now ignored as intended.
    • Improved validation for mismatched fill metadata.
  • Chores

    • Updated devnet package versions and configuration.
    • Updated test coverage for revised fee and order-processing behavior.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

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: 13d8a87b-6315-4cbb-bd9c-b50acdc9c1ab

📥 Commits

Reviewing files that changed from the base of the PR and between dff71eb and f727e76.

📒 Files selected for processing (10)
  • packages/tests/package.json
  • packages/tests/src/interfaces/IOrdersGatewayProxyV2.sol
  • packages/tests/src/interfaces/IPassivePerpProxyV2.sol
  • packages/tests/src/utils/FillHashingV2.sol
  • packages/tests/test/reya_common/collaterals/WethCollateralPerpOB.fork.c.sol
  • packages/tests/test/reya_common/trade/PermissionsPerpOB.fork.c.sol
  • packages/tests/test/reya_common/trade/PerpFill.fork.c.sol
  • packages/tests/test/reya_common/trade/SpotPerpOB.fork.c.sol
  • packages/tests/test/reya_devnet/trade/PerpFill.fork.t.sol
  • packages/tomls/src/omnibus/reya_devnet.toml

📝 Walkthrough

Walkthrough

Updates V2 fill inputs and EIP-712 hashing to include signed orders and metadata, migrates perp and spot tests, revises fee-model coverage, adds devnet tests, serializes Forge execution, and advances router package versions.

Changes

V2 fill contracts and hashing

Layer / File(s) Summary
V2 contracts and fill hashing
packages/tests/src/interfaces/*, packages/tests/src/utils/FillHashingV2.sol
Adds SignedOrderV2, changes ExecuteFillInputV2 to carry signed orders and metadata, revises passive-perp fee structures, and introduces metadata-aware fill digest hashing.

Perp fill flow and fee validation

Layer / File(s) Summary
Perp fill flow and fee validation
packages/tests/test/reya_common/trade/PerpFill.fork.c.sol
Migrates perp fill helpers and execution paths to V2 signed orders and hashing, adds metadata-binding coverage, and updates fee, rebate, margin, and deprecated-parameter assertions.

Spot, collateral, and permission flow migration

Layer / File(s) Summary
Spot, collateral, and permission flow migration
packages/tests/test/reya_common/{collaterals,trade}/*
Updates collateral, permission, spot, and batch-fill tests to construct V2 signed orders, metadata, and matching-engine payloads.

Devnet coverage and configuration

Layer / File(s) Summary
Devnet coverage and configuration
packages/tests/test/reya_devnet/trade/PerpFill.fork.t.sol, packages/tests/package.json, packages/tomls/src/omnibus/reya_devnet.toml
Adds revised devnet fee and metadata tests, limits Forge execution to one thread, and advances router package versions with a TOML version bump.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PerpFillTest
  participant FillHashingV2
  participant OrdersGateway
  PerpFillTest->>FillHashingV2: hash orders, fill details, deadline, and metadata
  FillHashingV2->>PerpFillTest: return signed matching-engine digest
  PerpFillTest->>OrdersGateway: submit ExecuteFillInputV2
  OrdersGateway->>OrdersGateway: validate metadata-bound signature
Loading

Possibly related issues

  • Reya-Labs/reya-chain#87 — Both changes address V2 fill signing with metadata and deadline-related digest handling.

Possibly related PRs

Suggested reviewers: ioanaroceanu2000, 0xzenus

Poem

A rabbit signed orders beneath moonlit skies,
With metadata tucked where the digest flies.
Taker fees hopped, old maker fields slept,
Forge threads marched in a line well-kept.
New routers bloomed on the devnet trail.

🚥 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 clearly captures the router bump to 1.1.2, which is a central change in the PR.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/devnet-router-1-1-2

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Checkov (3.3.8)
packages/tests/package.json

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'


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

@arturbeg
arturbeg marked this pull request as ready for review July 21, 2026 11:44
@arturbeg
arturbeg merged commit 2b10669 into main Jul 21, 2026
4 checks passed
@arturbeg
arturbeg deleted the agent/devnet-router-1-1-2 branch July 21, 2026 12:52
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.

1 participant