-
Notifications
You must be signed in to change notification settings - Fork 6
Raindex Router Solving Mode #430
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
base: master
Are you sure you want to change the base?
Changes from all commits
ef55512
cfa5214
bf09579
907d45c
cfecbef
c6aca3d
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 |
|---|---|---|
|
|
@@ -121,6 +121,7 @@ export namespace _v6 { | |
| `(${EvaluableV4} evaluable, ${IOV2}[] validInputs, ${IOV2}[] validOutputs, bytes32 nonce, bytes32 secret, bytes meta)` as const; | ||
| export const ClearConfigV2 = | ||
| "(uint256 aliceInputIOIndex, uint256 aliceOutputIOIndex, uint256 bobInputIOIndex, uint256 bobOutputIOIndex, bytes32 aliceBountyVaultId, bytes32 bobBountyVaultId)" as const; | ||
| export const RouteLeg = `(uint8 routeLegType, address destination, bytes data)[]`; | ||
|
|
||
| // signatures | ||
| export const Orderbook = [ | ||
|
|
@@ -149,7 +150,7 @@ export namespace _v6 { | |
| export const Arb = [ | ||
| "function iRouteProcessor() external view returns (address)", | ||
| `function arb5(address orderBook, ${TakeOrdersConfigV5} calldata takeOrders, ${TaskV2} calldata task) external payable`, | ||
| // `function arb4(address orderBook, ${TakeOrdersConfigV5} calldata startTakeOrders, ${TakeOrdersConfigV5} calldata endTakeOrders, bytes calldata exchangeData, ${TaskV2} calldata task) external payable`, | ||
| `function arb4(address orderBook, ${TakeOrdersConfigV5}[] calldata startTakeOrders, bytes calldata exchangeData, ${TaskV2} calldata task) external payable`, | ||
| ] as const; | ||
|
Comment on lines
150
to
154
Contributor
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Search for all usages of arb4 in the codebase
rg -n --type=ts -C3 '\barb4\b' --max-count=100Repository: rainlanguage/rain.solver Length of output: 8743 🏁 Script executed: #!/bin/bash
# Search for any references to endTakeOrders to ensure it's been removed from all call sites
rg -n 'endTakeOrders' --type=tsRepository: rainlanguage/rain.solver Length of output: 50 🏁 Script executed: #!/bin/bash
# Also check the actual file to confirm the lines mentioned
sed -n '145,160p' src/common/abis/orderbook.tsRepository: rainlanguage/rain.solver Length of output: 1273 🏁 Script executed: #!/bin/bash
# Get full context around arb4 calls in router simulate
sed -n '270,280p' src/core/modes/router/simulate.tsRepository: rainlanguage/rain.solver Length of output: 478 🏁 Script executed: #!/bin/bash
# Get full context around arb4 calls in inter simulate
sed -n '556,566p' src/core/modes/inter/simulate.tsRepository: rainlanguage/rain.solver Length of output: 351 🏁 Script executed: #!/bin/bash
# Verify which ABI versions exist and their arb4 signatures
grep -n "export.*Arb.*=" src/common/abis/orderbook.tsRepository: rainlanguage/rain.solver Length of output: 593 🏁 Script executed: #!/bin/bash
# Get more context around inter/simulate.ts arb4 call to see how args is constructed
sed -n '545,565p' src/core/modes/inter/simulate.tsRepository: rainlanguage/rain.solver Length of output: 788 🏁 Script executed: #!/bin/bash
# Get the full V5 arb4 ABI definition to confirm the signature
sed -n '150,154p' src/common/abis/orderbook.tsRepository: rainlanguage/rain.solver Length of output: 472 🏁 Script executed: #!/bin/bash
# Check router/simulate.ts context for what takeOrdersConfigStruct contains
sed -n '260,282p' src/core/modes/router/simulate.tsRepository: rainlanguage/rain.solver Length of output: 952 Breaking ABI change to This is a significant contract interface change. The new V5 🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
|
|
@@ -257,6 +258,8 @@ export namespace OrderbookAbi { | |
|
|
||
| /** Order v4 (for orderbook v6) struct ABI */ | ||
| export const OrderStructAbi = parseAbiParameters(_v6.OrderV4); | ||
|
|
||
| export const RouteLeg = parseAbiParameters(_v6.RouteLeg); | ||
| } | ||
|
|
||
| /** Orderbook v4 structs */ | ||
|
|
@@ -273,6 +276,7 @@ export namespace OrderbookAbi { | |
| export const TakeOrdersConfig = _v6.TakeOrdersConfigV5; | ||
| export const ClearConfig = _v6.ClearConfigV2; | ||
| export const Quote = _v6.QuoteV2; | ||
| export const RouteLeg = _v6.RouteLeg; | ||
| } | ||
|
|
||
| /** Signature ABI for Orderbook v4 and Arb contracts */ | ||
|
|
||
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.
Missing
as constassertion onRouteLeg.Every other struct definition in
_v6(and_v4/_v5) usesas constto preserve the literal string type, which is required forparseAbiParametersto produce a strongly-typed result. Without it, the type widens tostring, andparseAbiParameters(_v6.RouteLeg)at line 262 will lose type inference.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents