Repository navigation
Conversation
0x2me
force-pushed
the
remove-optional-solver-fee
branch
from
October 19, 2026 22:24
a50c6f5 to
22b1596
Compare
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.
Description
Finishes #2507.
Error::ProtocolFeeOnStaticOrderwas already removed in #4832; this is the dependent cleanup the issue asks for:feeonFulfillmentandJitTradeinsolvers-dtobecomes a plainU256instead ofOption<U256>.Same approach as #3822 (approved in principle there), but narrower: the driver
surplus_fee()refactor is left for a follow-up so this stays a small review.Breaking change to the solver API (
crates/solvers/openapi.yml).feeonFulfillmentwas documented as "only gets returned for limit orders" and is now required. A solver response containing a fulfillment withoutfeeis rejected at deserialisation by the driver, including on the quoting path, and the whole response is discarded, not just that trade.JitTradealready listedfeeas required, so this only tightens theFulfillmenthalf. Every in-tree solver always emittedfee, so the exposure is limited to external solver engines that relied on the old wording. If a softer landing is preferred,#[serde(default)]on the two fields delivers the same code cleanup while keeping old payloads working; happy to switch.Changes
solvers-dto:fee: U256onFulfillmentandJitTrade; serde tests for missing and present fee.solvers: drop theSome(..)wrapping in the solution DTO.driver: readfeedirectly instead ofunwrap_or_default(); the test mock solver always emitsfee.e2e: fixtures updated.openapi.yml:feeadded toFulfillment.required, description rewritten and typed asTokenAmount.How to test
cargo nextest run -p solvers-dto(new:fulfillment_requires_fee,fulfillment_fee_round_trips,jit_trade_requires_fee).cargo nextest runandcargo clippy --locked --workspace --all-features --all-targets -- -D warnings: green locally.RUST_MIN_STACK=3145728 cargo nextest run -p driver --test-threads 1 --run-ignored ignored-only: 96/96 locally.cargo check -p e2e --tests), not run locally; please watch CI.Related Issues
Fixes #2507
Supersedes #4964, which the stale bot closed before review and GitHub would not reopen after the rebase. Rebased on current main; one conflict in the driver solution DTO resolved (the
haircut_feeargument was removed upstream).@fleupold @MartinquaXD could one of you take a look and approve the CI run when you get a chance? Happy to switch to
#[serde(default)]if you prefer the softer landing described above.