Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5fd888d
feat(CORE-1557): pinnochio implementation of executorquoter with tests
bengtlofgren Dec 3, 2025
ebdfd29
added anchor program with script for cu unit comparison
bengtlofgren Dec 3, 2025
99dad8f
changed lockfile for svm tests and prettier fixes
bengtlofgren Dec 4, 2025
6d97bdb
native rust implementation also added for comparison out of interest
bengtlofgren Dec 4, 2025
e92fc4d
returns u64 instead of u256 and clones removed from native impl
bengtlofgren Dec 4, 2025
024ecf4
temporary commit with pure zero copy to demonstrate effectiveness of …
bengtlofgren Dec 4, 2025
28ea2d8
executor quoter router added and TODO.md for tomorrow's work
bengtlofgren Dec 5, 2025
6fea420
new tests added for quoter router
bengtlofgren Dec 5, 2025
7a5e8c8
delete comparison programs
bengtlofgren Dec 8, 2025
39296d6
clippy fixes
bengtlofgren Dec 8, 2025
ed40ef8
using pod and better alignment (was wasting some space for padding th…
bengtlofgren Dec 8, 2025
ef1d906
benchmark testing with mollusk-svm and devnet testing script
bengtlofgren Dec 8, 2025
4cd323c
checkpoint
bengtlofgren Dec 9, 2025
1236f31
checkpoint 2
bengtlofgren Dec 9, 2025
b766f95
checkpoint 3
bengtlofgren Dec 9, 2025
58812a3
final implementation before testing
bengtlofgren Dec 10, 2025
96ff31c
devnet tests passing via tests/executor-quoter.tests.ts
bengtlofgren Dec 10, 2025
edfa993
devnet test sets up sepoolia chains
bengtlofgren Dec 10, 2025
4cebd06
fixed ci fmt and updated readmes
bengtlofgren Dec 11, 2025
9fe5ed6
update pinocchio readme
bengtlofgren Dec 17, 2025
4dd8c3e
ci tests
bengtlofgren Dec 17, 2025
76a041d
cspell fix
bengtlofgren Dec 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .cspell/custom-dictionary.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# Custom Dictionary Words
Aptos
secp
borsh
Borsh
CCTP
Devnet
hashv
idls
keccak
keypair
keypairs
KEYPAIR
Linea
Mezo
permissionless
Expand Down
45 changes: 42 additions & 3 deletions .github/workflows/svm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on:
pull_request:

jobs:
test:
anchor-test:
name: Anchor Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: svm
working-directory: svm/anchor
steps:
- uses: actions/checkout@v4
- name: Get solana version
Expand All @@ -29,8 +29,47 @@ jobs:
node-version: "22.16.0"
anchor-version: "${{steps.anchor.outputs.version}}"
solana-cli-version: "${{steps.solana.outputs.version}}"
working-directory: "svm"
working-directory: "svm/anchor"

- run: cargo fmt --check --all
- run: cargo clippy
- run: cargo test

pinocchio-test:
name: Pinocchio Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: svm/pinocchio
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2025-04-14
components: rustfmt, clippy
- name: Install Solana CLI
run: |
sh -c "$(curl -sSfL https://release.anza.xyz/v1.18.17/install)"
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
- name: Generate test keypair
run: |
mkdir -p ../test-keys
solana-keygen new --no-bip39-passphrase -o ../test-keys/quoter-updater.json
echo "QUOTER_UPDATER_PUBKEY=$(solana-keygen pubkey ../test-keys/quoter-updater.json)" >> $GITHUB_ENV
echo "QUOTER_UPDATER_KEYPAIR_PATH=${{ github.workspace }}/svm/test-keys/quoter-updater.json" >> $GITHUB_ENV
- name: Build pinocchio programs
run: |
cargo build-sbf --manifest-path programs/executor-quoter/Cargo.toml
cargo build-sbf --manifest-path programs/executor-quoter-router/Cargo.toml
- name: Build anchor executor program
working-directory: svm/anchor
run: |
cargo build-sbf --manifest-path programs/executor/Cargo.toml
cp target/deploy/executor.so ../pinocchio/target/deploy/
- run: cargo fmt --check --all
- run: cargo clippy --all-targets
- name: Run tests
env:
SBF_OUT_DIR: ${{ github.workspace }}/svm/pinocchio/target/deploy
run: cargo test -p executor-quoter -p executor-quoter-tests -p executor-quoter-router-tests
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ node_modules/
lcov.info
.env
.env.*
.devcontainer
.claude
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
evm/cache/
evm/lib/
evm/out/
evm/broadcast/
svm/anchor/target/
svm/node_modules/
svm/modules/*/target/
svm/pinocchio/target/
svm/pinocchio/programs/*/target/
svm/pinocchio/tests/*/target/
svm/target/
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ This will generate:
After building, you can view the API documentation using:

1. **Swagger Editor** (Online)

- Visit https://editor.swagger.io/
- Copy and paste the contents of `tsp-output/schema/openapi.yaml`

Expand Down
2 changes: 1 addition & 1 deletion cspell.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "0.2",
"ignorePaths": [],
"ignorePaths": ["node_modules/", "svm/node_modules/", "evm/lib/"],
"dictionaryDefinitions": [
{
"name": "custom-dictionary",
Expand Down
33 changes: 27 additions & 6 deletions design/02_On_Chain_Quotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Some would-be Executor integrators may need on-chain quotes as they do not neces
## Runtime Support

- [x] [EVM](./evm/)
- [ ] [SVM](./svm/)
- [x] [SVM](./svm/)

# **Background**

Expand Down Expand Up @@ -91,7 +91,6 @@ interface IExecutorQuoter {
```

2. **ExecutorQuoterRouter** replaces **Executor** as the entry-point for integrators. It MUST be immutable and non-administered / fully permissionless. This provides three critical functionalities.

1. `updateQuoterContract(bytes calldata gov)` allows a Quoter to set their `ExecutorQuoter` contract via signed governance (detailed below). This MUST
1. Verify the chain ID matches the Executor’s `ourChain`.
2. Verify the contract address is an EVM address.
Expand Down Expand Up @@ -135,11 +134,33 @@ interface IExecutorQuoterRouter {

### SVM

The SVM implementation should follow the requirements above relevant to the SVM Executor implementation.
On SVM, two programs are introduced.

1. **ExecutorQuoter** is a Pinocchio-based program that implements the quoting logic. It exposes two CPI-callable instructions:
- `RequestQuote` (discriminator `[2, 0, 0, 0, 0, 0, 0, 0]`): Returns `(payee_address, required_payment)` via return data.
- `RequestExecutionQuote` (discriminator `[3, 0, 0, 0, 0, 0, 0, 0]`): Returns `(required_payment, payee_address, quote_body)` as 72 bytes via return data.

The quoter reads pricing data from on-chain PDAs (`ChainInfo`, `QuoteBody`) maintained by an authorized updater.

2. **ExecutorQuoterRouter** is the entry-point for integrators. It provides three instructions:
1. `UpdateQuoterContract` registers or updates a quoter's implementation mapping. This MUST:
- Verify the chain ID matches `OUR_CHAIN`.
- Verify the sender matches `universal_sender_address` in the governance message.
- Verify the governance has not expired.
- Verify the secp256k1 signature recovers to the quoter address (20-byte EVM address).
- Create or update a `QuoterRegistration` PDA seeded by `["quoter_registration", quoter_address]`.

2. `QuoteExecution` gets a quote from a registered quoter via CPI. The quoter's return data is forwarded to the caller.

3. `RequestExecution` requests execution through the router. This MUST:
- CPI to the quoter's `RequestExecutionQuote` to get payment/payee/quote body.
- Verify payment amount is sufficient.
- Construct an `EQ02` signed quote on-chain.
- CPI to Executor's `request_for_execution`.

**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.

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

### Other

Expand Down
7 changes: 7 additions & 0 deletions svm/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,11 @@ target
**/*.rs.bk
node_modules
test-ledger
test-keys
.yarn

# Keypair files (sensitive)
*-keypair.json
*_keypair.json
keypair.json
keypairs/
3 changes: 3 additions & 0 deletions svm/Anchor.toml → svm/anchor/Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ wallet = "~/.config/solana/id.json"

[scripts]
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"

[test.validator]
url = "http://127.0.0.1:8899"
3 changes: 2 additions & 1 deletion svm/Cargo.lock → svm/anchor/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions svm/Cargo.toml → svm/anchor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[workspace]
members = [
"modules/*",
members = [
"programs/*"
]
resolver = "2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ idl-build = ["anchor-lang/idl-build"]

[dependencies]
anchor-lang = "0.30.1"
executor-requests = { path = "../../../modules/executor-requests" }
Loading
Loading