Commit af2f268
feat(ovsm): Add Solana account access builtins and memory operations
## Added
- account-pubkey: Get pointer to 32-byte account public key
- account-owner: Get pointer to 32-byte owner public key
- account-is-signer: Check if account signed the transaction
- account-is-writable: Check if account is writable
- mem-load: Load 8 bytes (u64) from memory pointer + offset
- mem-load1: Load 1 byte from memory pointer + offset
- sol_log_pubkey: Log 32-byte public key in base58 format
- SBPF_COMPILER_BUILTINS.md: Complete reference documentation
## Fixed
- Critical: Fixed register clobbering bug where next_reg could allocate reserved R6/R7
- Fixed set! to emit Move instructions for proper variable mutation in loops
- Fixed JumpIf/JumpIfNot to use get_reg() for conditions in while loops
- Corrected account field offsets per Solana's deserialize.h:
- lamports at offset 72 (was 80)
- data_len at offset 80
- data at offset 88
## Tested
β
All account access functions verified on Solana devnet
β
sol_log_pubkey correctly outputs base58 pubkeys
β
mem-load correctly reads memory at pointer offsets
π€ Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 2b9a7df commit af2f268
File tree
3 files changed
+1020
-0
lines changed- crates/ovsm
- src/compiler
3 files changed
+1020
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
10 | 46 | | |
11 | 47 | | |
12 | 48 | | |
| |||
0 commit comments