Skip to content

Commit 4cebd06

Browse files
committed
fixed ci fmt and updated readmes
1 parent edfa993 commit 4cebd06

File tree

9 files changed

+276
-117
lines changed

9 files changed

+276
-117
lines changed

.cspell/custom-dictionary.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
# Custom Dictionary Words
22
Aptos
3+
borsh
4+
Borsh
35
CCTP
46
Devnet
57
hashv
68
idls
79
keccak
10+
keypair
11+
keypairs
12+
KEYPAIR
813
Linea
914
Mezo
1015
permissionless

.prettierignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
evm/cache/
22
evm/lib/
33
evm/out/
4+
evm/broadcast/
5+
svm/anchor/target/
6+
svm/node_modules/
7+
svm/modules/*/target/
8+
svm/pinocchio/target/
9+
svm/pinocchio/programs/*/target/
10+
svm/pinocchio/tests/*/target/
11+
svm/target/

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ This will generate:
188188
After building, you can view the API documentation using:
189189

190190
1. **Swagger Editor** (Online)
191-
192191
- Visit https://editor.swagger.io/
193192
- Copy and paste the contents of `tsp-output/schema/openapi.yaml`
194193

cspell.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"version": "0.2",
3-
"ignorePaths": [],
3+
"ignorePaths": ["node_modules/", "svm/node_modules/", "evm/lib/"],
44
"dictionaryDefinitions": [
55
{
66
"name": "custom-dictionary",

design/02_On_Chain_Quotes.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Some would-be Executor integrators may need on-chain quotes as they do not neces
77
## Runtime Support
88

99
- [x] [EVM](./evm/)
10-
- [ ] [SVM](./svm/)
10+
- [x] [SVM](./svm/)
1111

1212
# **Background**
1313

@@ -91,7 +91,6 @@ interface IExecutorQuoter {
9191
```
9292

9393
2. **ExecutorQuoterRouter** replaces **Executor** as the entry-point for integrators. It MUST be immutable and non-administered / fully permissionless. This provides three critical functionalities.
94-
9594
1. `updateQuoterContract(bytes calldata gov)` allows a Quoter to set their `ExecutorQuoter` contract via signed governance (detailed below). This MUST
9695
1. Verify the chain ID matches the Executor’s `ourChain`.
9796
2. Verify the contract address is an EVM address.
@@ -135,11 +134,33 @@ interface IExecutorQuoterRouter {
135134

136135
### SVM
137136

138-
The SVM implementation should follow the requirements above relevant to the SVM Executor implementation.
137+
On SVM, two programs are introduced.
138+
139+
1. **ExecutorQuoter** is a Pinocchio-based program that implements the quoting logic. It exposes two CPI-callable instructions:
140+
- `RequestQuote` (discriminator `[2, 0, 0, 0, 0, 0, 0, 0]`): Returns `(payee_address, required_payment)` via return data.
141+
- `RequestExecutionQuote` (discriminator `[3, 0, 0, 0, 0, 0, 0, 0]`): Returns `(required_payment, payee_address, quote_body)` as 72 bytes via return data.
142+
143+
The quoter reads pricing data from on-chain PDAs (`ChainInfo`, `QuoteBody`) maintained by an authorized updater.
144+
145+
2. **ExecutorQuoterRouter** is the entry-point for integrators. It provides three instructions:
146+
1. `UpdateQuoterContract` registers or updates a quoter's implementation mapping. This MUST:
147+
- Verify the chain ID matches `OUR_CHAIN`.
148+
- Verify the sender matches `universal_sender_address` in the governance message.
149+
- Verify the governance has not expired.
150+
- Verify the secp256k1 signature recovers to the quoter address (20-byte EVM address).
151+
- Create or update a `QuoterRegistration` PDA seeded by `["quoter_registration", quoter_address]`.
152+
153+
2. `QuoteExecution` gets a quote from a registered quoter via CPI. The quoter's return data is forwarded to the caller.
154+
155+
3. `RequestExecution` requests execution through the router. This MUST:
156+
- CPI to the quoter's `RequestExecutionQuote` to get payment/payee/quote body.
157+
- Verify payment amount is sufficient.
158+
- Construct an `EQ02` signed quote on-chain.
159+
- CPI to Executor's `request_for_execution`.
160+
161+
**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.
139162

140-
<aside>
141-
⚠️ TODO: The primary additional consideration is how to handle the accounts used for fetching the quote from an ExecutorQuoter in a standardized way.
142-
</aside>
163+
**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.
143164

144165
### Other
145166

svm/pinocchio/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ These programs use the [Pinocchio](https://github.com/febo/pinocchio) framework,
1111

1212
## Devnet Deployments
1313

14-
| Program | Address |
15-
|---------|---------|
16-
| executor-quoter | `957QU51h6VLbnbAmAPgtXz1kbFE1QhchDmNfgugW9xCc` |
14+
| Program | Address |
15+
| ---------------------- | ---------------------------------------------- |
16+
| executor-quoter | `957QU51h6VLbnbAmAPgtXz1kbFE1QhchDmNfgugW9xCc` |
1717
| executor-quoter-router | `5pkyS8pnbbMforEqAR91gkgPeBs5XKhWpiuuuLdw6hbk` |
1818

1919
## Directory Structure

svm/pinocchio/programs/executor-quoter-router/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,18 @@ The router manages quoter registrations and routes CPI calls to the appropriate
99
## Instructions
1010

1111
**UpdateQuoterContract (discriminator: 0)**
12+
1213
- Registers or updates a quoter's implementation mapping
1314
- Accounts: `[payer, sender, config, quoter_registration, system_program]`
1415

1516
**QuoteExecution (discriminator: 1)**
17+
1618
- Gets a quote from a registered quoter via CPI
1719
- Accounts: `[quoter_registration, quoter_program, config, chain_info, quote_body]`
1820
- CPI to quoter's `RequestQuote` instruction (discriminator: `[2, 0, 0, 0, 0, 0, 0, 0]`)
1921

2022
**RequestExecution (discriminator: 2)**
23+
2124
- Executes cross-chain request through the router
2225
- Accounts: `[payer, config, quoter_registration, quoter_program, executor_program, payee, refund_addr, system_program, quoter_config, chain_info, quote_body, event_cpi]`
2326
- CPI to quoter's `RequestExecutionQuote` instruction (discriminator: `[3, 0, 0, 0, 0, 0, 0, 0]`)
@@ -27,11 +30,13 @@ The router manages quoter registrations and routes CPI calls to the appropriate
2730
Quoter implementations must support the following CPI interface:
2831

2932
### RequestQuote
33+
3034
- Discriminator: 8 bytes (`[2, 0, 0, 0, 0, 0, 0, 0]`)
3135
- Accounts: `[config, chain_info, quote_body]`
3236
- Returns: `u64` (big endian) payment amount via `set_return_data`
3337

3438
### RequestExecutionQuote
39+
3540
- Discriminator: 8 bytes (`[3, 0, 0, 0, 0, 0, 0, 0]`)
3641
- Accounts: `[config, chain_info, quote_body, event_cpi]`
3742
- Returns: 72 bytes via `set_return_data`:

svm/pinocchio/programs/executor-quoter/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ The quoter interface is defined by CPI calls from the `executor-quoter-router` p
99
### Required Instructions
1010

1111
**RequestQuote (discriminator: 2)**
12+
1213
- Returns a quote for cross-chain execution
1314
- Accounts: `[config, chain_info, quote_body]`
1415
- Returns: `u64` payment amount (8 bytes, big-endian)
1516

1617
**RequestExecutionQuote (discriminator: 3)**
18+
1719
- Returns full execution details including payment, payee, and quote body
1820
- Accounts: `[config, chain_info, quote_body, event_cpi]`
1921
- Returns: 72 bytes (`u64` payment + 32-byte payee address + 32-byte quote body)
@@ -23,6 +25,7 @@ Both instructions support up to 8-byte discriminators for Anchor compatibility (
2325
### Instruction Data Layout
2426

2527
Both instructions share the same input format (after discriminator):
28+
2629
- `dst_chain`: u16 (LE)
2730
- `dst_addr`: [u8; 32]
2831
- `refund_addr`: [u8; 32]

0 commit comments

Comments
 (0)