Skip to content

Commit d313bd4

Browse files
committed
simplify
1 parent a3aa8ac commit d313bd4

1 file changed

Lines changed: 25 additions & 98 deletions

File tree

Lines changed: 25 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
11
---
22
sidebar_position: 11
3+
description: Configure Solver7702Delegate and ERC-7702 auxiliary accounts for parallel settlement submission.
4+
keywords:
5+
- Solver7702Delegate
6+
- solver 7702 delegate
7+
- ERC-7702
8+
- EIP-7702
9+
- parallel settlement submission
310
---
411

5-
# Using Solver7702Delegate for parallel settlement submission
12+
# Parallel Settlement Submission
613

7-
`Solver7702Delegate` lets a solver keep its existing allowlisted solver EOA while using auxiliary EOAs as extra submission nonce lanes.
14+
`Solver7702Delegate` lets a solver keep its existing allowlisted EOA and use auxiliary EOAs as additional nonce lanes for settlement submission.
815

9-
This is strongly recommended for solvers that expect real volume. With one EOA, a pending settlement can block every later settlement behind the same nonce lane. With `Solver7702Delegate`, auxiliary EOAs can submit in parallel, while `GPv2Settlement` still sees the solver EOA as `msg.sender`.
16+
Solvers expecting production volume should set this up early. With one EOA, a pending transaction can block every settlement behind it. Auxiliary EOAs can submit in parallel, while `GPv2Settlement` still sees the solver EOA as `msg.sender`.
1017

1118
## Reference driver setup
1219

13-
If you use the reference driver, add `submission-accounts` to the solver entry in your driver config. This is the main setup path for most solvers.
20+
If you use the reference driver, add `submission-accounts` to the solver entry in your driver config. This is all most solvers need to configure.
1421

1522
```toml
1623
[[solver]]
1724
name = "my-solver"
1825
endpoint = "https://solver.example"
1926
account = "<solver-private-key-or-signer-config>"
20-
max-solutions-to-propose = 6 # solver EOA + N auxiliary EOAs
27+
max-solutions-to-propose = 6 # solver EOA + 5 auxiliary EOAs
2128
submission-accounts = [
2229
"<auxiliary-private-key-or-signer-config-1>",
2330
"<auxiliary-private-key-or-signer-config-2>",
@@ -27,28 +34,23 @@ submission-accounts = [
2734
]
2835
```
2936

30-
The solver `account` must be able to sign the ERC-7702 authorization. Each `submission-accounts` entry must also be signer with a private key, not just an address.
37+
The solver `account` must be able to sign the ERC-7702 authorization. Each `submission-accounts` entry must also include signing credentials, not only an address.
3138

32-
Fund each auxiliary EOA with native token for gas, as they will be used to submit transactions separately from the solver EOA.
39+
Fund each auxiliary EOA with the chain's native token so it can pay gas.
3340

34-
When `submission-accounts` is configured, the reference driver:
35-
36-
- sets up `Solver7702Delegate` during startup when the required signers are available;
37-
- uses the auxiliary accounts as extra settlement nonce lanes, when solver EOA is busy;
38-
- reuses the expected delegate deployment when the same code is already present;
39-
- refuses to start with `max-solutions-to-propose > 1` unless submission accounts are configured.
41+
At startup, the reference driver deploys `Solver7702Delegate` at the expected CREATE2 address, or reuses the existing deployment at that address. When the solver EOA is busy, it uses the auxiliary accounts to submit settlements through separate nonce lanes.
4042

4143
## What changes when submitting
4244

43-
Direct submission should still be used when the solver EOA is free. Delegated submission is useful when the solver EOA already has a pending transaction and another settlement should be submitted without waiting for that nonce.
45+
When the solver EOA is free, it submits directly to `GPv2Settlement`. If it already has a pending transaction, an auxiliary EOA can submit to the solver EOA instead. The solver EOA runs `Solver7702Delegate`, which forwards the call to `GPv2Settlement`.
4446

4547
```mermaid
4648
flowchart LR
4749
SolverEOA{"Solver EOA"}
48-
DirectTx["tx.from = solver EOA<br/>tx.to = GPv2Settlement<br/>tx.data = settle(...)"]
50+
DirectTx["tx.data = settle(...)"]
4951
AuxEOAs{"Auxiliary EOAs<br/>0...N"}
50-
DelegatedTx["tx.from = auxiliary EOA<br/>tx.to = solver EOA<br/>tx.data = bytes20(target)<br/>+ targetCalldata"]
51-
DelegatedSolver["Solver EOA running<br/>Solver7702Delegate"]
52+
DelegatedTx["tx.data = bytes20(target)<br/>|| targetCalldata"]
53+
DelegatedSolver["Solver EOA<br/>delegated to Solver7702Delegate"]
5254
TargetCall["target = GPv2Settlement<br/>targetCalldata = settle(...)"]
5355
Settlement["GPv2Settlement"]
5456
@@ -63,101 +65,26 @@ flowchart LR
6365
class DelegatedSolver,Settlement contract
6466
```
6567

66-
Inside the delegate, `msg.sender` is the auxiliary EOA and `address(this)` is the solver EOA. Inside `GPv2Settlement`, `msg.sender` is still the solver EOA.
67-
6868
The calldata format is packed on purpose. Use `abi.encodePacked(bytes20(target), targetCalldata)`. Do not use `abi.encode(target, targetCalldata)`.
6969

7070
## Verification
7171

72-
Before using delegated submission, verify both pieces:
73-
74-
1. The solver EOA delegates to the expected delegate.
75-
2. The delegate bytecode matches the expected approved caller set.
76-
77-
Check the solver EOA code:
72+
First, check that the solver EOA points to the expected delegate:
7873

7974
```shell
8075
cast code <solver_eoa> --rpc-url <rpc_url>
8176
```
8277

83-
For ERC-7702, delegated account code has this shape:
78+
For ERC-7702, the code has this form:
8479

8580
```text
86-
0xef0100 || delegateAddress
87-
```
88-
89-
The delegate bytecode check matters because approved callers are immutable constructor values. Do not only check that the delegate address has code.
90-
91-
## Manual cast commands
92-
93-
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.
94-
95-
**To authorize a delegate when the solver EOA sends its own authorization transaction, sign with `--self-broadcast`**:
96-
97-
```shell
98-
cast wallet sign-auth <delegate_address> \
99-
--private-key <solver_private_key> \
100-
--rpc-url <rpc_url> \
101-
--chain <chain_id> \
102-
--self-broadcast
103-
104-
cast send 0x0000000000000000000000000000000000000000 \
105-
--auth <signed_authorization> \
106-
--private-key <solver_private_key> \
107-
--rpc-url <rpc_url> \
108-
--chain <chain_id>
81+
0xef0100 || delegate_address
10982
```
11083

111-
**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:
112-
113-
```shell
114-
cast wallet sign-auth <delegate_or_zero_address> \
115-
--private-key <solver_private_key> \
116-
--rpc-url <rpc_url> \
117-
--chain <chain_id>
118-
119-
cast send 0x0000000000000000000000000000000000000000 \
120-
--auth <signed_authorization> \
121-
--private-key <transaction_sender_private_key> \
122-
--rpc-url <rpc_url> \
123-
--chain <chain_id>
124-
```
125-
126-
To revoke delegation, sign an authorization to the zero address:
127-
128-
```shell
129-
cast wallet sign-auth 0x0000000000000000000000000000000000000000 \
130-
--private-key <solver_private_key> \
131-
--rpc-url <rpc_url> \
132-
--chain <chain_id> \
133-
--self-broadcast
134-
135-
cast send 0x0000000000000000000000000000000000000000 \
136-
--auth <signed_authorization> \
137-
--private-key <solver_private_key> \
138-
--rpc-url <rpc_url> \
139-
--chain <chain_id>
140-
```
141-
142-
## Custom driver requirements
143-
144-
If you do not use the reference driver, your driver must:
145-
146-
- deploy `Solver7702Delegate` for the approved auxiliary caller set;
147-
- have the solver EOA delegate to the deployed `Solver7702Delegate`;
148-
- route delegated settlement transactions with `from = auxiliary EOA` and `to = solver EOA` (if solver EOA is busy);
149-
- encode delegated calldata as `bytes20(target) || targetCalldata`.
150-
151-
## Capabilities and limits
152-
153-
- Version 1 supports up to five immutable approved caller slots.
154-
- Approved auxiliary EOAs are trusted hot keys. They can trigger arbitrary calls as the solver EOA.
155-
- Changing authorized auxiliary accounts requires redeploying the delegate and re-delegating the solver EOA.
156-
- The delegate can call arbitrary targets. The driver should normally use `GPv2Settlement` for settlement submissions.
157-
- Use this only on chains and infrastructure that support ERC-7702 transaction authorization handling.
84+
On a block explorer, the solver EOA may not have a normal contract code view. Confirm that its **Delegated to** banner points to the expected address, then open that address and verify its source as `Solver7702Delegate`.
15885

159-
Keep solver EOA funds and approvals minimal, do not share auxiliary EOAs across solvers, and rotate callers immediately if an auxiliary key is compromised.
86+
See the README's [verification steps](https://github.com/cowprotocol/solver-7702-delegate#verify-delegation) for details.
16087

16188
## More details
16289

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

0 commit comments

Comments
 (0)