Skip to content

Commit af2f268

Browse files
0xrinegadeclaude
andcommitted
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

3 files changed

+1020
-0
lines changed

β€Žcrates/ovsm/CHANGELOG.mdβ€Ž

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,42 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.0.5] - 2025-11-25
11+
12+
### Added
13+
- πŸ”§ **sBPF Compiler Account Access Functions** - Full account field access for Solana programs
14+
- `account-pubkey` - Get pointer to 32-byte account public key
15+
- `account-owner` - Get pointer to 32-byte owner public key
16+
- `account-is-signer` - Check if account signed the transaction
17+
- `account-is-writable` - Check if account is writable
18+
- πŸ”§ **Memory Access Functions**
19+
- `mem-load` - Load 8 bytes (u64) from memory pointer + offset
20+
- `mem-load1` - Load 1 byte from memory pointer + offset
21+
- πŸ”§ **Logging Syscall**
22+
- `sol_log_pubkey` - Log 32-byte public key in base58 format
23+
- πŸ“ **New Documentation**
24+
- `SBPF_COMPILER_BUILTINS.md` - Complete reference for sBPF compiler built-in functions
25+
26+
### Changed
27+
- πŸ”§ Account field offsets verified against Solana's deserialize.h
28+
- `lamports` at offset 72 (corrected from 80)
29+
- `data_len` at offset 80
30+
- `data` at offset 88
31+
- `pubkey` at offset 8
32+
- `owner` at offset 40
33+
- `is_signer` at offset 1
34+
- `is_writable` at offset 2
35+
36+
### Fixed
37+
- πŸ› **Critical**: Fixed register clobbering bug where `next_reg` could allocate reserved registers (R6/R7)
38+
- πŸ› Fixed `set!` to emit Move instructions for proper variable mutation in loops
39+
- πŸ› Fixed JumpIf/JumpIfNot to use get_reg() for conditions in while loops
40+
41+
### Tested
42+
- βœ… All account access functions verified on Solana devnet
43+
- βœ… `sol_log_pubkey` correctly outputs base58 pubkeys
44+
- βœ… `mem-load` correctly reads memory at pointer offsets
45+
1046
## [1.0.4] - 2025-11-08
1147

1248
### Added

0 commit comments

Comments
Β (0)