Repository navigation
Conversation
One manager for gasless swaps and limit orders, with tests, deployment, and verification.
The hash commits the whole batch, including each target and value, so ExactCalldata described only part of it.
Remove the id==0 bitmap skip so every FlexibleSettlement id, including 0, burns the IdEnforcer-style bitmap and excludes sibling orders that share it.
Keep order-manager flexible gas measurements comparable to the comparison harness after id 0 started burning the bitmap.
Keep the final, direct-route, and EIP-7710 managers next to the calldata-pinned limit baseline and the gasless exact self-call so later measurements use the same shapes.
Exact gasless batches now sign a timestamp window and a redeemer list alongside the batch hash. The batch stays exact. The window and the redeemer list are configurable per order. - Packed managers (calldata and EIP-7710): the ExactBatch typehash includes validAfter, validUntil, and the redeemers. The exact path checks the redeemer and the window before it executes. - MetaSwapOrderDelegationManager: exact terms carry the same window and redeemer list. - Gas comparisons: measure gasless and limit fills against GaslessExecute and LimitOrderBaseline, cold and later. Drop SwapCalldataPinsInputGas. - Docs: documents/MetaSwapGasComparisons.md and documents/MetaSwapGasComparisonsNoDirectRoute.md.
…outer Replace the vm.store later-fill setup with a real second transaction under forge --isolate. Cold and later fills now use fill numbers as the nonce or id. The swap route is 512 nonzero bytes, and the router and fee wallet start with tokens. The docs are updated to match the new run.
hanzel98
marked this pull request as draft
November 17, 2026 00:15
…arisons Keep the measured tables. Remove the three paragraphs that explain the run conditions, the refund rule, and the isolate flag.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Gasless swaps and limit orders both redeem through
DelegationManagerwith the production caveat set. That path is what this PR is trying to make cheaper. It adds several managers that sign the same permissions in a packed form, and it measures each one against the code that ships today.Versions
FinalManager(MetaSwapManager.sol). Packed layout. Gasless callsredeemExactBatchwith the full batch in calldata. Limit orders send the full approve and swap batch the same way.Eip7710FinalManager(MetaSwapManager.sol). The same packed layout, redeemed throughredeemDelegations. The batch sits inexecutionCallDatas.OrderDelegationManager(MetaSwapOrderDelegationManager.sol). One manager for both flows. Gasless uses anExactBatchintent. Limit orders use flexible settlement terms.FlexibleSettlementEnforcer(MetaSwapFlexibleSettlementEnforcer.sol). Limit orders only. One delegation onDelegationManager. The enforcer checks the whole order.Gas for every version is in MetaSwapGasComparisonsNoDirectRoute.md. That doc also links the production code each baseline was copied from.
Gas:
FinalManagervs baselinesGaslessExecuteLimitOrderBaselineCold is the first fill of that shape, in its own transaction. The nonce or id word is still zero, and the user's output-token balance is still zero. The router already holds the input token, and the fee wallet already holds both tokens. The swap route is 512 nonzero bytes. Later is the second fill, sent as the next transaction, with a new signature. The first fill already wrote those slots, so updating them costs less. The number is the gas the receipt charges, after the refund. The refund cannot exceed one fifth of the gas spent.