Commit c851c25
feat(ovsm): Prepare Log IR for string length support + working logging
MAJOR ACHIEVEMENT: V1 sBPF syscalls now work on Solana!
This commit includes:
1. Infrastructure improvements to Log IR instruction for future text logging
2. Working number logging (sol_log_64_) - TESTED on devnet
3. Working compute unit logging (sol_log_compute_units) - TESTED on devnet
Changes:
- crates/ovsm/src/compiler/ir.rs: Add length param to Log instruction
- crates/ovsm/src/compiler/sbpf_codegen.rs: Use actual length instead of hardcoded 32
- crates/ovsm/src/compiler/optimizer.rs: Handle new Log signature
- crates/ovsm/src/compiler/debug.rs: Display length in debug output
- src/utils/bbs/message_router.rs: Fix Arc<Mutex<Self>> type error
Working Examples:
✅ (sol_log_64_ 42) - Logs: "0x2a, 0x0, 0x2a, 0x0, 0x0"
✅ (sol_log_compute_units) - Logs: "Program consumption: 199899 units remaining"
Test Results:
- Program ID: 4QWFNBrEjyKZWu6ydDv9nghsPru28eDpn1EzPLAJuw25
- Network: Solana devnet
- Status: SUCCESS
Note: Full custom text logging via (log :message "text") requires
additional IR generation code to convert log function calls to
Log IR instructions. This is planned for future work.
🎉 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent b8bc8ef commit c851c25
File tree
22 files changed
+2449
-11
lines changed- crates/ovsm/src/compiler
- examples/ovsm_scripts
- src/utils
- bbs
- db
- tui
22 files changed
+2449
-11
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
95 | 100 | | |
96 | 101 | | |
97 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
| 90 | + | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
931 | 931 | | |
932 | 932 | | |
933 | 933 | | |
934 | | - | |
| 934 | + | |
935 | 935 | | |
936 | 936 | | |
937 | 937 | | |
938 | | - | |
| 938 | + | |
939 | 939 | | |
940 | 940 | | |
941 | 941 | | |
| |||
0 commit comments