Skip to content

docs: add Solver7702Delegate docs#627

Open
igorroncevic wants to merge 5 commits into
mainfrom
feat/solver-7702-delegate
Open

docs: add Solver7702Delegate docs#627
igorroncevic wants to merge 5 commits into
mainfrom
feat/solver-7702-delegate

Conversation

@igorroncevic

@igorroncevic igorroncevic commented May 22, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a solver-facing guide for using Solver7702Delegate to keep the existing solver EOA while using auxiliary EOAs for parallel settlement submission.

Changes

  • Add a new Solver7702Delegate tutorial under solver docs.
  • Document the direct vs delegated transaction shape and packed calldata format.
  • Cover setup, verification, monitoring, caller replacement, revocation, and compromised key handling.
  • Link the guide from solver onboarding and driver submission docs.

Summary by CodeRabbit

  • Documentation
    • Reformatted the “Preprocessing auctions” step list in the solver driver tutorial for clearer metadata fetching and prioritization.
    • Added “Submitting settlements” guidance for parallel settlement submission using Solver7702Delegate.
    • Added a new “Parallel Settlement Submission” tutorial page covering configuration, submission behavior, delegated calldata packing, and verification/operational notes.

@vercel

vercel Bot commented May 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Jun 18, 2026 11:32am

Request Review

@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@igorroncevic, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 42 minutes and 6 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 72999dc4-7cc5-4043-904b-39f1927e1509

📥 Commits

Reviewing files that changed from the base of the PR and between 930e151 and d313bd4.

📒 Files selected for processing (1)
  • docs/cow-protocol/tutorials/solvers/solver-7702-delegate.md
📝 Walkthrough

Walkthrough

Adds a comprehensive Solver7702Delegate tutorial describing parallel settlement submission under ERC-7702 and updates solver onboarding and driver tutorials with cross-references and formatting changes.

Changes

Solver7702Delegate Documentation

Layer / File(s) Summary
Concept and reference driver configuration
docs/cow-protocol/tutorials/solvers/solver-7702-delegate.md
Introduces Solver7702Delegate as a parallel submission mechanism using auxiliary EOAs as nonce lanes while preserving solver EOA visibility; documents reference driver configuration including submission-accounts setup, signer constraints, and startup behaviors.
Submission mechanics, verification, and operational reference
docs/cow-protocol/tutorials/solvers/solver-7702-delegate.md
Explains direct vs delegated submission flow; specifies required delegated calldata packing format using abi.encodePacked(bytes20(target), targetCalldata); describes bytecode verification procedures with cast commands and expected ERC-7702 code shape; references upstream README for manual deployment and operational details.
Cross-references in existing solver documentation
docs/cow-protocol/tutorials/arbitrate/solver/driver.md, docs/cow-protocol/tutorials/solvers/onboard.md
Reformats preprocessing steps in driver tutorial to hyphen-prefixed list items; adds reference to Solver7702Delegate in driver tutorial's settlement section and onboarding guidance mentioning Solver7702Delegate for parallel nonce lanes with preserved solver EOA.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~8 minutes

Poem

I hop and write in tidy pace,
A delegate to speed the race.
Parallel lanes for settlements bright,
Solver7702 leading the night. 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change—adding documentation for Solver7702Delegate—which aligns with the primary objective of the pull request.
Description check ✅ Passed The description includes both required sections (Description and Changes with checkboxes), provides clear context about the purpose, and lists all substantive changes made 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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/solver-7702-delegate

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 and usage tips.

@igorroncevic igorroncevic changed the title docs: add docs docs: add Solver7702Delegate docs May 22, 2026
@igorroncevic igorroncevic marked this pull request as ready for review May 25, 2026 09:11
@igorroncevic igorroncevic requested a review from a team as a code owner May 25, 2026 09:11

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/cow-protocol/tutorials/arbitrate/solver/driver.md`:
- Line 58: Update the wording in the sentence fragment "discarding orders that
can definitely not be settled (e.g. user is missing balances)" to improve flow
by replacing "can definitely not be settled" with "definitely cannot be settled"
or "cannot be settled" (e.g., change to "discarding orders that definitively
cannot be settled (e.g. user is missing balances)" or "discarding orders that
cannot be settled (e.g. user is missing balances)").
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0b6db3ef-bbe4-447c-94a1-6b2c9ddc530b

📥 Commits

Reviewing files that changed from the base of the PR and between 978e255 and b8dcd6e.

📒 Files selected for processing (3)
  • docs/cow-protocol/tutorials/arbitrate/solver/driver.md
  • docs/cow-protocol/tutorials/solvers/onboard.md
  • docs/cow-protocol/tutorials/solvers/solver-7702-delegate.md

Comment thread docs/cow-protocol/tutorials/arbitrate/solver/driver.md Outdated
@igorroncevic igorroncevic self-assigned this May 28, 2026

@kaze-cow kaze-cow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please re-read and re-review before submitting for review again! in general the document is too long and restates things constantly, and loses track of what is important to solvers (the setup)


API specification: <https://github.com/cowprotocol/services/blob/main/crates/solvers/openapi.yml>

Solvers that need parallel settlement submission can use [Solver7702Delegate](./solver-7702-delegate.md) to keep their existing solver EOA while adding extra submission nonce lanes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would almost say that this is storngly recommended, as solvers that don't support parallel submission are likely to run into issues if they ever start processing some real volume. Might as well do the setup right off the bat.

If the settlement does not expose any MEV (e.g. it executes all trades without AMMs) it's safe and most efficient to directly submit to the public mempool.
However, if a settlement exposes MEV the driver would submit to an MEV-protected RPC like [MEVBlocker](https://mevblocker.io).

Solvers that need parallel settlement submission can use [Solver7702Delegate](../../solvers/solver-7702-delegate.md). It keeps the existing solver EOA as the settlement caller while auxiliary EOAs provide additional nonce lanes if the main solver EOA has pending transactions.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment: i would almost say that this is storngly recommended, as solvers that don't support parallel submission are likely to run into issues if they ever start processing some real volume. Might as well do the setup right off the bat.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I wrote should as a way to push solvers to set it up early.

`Solver7702Delegate` keeps the current solver identity. The solver EOA delegates execution to the delegate contract, and a fixed set of auxiliary EOAs can call through it.

```text
auxiliary EOA 1 -> solver EOA running Solver7702Delegate -> GPv2Settlement

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably should also show that the main solver EOA can (and should) still be used for running a solution, but the general concept is good.

Comment on lines +27 to +40
Inside the delegate:

```text
msg.sender = auxiliary EOA
address(this) = solver EOA
```

Inside `GPv2Settlement`:

```text
msg.sender = solver EOA
```

This keeps settlement authorization tied to the solver EOA.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh I found this kind of confusing, and we can probably go without it. or replace with a statement like "Since the Solver EOA effectively proxies the call from the auxillery EOA, it is seen as the solver EOA from the perspective of the settlement contract."


This keeps settlement authorization tied to the solver EOA.

## Call shape

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this section is getting way too detailed and should be left in the https://github.com/cowprotocol/solver-7702-delegate repo

Comment on lines +140 to +146
- deploy the delegate with the expected caller set;
- create the ERC-7702 authorization for the solver EOA;
- submit the authorization transaction;
- sign the authorization for the next nonce if the solver EOA also sends the authorization transaction;
- route delegated settlements with `to = solver EOA`;
- encode delegated calldata as `bytes20(target) || targetCalldata`;
- simulate the exact transaction shape before sending it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repeating!

Comment on lines +206 to +216
## Funding

Auxiliary EOAs pay gas. The delegate does not fund them.

If an auxiliary EOA is underfunded:

- skip it;
- alert the operator;
- use another idle funded account;
- fall back to direct submission if that is safe;
- otherwise wait.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this section actually doing

Comment on lines +218 to +230
## Replacing callers

Approved callers cannot be changed on an existing delegate. To replace any auxiliary EOA:

1. Deploy a new `Solver7702Delegate` with the new caller set.
2. Have the solver EOA sign a new ERC-7702 authorization to the new delegate.
3. Submit the replacement authorization transaction.
4. Verify the solver EOA code is `0xef0100 || newDelegate`.
5. Verify the new delegate runtime bytecode matches the new caller set.
6. Update driver config and monitoring.
7. Treat the old delegate as deprecated.

The old delegate remains on-chain, but it has no power unless the solver EOA delegates to it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section could probably just say "If you need to change any of the authorized auxillery accounts, you will need to redeploy and re-delegate."

Comment on lines +232 to +242
## Revoking delegation

To clear ERC-7702 delegation:

1. Have the solver EOA sign an ERC-7702 authorization to the zero address.
2. Submit a transaction with that authorization.
3. Verify that the solver EOA no longer has delegated code.
4. Disable delegated submission in the driver.
5. Fall back to direct solver EOA submission.

Revocation is useful when auxiliary submission is no longer needed, or when the caller set cannot be safely replaced immediately.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just give the cast command(s)!

Comment on lines +244 to +258
## Compromised auxiliary key response

Treat a compromised auxiliary EOA as severe. An approved auxiliary EOA can trigger arbitrary calls from the solver EOA context until it is removed.

Recommended response:

1. Disable ERC-7702 submission for that solver.
2. Consider disabling the solver while you assess the risk.
3. Deploy a new `Solver7702Delegate` without the compromised caller.
4. Have the solver EOA authorize the new delegate.
5. Verify delegation and delegate bytecode.
6. Move funds and revoke approvals from the solver EOA if needed.
7. Mark the old delegate/config as deprecated in monitoring.

If replacement cannot be done quickly, clear the solver EOA delegation and use direct submission only.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excessive!

- sets up `Solver7702Delegate` during startup when the required signers are available;
- uses the auxiliary accounts as extra settlement nonce lanes, when solver EOA is busy;
- reuses the expected delegate deployment when the same code is already present;
- refuses to start with `max-solutions-to-propose > 1` unless submission accounts are configured.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last bullet point isn't necessary

@kaze-cow kaze-cow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reading it over again, its probably best to link any duplicated content back to the README which is in the delegation repo

sidebar_position: 11
---

# Using Solver7702Delegate for parallel settlement submission

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at how the title actually looks on the wbesite, it should probably be shortened to simply "Parallel Settlement Submission" (the other titles on the site aren't very good either but thats a different issue)

Image

classDef contract fill:#1864ab,stroke:#0b3558,stroke-width:3px,color:#ffffff,font-weight:bold
class SolverEOA,AuxEOAs eoa
class DirectTx,DelegatedTx,TargetCall tx
class DelegatedSolver,Settlement contract

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comments cowprotocol/solver-7702-delegate#5 (comment) and cowprotocol/solver-7702-delegate#5 (comment) . also, when looking at the website this doesn't seem to render.

Comment on lines +91 to +140
## Manual cast commands

Most solvers should use the reference driver setup above. Use these commands only if you are setting up delegation manually and/or building a custom driver.

**To authorize a delegate when the solver EOA sends its own authorization transaction, sign with `--self-broadcast`**:

```shell
cast wallet sign-auth <delegate_address> \
--private-key <solver_private_key> \
--rpc-url <rpc_url> \
--chain <chain_id> \
--self-broadcast

cast send 0x0000000000000000000000000000000000000000 \
--auth <signed_authorization> \
--private-key <solver_private_key> \
--rpc-url <rpc_url> \
--chain <chain_id>
```

**If a different funded account sends either transaction, do not use `--self-broadcast` when signing.** The solver EOA signs the authorization, but the funded account pays gas and submits the transaction:

```shell
cast wallet sign-auth <delegate_or_zero_address> \
--private-key <solver_private_key> \
--rpc-url <rpc_url> \
--chain <chain_id>

cast send 0x0000000000000000000000000000000000000000 \
--auth <signed_authorization> \
--private-key <transaction_sender_private_key> \
--rpc-url <rpc_url> \
--chain <chain_id>
```

To revoke delegation, sign an authorization to the zero address:

```shell
cast wallet sign-auth 0x0000000000000000000000000000000000000000 \
--private-key <solver_private_key> \
--rpc-url <rpc_url> \
--chain <chain_id> \
--self-broadcast

cast send 0x0000000000000000000000000000000000000000 \
--auth <signed_authorization> \
--private-key <solver_private_key> \
--rpc-url <rpc_url> \
--chain <chain_id>
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since these commands appear to basically just be repeats of hwat is on the repo readme, we can link to the Usage section there here I guess.

Comment on lines +142 to +159
## Custom driver requirements

If you do not use the reference driver, your driver must:

- deploy `Solver7702Delegate` for the approved auxiliary caller set;
- have the solver EOA delegate to the deployed `Solver7702Delegate`;
- route delegated settlement transactions with `from = auxiliary EOA` and `to = solver EOA` (if solver EOA is busy);
- encode delegated calldata as `bytes20(target) || targetCalldata`.

## Capabilities and limits

- Version 1 supports up to five immutable approved caller slots.
- Approved auxiliary EOAs are trusted hot keys. They can trigger arbitrary calls as the solver EOA.
- Changing authorized auxiliary accounts requires redeploying the delegate and re-delegating the solver EOA.
- The delegate can call arbitrary targets. The driver should normally use `GPv2Settlement` for settlement submissions.
- Use this only on chains and infrastructure that support ERC-7702 transaction authorization handling.

Keep solver EOA funds and approvals minimal, do not share auxiliary EOAs across solvers, and rotate callers immediately if an auxiliary key is compromised.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all this can probably be removed


## More details

For exact manual deployment, authorization, revocation, bytecode verification, and operational procedures, use the [`Solver7702Delegate` README](https://github.com/cowprotocol/solver-7702-delegate).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

If the settlement does not expose any MEV (e.g. it executes all trades without AMMs) it's safe and most efficient to directly submit to the public mempool.
However, if a settlement exposes MEV the driver would submit to an MEV-protected RPC like [MEVBlocker](https://mevblocker.io).

Solvers that expect real settlement volume should set up [Solver7702Delegate](../../solvers/solver-7702-delegate.md) early. It keeps the existing solver EOA as the settlement caller while auxiliary EOAs provide additional nonce lanes when the solver EOA has pending transactions.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Real settlement volume" sounds a bit vague/weird.

The sentence somehow also feel a bit out of place but i don't have a strong opinion about this.

Note the last sentences of the previous section (L80-83) are also related to the topic so not sure what the best way to structure everything


API specification: <https://github.com/cowprotocol/services/blob/main/crates/solvers/openapi.yml>

Solvers that expect real settlement volume should set up [Solver7702Delegate](./solver-7702-delegate.md) early. It keeps the existing solver EOA while adding extra submission nonce lanes for parallel settlement submission.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't belong here, as solvers that are supposed to just connect their solver engine (and not driver) are usually reading this

@harisang harisang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left some comments

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.

4 participants