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
- Devnet smoke test (`tests-sdk/tests/devnet-smoke.ts`): exercises all 9 instructions across Ed25519/Secp256r1/Session auth types and Owner/Admin/Spender roles, reporting CU/TX size/rent
16
29
- Deferred execution benchmarks (CU + tx size measurements for TX1/TX2)
- Cost documentation: updated all CU numbers from local validator to devnet-measured actuals, expanded CU table to all 9 instructions across all auth types and roles
-`PublicKey.default` collision with `SystemProgram.programId` in SDK execute methods: both are 32 zero bytes, causing `buildCompactLayout` to map SystemProgram to the sysvar slot (index 4) instead of adding it as a remaining account. Replaced with `SYSVAR_INSTRUCTIONS_PUBKEY`.
| Transaction Fee | 0.000005 SOL | 0.000005 SOL | 0.000005 SOL | 0.000005 SOL |
32
32
33
-
Session keys are ideal for frequent transactions -- they skip the Secp256r1 precompile and use a simple Ed25519 signer, resulting in lower CU and smaller transactions.
33
+
Session keys are ideal for frequent transactions -- they skip the Secp256r1 precompile and use a simple Ed25519 signer, resulting in lower CU and smaller transactions. All CU measurements are from real devnet transactions.
34
34
35
35
### Deferred Execution (Large Payloads)
36
36
37
37
For operations exceeding the ~574 bytes available in a single Secp256r1 Execute tx (e.g., Jupiter swaps):
38
38
39
39
| Metric | Immediate Execute | Deferred (2 txs) |
40
40
|---|---|---|
41
-
| Total CU |12,441 |18,613 (11,709 + 6,904) |
41
+
| Total CU |9,441 |15,613 (10,209 + 5,404) |
42
42
| Inner Ix Capacity |~574 bytes |~1,100 bytes (1.9x) |
Copy file name to clipboardExpand all lines: docs/Costs.md
+50-34Lines changed: 50 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,47 +1,65 @@
1
1
# LazorKit Cost Analysis
2
2
3
-
This document provides comprehensive cost data for the LazorKit smart wallet program on Solana. All compute unit (CU) measurements are from real transactions against a local validator. Rent costs use Solana's standard formula.
3
+
This document provides comprehensive cost data for the LazorKit smart wallet program on Solana. All compute unit (CU) measurements are from real transactions on devnet. Rent costs use Solana's standard formula.
4
4
5
5
> Program ID: `FLb7fyAtkfA4TSa2uYcAT8QKHd2pkoMHgmqfnXFXo7ao`
6
6
7
7
---
8
8
9
9
## Compute Units & Transaction Size
10
10
11
-
| Instruction | CU | Tx Size (bytes) | Ix Data (bytes) | Accounts | Instructions |
12
-
|---|---|---|---|---|---|
13
-
| Normal SOL Transfer (baseline) | 150 | 215 | 12 | 2 | 1 |
| Inner Ix Capacity |~574 bytes |~1,100 bytes (1.9x) |
41
59
| Tx Fee | 0.000005 SOL | 0.00001 SOL |
42
60
| Temp Rent | -- | 0.002116 SOL (refunded) |
43
61
44
-
The deferred path trades ~50% more total CU and 2x the tx fee for 1.9x the inner instruction space. The DeferredExec account rent (0.002116 SOL) is temporary -- it is refunded when TX2 executes or when the payer reclaims an expired authorization.
62
+
The deferred path trades ~66% more total CU and 2x the tx fee for 1.9x the inner instruction space. The DeferredExec account rent (0.002116 SOL) is temporary -- it is refunded when TX2 executes or when the payer reclaims an expired authorization.
45
63
46
64
---
47
65
@@ -61,21 +79,22 @@ The Secp256r1 Execute transaction was optimized from **708 bytes to 658 bytes**
61
79
62
80
## LazorKit vs Normal SOL Transfer
63
81
64
-
| Metric | Normal Transfer | LazorKit Secp256r1 | LazorKit Session | Notes |
65
-
|---|---|---|---|---|
66
-
| Compute Units | 150 |12,441 |8,983 | Session uses Ed25519 signer (no precompile)|
67
-
| Transaction Size | 215 bytes | 658 bytes | 452 bytes | Session tx is smaller (no precompile ix)|
68
-
| Instruction Data | 12 bytes | 254 bytes | 20 bytes | Session has no auth payload |
@@ -174,11 +193,8 @@ The compact data sizes are achieved through:
174
193
## Reproducing These Numbers
175
194
176
195
```bash
177
-
# Start local validator
178
-
cd tests-sdk && npm run validator:start
179
-
180
-
# Run benchmarks
181
-
npm run benchmark
196
+
# Run devnet smoke test (all instructions, all auth types)
197
+
cd tests-sdk && npx tsx tests/devnet-smoke.ts
182
198
```
183
199
184
-
The benchmark script (`tests-sdk/tests/benchmark.ts`) sends real transactions and extracts CU consumptionfrom transaction metadata.
200
+
The devnet smoke test exercises all 9 instructions across all authority types (Ed25519, Secp256r1, Session) and roles (Owner, Admin, Spender), reporting CU consumption, TX size, and rent costs from real devnet transactions.
0 commit comments