You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: design/02_On_Chain_Quotes.md
+27-6Lines changed: 27 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Some would-be Executor integrators may need on-chain quotes as they do not neces
7
7
## Runtime Support
8
8
9
9
-[x][EVM](./evm/)
10
-
-[][SVM](./svm/)
10
+
-[x][SVM](./svm/)
11
11
12
12
# **Background**
13
13
@@ -78,7 +78,6 @@ On EVM, two new contracts will be introduced.
78
78
```
79
79
80
80
2.**ExecutorQuoterRouter** replaces **Executor** as the entry-point for integrators. It MUST be immutable and non-administered / fully permissionless. This provides three critical functionalities.
81
-
82
81
1.`updateQuoterContract(bytes calldata gov)` allows a Quoter to set their `ExecutorQuoter` contract via signed governance (detailed below). This MUST
83
82
1. Verify the chain ID matches the Executor’s `ourChain`.
84
83
2. Verify the contract address is an EVM address.
@@ -122,11 +121,33 @@ On EVM, two new contracts will be introduced.
122
121
123
122
### SVM
124
123
125
-
The SVM implementation should follow the requirements above relevant to the SVM Executor implementation.
124
+
On SVM, two programs are introduced.
126
125
127
-
<aside>
128
-
⚠️ TODO: The primary additional consideration is how to handle the accounts used for fetching the quote from an ExecutorQuoter in a standardized way.
129
-
</aside>
126
+
1.**ExecutorQuoter** is a Pinocchio-based program that implements the quoting logic. It exposes two CPI-callable instructions:
-`RequestExecutionQuote` (discriminator `[3, 0, 0, 0, 0, 0, 0, 0]`): Returns `(required_payment, payee_address, quote_body)` as 72 bytes via return data.
129
+
130
+
The quoter reads pricing data from on-chain PDAs (`ChainInfo`, `QuoteBody`) maintained by an authorized updater.
131
+
132
+
2.**ExecutorQuoterRouter** is the entry-point for integrators. It provides three instructions:
133
+
1.`UpdateQuoterContract` registers or updates a quoter's implementation mapping. This MUST:
134
+
- Verify the chain ID matches `OUR_CHAIN`.
135
+
- Verify the sender matches `universal_sender_address` in the governance message.
136
+
- Verify the governance has not expired.
137
+
- Verify the secp256k1 signature recovers to the quoter address (20-byte EVM address).
138
+
- Create or update a `QuoterRegistration` PDA seeded by `["quoter_registration", quoter_address]`.
139
+
140
+
2.`QuoteExecution` gets a quote from a registered quoter via CPI. The quoter's return data is forwarded to the caller.
141
+
142
+
3.`RequestExecution` requests execution through the router. This MUST:
143
+
- CPI to the quoter's `RequestExecutionQuote` to get payment/payee/quote body.
144
+
- Verify payment amount is sufficient.
145
+
- Construct an `EQ02` signed quote on-chain.
146
+
- CPI to Executor's `request_for_execution`.
147
+
148
+
**Account Handling**: The router uses a fixed account layout for quoter CPIs. The quoter accounts (`config`, `chain_info`, `quote_body`) are passed by the client and forwarded to the quoter program. This allows different quoter implementations to use different account structures while maintaining a standardized router interface.
149
+
150
+
**Quoter Identity**: Quoters are identified by their 20-byte EVM address (derived from secp256k1 public key). The `QuoterRegistration` PDA maps this address to a Solana program ID that implements the quoting logic.
0 commit comments