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: svm/pinocchio/README.md
+20-9Lines changed: 20 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,33 @@
1
1
# Pinocchio Programs
2
2
3
-
This directory contains Solana programs built with the Pinocchio framework for the executor quoter system.
3
+
Solana programs for the executor quoter system.
4
+
5
+
## Overview
6
+
7
+
-**executor-quoter-router** - Defines the quoter interface specification and routes CPI calls to registered quoter implementations. See [programs/executor-quoter-router/README.md](programs/executor-quoter-router/README.md).
8
+
-**executor-quoter** - Example quoter implementation. Integrators can use this as a reference or build their own. See [programs/executor-quoter/README.md](programs/executor-quoter/README.md).
9
+
10
+
These programs use the [Pinocchio](https://github.com/febo/pinocchio) framework, but quoter implementations are framework-agnostic. Any program adhering to the CPI interface defined by the router will work.
4
11
5
12
## Directory Structure
6
13
7
-
-`programs/executor-quoter/` - Quoter program for price quotes
8
-
-`programs/executor-quoter-router/` - Router program for quoter registration and execution routing
14
+
-`programs/executor-quoter/` - Example quoter implementation
15
+
-`programs/executor-quoter-router/` - Router program defining the quoter spec
9
16
-`tests/executor-quoter-tests/` - Integration tests and benchmarks for executor-quoter
10
17
-`tests/executor-quoter-router-tests/` - Integration tests and benchmarks for executor-quoter-router
11
18
12
19
## Prerequisites
13
20
14
21
- Solana CLI v1.18.17 or later
15
-
- A keypair file for the quoter updater address
16
22
17
-
Generate a test keypair if you don't have one:
23
+
### Testing Prerequisites
24
+
25
+
Generate test keypairs before building or running tests:
18
26
19
27
```bash
20
28
mkdir -p ../test-keys
21
29
solana-keygen new --no-bip39-passphrase -o ../test-keys/quoter-updater.json
30
+
solana-keygen new --no-bip39-passphrase -o ../test-keys/quoter-payee.json
# Run integration tests (uses mollusk-svm to simulate program execution)
76
-
cargo test -p executor-quoter-tests -p executor-quoter-router-tests
84
+
# Run integration tests (uses solana-program-test to simulate program execution)
85
+
cargo test -p executor-quoter-tests -p executor-quoter-router-tests -- --test-threads=1
77
86
```
78
87
79
-
Note: These tests use native `cargo test`, not `cargo test-sbf`. The unit tests are pure Rust without SBF dependencies. The integration tests use mollusk-svm which loads the pre-built `.so` files and simulates program execution natively.
88
+
Note: These tests use native `cargo test`, not `cargo test-sbf`. The unit tests are pure Rust without SBF dependencies. The integration tests use solana-program-test which loads the pre-built `.so` files and simulates program execution natively.
89
+
90
+
The `--test-threads=1` flag is required because `solana-program-test` can exhibit race conditions when multiple tests load BPF programs in parallel. Running tests sequentially avoids these issues.
- The test crates use `solana-program-test`and [mollusk-svm](https://github.com/buffalojoec/mollusk)to load and execute the compiled `.so` files in a simulated SVM environment.
106
+
- The test crates use `solana-program-test` to load and execute the compiled `.so` files in a simulated SVM environment. Benchmarks use [mollusk-svm](https://github.com/buffalojoec/mollusk) for compute unit measurements.
96
107
- Tests will fail if the `.so` files are not built first.
97
108
- The `QUOTER_UPDATER_PUBKEY` is baked into the program at compile time and cannot be changed without rebuilding.
Router program that dispatches quote requests and execution requests to registered quoter implementations.
4
+
5
+
## Overview
6
+
7
+
The router manages quoter registrations and routes CPI calls to the appropriate quoter program. It defines the interface that quoter implementations must adhere to.
8
+
9
+
## Instructions
10
+
11
+
**UpdateQuoterContract (discriminator: 0)**
12
+
- Registers or updates a quoter's implementation mapping
0 commit comments