openzoo 0.51.2 → 0.51.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/openzoo.js +12 -8
- package/package.json +2 -2
- package/transmute/README.md +42 -9
- package/transmute/lib/build.js +72 -2
- package/transmute/lib/cli.js +73 -17
- package/transmute/lib/compile/bytecode.js +591 -0
- package/transmute/lib/compile/hostids.js +11 -0
- package/transmute/lib/compile/index.js +16 -3
- package/transmute/lib/deploy.js +149 -1
- package/transmute/lib/gateway.js +14 -8
- package/transmute/lib/hub.js +13 -3
- package/transmute/lib/solana.js +67 -21
- package/transmute/lib/wire.js +42 -1
- package/transmute/prebuilt/zoo_vm.v0.so +0 -0
- package/transmute/runtime/zoo-host/examples/vmrun.rs +43 -0
- package/transmute/runtime/zoo-host/src/assets.rs +53 -10
- package/transmute/runtime/zoo-host/src/ctx.rs +15 -0
- package/transmute/runtime/zoo-host/src/helpers.rs +245 -0
- package/transmute/runtime/zoo-host/src/kv.rs +29 -8
- package/transmute/runtime/zoo-host/src/lib.rs +13 -0
- package/transmute/runtime/zoo-host/src/site.rs +94 -0
- package/transmute/runtime/zoo-host/src/vm.rs +902 -0
- package/transmute/runtime/zoo-vm/Cargo.lock +596 -0
- package/transmute/runtime/zoo-vm/Cargo.toml +23 -0
- package/transmute/runtime/zoo-vm/src/lib.rs +92 -0
- package/transmute/site/package.json +6 -0
- package/transmute/site/public/index.html +4 -4
|
@@ -0,0 +1,596 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "block-buffer"
|
|
7
|
+
version = "0.10.4"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"generic-array",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
[[package]]
|
|
15
|
+
name = "borsh"
|
|
16
|
+
version = "1.8.1"
|
|
17
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
18
|
+
checksum = "553c5d846a6ba5150c65e3b1b8ec073bcf1abc20f9b7220de384a4443ea4e20a"
|
|
19
|
+
dependencies = [
|
|
20
|
+
"borsh-derive",
|
|
21
|
+
"bytes",
|
|
22
|
+
"cfg_aliases",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[[package]]
|
|
26
|
+
name = "borsh-derive"
|
|
27
|
+
version = "1.8.1"
|
|
28
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
29
|
+
checksum = "12cdfe656708a01f89b451a7d36466e6fe6c414de0aa18fc54f864f6f9ca9f56"
|
|
30
|
+
dependencies = [
|
|
31
|
+
"once_cell",
|
|
32
|
+
"proc-macro-crate",
|
|
33
|
+
"proc-macro2",
|
|
34
|
+
"quote",
|
|
35
|
+
"syn 3.0.5",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[[package]]
|
|
39
|
+
name = "bytes"
|
|
40
|
+
version = "1.12.1"
|
|
41
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
42
|
+
checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
|
|
43
|
+
|
|
44
|
+
[[package]]
|
|
45
|
+
name = "cfg-if"
|
|
46
|
+
version = "1.0.4"
|
|
47
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
48
|
+
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
|
49
|
+
|
|
50
|
+
[[package]]
|
|
51
|
+
name = "cfg_aliases"
|
|
52
|
+
version = "0.2.2"
|
|
53
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
54
|
+
checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527"
|
|
55
|
+
|
|
56
|
+
[[package]]
|
|
57
|
+
name = "cpufeatures"
|
|
58
|
+
version = "0.2.17"
|
|
59
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
60
|
+
checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
|
|
61
|
+
dependencies = [
|
|
62
|
+
"libc",
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
[[package]]
|
|
66
|
+
name = "crypto-common"
|
|
67
|
+
version = "0.1.7"
|
|
68
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
69
|
+
checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"
|
|
70
|
+
dependencies = [
|
|
71
|
+
"generic-array",
|
|
72
|
+
"typenum",
|
|
73
|
+
]
|
|
74
|
+
|
|
75
|
+
[[package]]
|
|
76
|
+
name = "curve25519-dalek"
|
|
77
|
+
version = "4.1.3"
|
|
78
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
79
|
+
checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be"
|
|
80
|
+
dependencies = [
|
|
81
|
+
"cfg-if",
|
|
82
|
+
"cpufeatures",
|
|
83
|
+
"curve25519-dalek-derive",
|
|
84
|
+
"digest",
|
|
85
|
+
"fiat-crypto",
|
|
86
|
+
"rand_core",
|
|
87
|
+
"rustc_version",
|
|
88
|
+
"subtle",
|
|
89
|
+
"zeroize",
|
|
90
|
+
]
|
|
91
|
+
|
|
92
|
+
[[package]]
|
|
93
|
+
name = "curve25519-dalek-derive"
|
|
94
|
+
version = "0.1.1"
|
|
95
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
96
|
+
checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
|
|
97
|
+
dependencies = [
|
|
98
|
+
"proc-macro2",
|
|
99
|
+
"quote",
|
|
100
|
+
"syn 2.0.119",
|
|
101
|
+
]
|
|
102
|
+
|
|
103
|
+
[[package]]
|
|
104
|
+
name = "darling"
|
|
105
|
+
version = "0.23.0"
|
|
106
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
107
|
+
checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d"
|
|
108
|
+
dependencies = [
|
|
109
|
+
"darling_core",
|
|
110
|
+
"darling_macro",
|
|
111
|
+
]
|
|
112
|
+
|
|
113
|
+
[[package]]
|
|
114
|
+
name = "darling_core"
|
|
115
|
+
version = "0.23.0"
|
|
116
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
117
|
+
checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0"
|
|
118
|
+
dependencies = [
|
|
119
|
+
"ident_case",
|
|
120
|
+
"proc-macro2",
|
|
121
|
+
"quote",
|
|
122
|
+
"strsim",
|
|
123
|
+
"syn 2.0.119",
|
|
124
|
+
]
|
|
125
|
+
|
|
126
|
+
[[package]]
|
|
127
|
+
name = "darling_macro"
|
|
128
|
+
version = "0.23.0"
|
|
129
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
130
|
+
checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d"
|
|
131
|
+
dependencies = [
|
|
132
|
+
"darling_core",
|
|
133
|
+
"quote",
|
|
134
|
+
"syn 2.0.119",
|
|
135
|
+
]
|
|
136
|
+
|
|
137
|
+
[[package]]
|
|
138
|
+
name = "digest"
|
|
139
|
+
version = "0.10.7"
|
|
140
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
141
|
+
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
|
142
|
+
dependencies = [
|
|
143
|
+
"block-buffer",
|
|
144
|
+
"crypto-common",
|
|
145
|
+
]
|
|
146
|
+
|
|
147
|
+
[[package]]
|
|
148
|
+
name = "equivalent"
|
|
149
|
+
version = "1.0.2"
|
|
150
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
151
|
+
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
|
|
152
|
+
|
|
153
|
+
[[package]]
|
|
154
|
+
name = "fiat-crypto"
|
|
155
|
+
version = "0.2.9"
|
|
156
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
157
|
+
checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d"
|
|
158
|
+
|
|
159
|
+
[[package]]
|
|
160
|
+
name = "five8"
|
|
161
|
+
version = "1.0.0"
|
|
162
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
163
|
+
checksum = "23f76610e969fa1784327ded240f1e28a3fd9520c9cec93b636fcf62dd37f772"
|
|
164
|
+
dependencies = [
|
|
165
|
+
"five8_core",
|
|
166
|
+
]
|
|
167
|
+
|
|
168
|
+
[[package]]
|
|
169
|
+
name = "five8_const"
|
|
170
|
+
version = "1.0.0"
|
|
171
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
172
|
+
checksum = "1a0f1728185f277989ca573a402716ae0beaaea3f76a8ff87ef9dd8fb19436c5"
|
|
173
|
+
dependencies = [
|
|
174
|
+
"five8_core",
|
|
175
|
+
]
|
|
176
|
+
|
|
177
|
+
[[package]]
|
|
178
|
+
name = "five8_core"
|
|
179
|
+
version = "1.0.0"
|
|
180
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
181
|
+
checksum = "059c31d7d36c43fe39d89e55711858b4da8be7eb6dabac23c7289b1a19489406"
|
|
182
|
+
|
|
183
|
+
[[package]]
|
|
184
|
+
name = "generic-array"
|
|
185
|
+
version = "0.14.7"
|
|
186
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
187
|
+
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
|
|
188
|
+
dependencies = [
|
|
189
|
+
"typenum",
|
|
190
|
+
"version_check",
|
|
191
|
+
]
|
|
192
|
+
|
|
193
|
+
[[package]]
|
|
194
|
+
name = "hashbrown"
|
|
195
|
+
version = "0.17.1"
|
|
196
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
197
|
+
checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
|
|
198
|
+
|
|
199
|
+
[[package]]
|
|
200
|
+
name = "ident_case"
|
|
201
|
+
version = "1.0.1"
|
|
202
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
203
|
+
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
|
|
204
|
+
|
|
205
|
+
[[package]]
|
|
206
|
+
name = "indexmap"
|
|
207
|
+
version = "2.14.2"
|
|
208
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
209
|
+
checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855"
|
|
210
|
+
dependencies = [
|
|
211
|
+
"equivalent",
|
|
212
|
+
"hashbrown",
|
|
213
|
+
]
|
|
214
|
+
|
|
215
|
+
[[package]]
|
|
216
|
+
name = "libc"
|
|
217
|
+
version = "0.2.189"
|
|
218
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
219
|
+
checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
|
|
220
|
+
|
|
221
|
+
[[package]]
|
|
222
|
+
name = "libm"
|
|
223
|
+
version = "0.2.16"
|
|
224
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
225
|
+
checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"
|
|
226
|
+
|
|
227
|
+
[[package]]
|
|
228
|
+
name = "memchr"
|
|
229
|
+
version = "2.8.3"
|
|
230
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
231
|
+
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
232
|
+
|
|
233
|
+
[[package]]
|
|
234
|
+
name = "once_cell"
|
|
235
|
+
version = "1.21.4"
|
|
236
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
237
|
+
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
|
238
|
+
|
|
239
|
+
[[package]]
|
|
240
|
+
name = "pastey"
|
|
241
|
+
version = "0.2.3"
|
|
242
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
243
|
+
checksum = "2ee67f1008b1ba2321834326597b8e186293b049a023cdef258527550b9935b4"
|
|
244
|
+
|
|
245
|
+
[[package]]
|
|
246
|
+
name = "pinocchio"
|
|
247
|
+
version = "0.11.2"
|
|
248
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
249
|
+
checksum = "a6cababcb62a2e739c7078ae16eda02789a6e3edd21bbdded864e85c38a7914d"
|
|
250
|
+
dependencies = [
|
|
251
|
+
"solana-account-view",
|
|
252
|
+
"solana-address",
|
|
253
|
+
"solana-define-syscall 5.2.0",
|
|
254
|
+
"solana-instruction-view",
|
|
255
|
+
"solana-program-error",
|
|
256
|
+
]
|
|
257
|
+
|
|
258
|
+
[[package]]
|
|
259
|
+
name = "pinocchio-system"
|
|
260
|
+
version = "0.6.1"
|
|
261
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
262
|
+
checksum = "f3ae2ee67b42e2ac797dd88312da473c895660e270d8093e0ba2749b885b5778"
|
|
263
|
+
dependencies = [
|
|
264
|
+
"pinocchio",
|
|
265
|
+
"solana-address",
|
|
266
|
+
]
|
|
267
|
+
|
|
268
|
+
[[package]]
|
|
269
|
+
name = "proc-macro-crate"
|
|
270
|
+
version = "3.5.0"
|
|
271
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
272
|
+
checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f"
|
|
273
|
+
dependencies = [
|
|
274
|
+
"toml_edit",
|
|
275
|
+
]
|
|
276
|
+
|
|
277
|
+
[[package]]
|
|
278
|
+
name = "proc-macro2"
|
|
279
|
+
version = "1.0.107"
|
|
280
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
281
|
+
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
|
282
|
+
dependencies = [
|
|
283
|
+
"unicode-ident",
|
|
284
|
+
]
|
|
285
|
+
|
|
286
|
+
[[package]]
|
|
287
|
+
name = "quote"
|
|
288
|
+
version = "1.0.47"
|
|
289
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
290
|
+
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
|
291
|
+
dependencies = [
|
|
292
|
+
"proc-macro2",
|
|
293
|
+
]
|
|
294
|
+
|
|
295
|
+
[[package]]
|
|
296
|
+
name = "rand_core"
|
|
297
|
+
version = "0.6.4"
|
|
298
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
299
|
+
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
|
|
300
|
+
|
|
301
|
+
[[package]]
|
|
302
|
+
name = "rustc_version"
|
|
303
|
+
version = "0.4.1"
|
|
304
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
305
|
+
checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
|
|
306
|
+
dependencies = [
|
|
307
|
+
"semver",
|
|
308
|
+
]
|
|
309
|
+
|
|
310
|
+
[[package]]
|
|
311
|
+
name = "semver"
|
|
312
|
+
version = "1.0.28"
|
|
313
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
314
|
+
checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"
|
|
315
|
+
|
|
316
|
+
[[package]]
|
|
317
|
+
name = "serde"
|
|
318
|
+
version = "1.0.229"
|
|
319
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
320
|
+
checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
|
|
321
|
+
dependencies = [
|
|
322
|
+
"serde_core",
|
|
323
|
+
]
|
|
324
|
+
|
|
325
|
+
[[package]]
|
|
326
|
+
name = "serde_core"
|
|
327
|
+
version = "1.0.229"
|
|
328
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
329
|
+
checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
|
|
330
|
+
dependencies = [
|
|
331
|
+
"serde_derive",
|
|
332
|
+
]
|
|
333
|
+
|
|
334
|
+
[[package]]
|
|
335
|
+
name = "serde_derive"
|
|
336
|
+
version = "1.0.229"
|
|
337
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
338
|
+
checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
|
|
339
|
+
dependencies = [
|
|
340
|
+
"proc-macro2",
|
|
341
|
+
"quote",
|
|
342
|
+
"syn 3.0.5",
|
|
343
|
+
]
|
|
344
|
+
|
|
345
|
+
[[package]]
|
|
346
|
+
name = "sha2"
|
|
347
|
+
version = "0.10.9"
|
|
348
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
349
|
+
checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
|
|
350
|
+
dependencies = [
|
|
351
|
+
"cfg-if",
|
|
352
|
+
"cpufeatures",
|
|
353
|
+
"digest",
|
|
354
|
+
]
|
|
355
|
+
|
|
356
|
+
[[package]]
|
|
357
|
+
name = "sha2-const-stable"
|
|
358
|
+
version = "0.1.0"
|
|
359
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
360
|
+
checksum = "5f179d4e11094a893b82fff208f74d448a7512f99f5a0acbd5c679b705f83ed9"
|
|
361
|
+
|
|
362
|
+
[[package]]
|
|
363
|
+
name = "solana-account-view"
|
|
364
|
+
version = "2.0.0"
|
|
365
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
366
|
+
checksum = "fc141b940560430425ebaadb7645496c45f6a10fad9911d719bd03eab7f4d422"
|
|
367
|
+
dependencies = [
|
|
368
|
+
"solana-address",
|
|
369
|
+
"solana-program-error",
|
|
370
|
+
]
|
|
371
|
+
|
|
372
|
+
[[package]]
|
|
373
|
+
name = "solana-address"
|
|
374
|
+
version = "2.7.0"
|
|
375
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
376
|
+
checksum = "01332a01c0a3098404d55a724c8d9a92aed4a50fe40a7dd0c7a51e29274c14de"
|
|
377
|
+
dependencies = [
|
|
378
|
+
"borsh",
|
|
379
|
+
"curve25519-dalek",
|
|
380
|
+
"five8",
|
|
381
|
+
"five8_const",
|
|
382
|
+
"serde",
|
|
383
|
+
"sha2-const-stable",
|
|
384
|
+
"solana-define-syscall 5.2.0",
|
|
385
|
+
"solana-program-error",
|
|
386
|
+
"solana-sha256-hasher",
|
|
387
|
+
"wincode",
|
|
388
|
+
]
|
|
389
|
+
|
|
390
|
+
[[package]]
|
|
391
|
+
name = "solana-define-syscall"
|
|
392
|
+
version = "4.0.1"
|
|
393
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
394
|
+
checksum = "57e5b1c0bc1d4a4d10c88a4100499d954c09d3fecfae4912c1a074dff68b1738"
|
|
395
|
+
|
|
396
|
+
[[package]]
|
|
397
|
+
name = "solana-define-syscall"
|
|
398
|
+
version = "5.2.0"
|
|
399
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
400
|
+
checksum = "bf8209ece2bd9f1450e672858ffc0e5c8c786ff6916d2a862b126dd0128f380f"
|
|
401
|
+
|
|
402
|
+
[[package]]
|
|
403
|
+
name = "solana-hash"
|
|
404
|
+
version = "4.6.0"
|
|
405
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
406
|
+
checksum = "0df9b01495ed31100aca97a7f5862d5e19ab1636d60d1a9f02391408dd9dec84"
|
|
407
|
+
|
|
408
|
+
[[package]]
|
|
409
|
+
name = "solana-instruction-view"
|
|
410
|
+
version = "2.1.0"
|
|
411
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
412
|
+
checksum = "6ab7a27d0c4214b9f7389c3dd00b68c93093a67f1dcc5b7893aebe299bbcbb47"
|
|
413
|
+
dependencies = [
|
|
414
|
+
"solana-account-view",
|
|
415
|
+
"solana-address",
|
|
416
|
+
"solana-define-syscall 5.2.0",
|
|
417
|
+
"solana-program-error",
|
|
418
|
+
]
|
|
419
|
+
|
|
420
|
+
[[package]]
|
|
421
|
+
name = "solana-program-error"
|
|
422
|
+
version = "3.0.1"
|
|
423
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
424
|
+
checksum = "4f04fa578707b3612b095f0c8e19b66a1233f7c42ca8082fcb3b745afcc0add6"
|
|
425
|
+
|
|
426
|
+
[[package]]
|
|
427
|
+
name = "solana-sha256-hasher"
|
|
428
|
+
version = "3.1.0"
|
|
429
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
430
|
+
checksum = "db7dc3011ea4c0334aaaa7e7128cb390ecf546b28d412e9bf2064680f57f588f"
|
|
431
|
+
dependencies = [
|
|
432
|
+
"sha2",
|
|
433
|
+
"solana-define-syscall 4.0.1",
|
|
434
|
+
"solana-hash",
|
|
435
|
+
]
|
|
436
|
+
|
|
437
|
+
[[package]]
|
|
438
|
+
name = "strsim"
|
|
439
|
+
version = "0.11.1"
|
|
440
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
441
|
+
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
|
|
442
|
+
|
|
443
|
+
[[package]]
|
|
444
|
+
name = "subtle"
|
|
445
|
+
version = "2.6.1"
|
|
446
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
447
|
+
checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
|
|
448
|
+
|
|
449
|
+
[[package]]
|
|
450
|
+
name = "syn"
|
|
451
|
+
version = "2.0.119"
|
|
452
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
453
|
+
checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
|
|
454
|
+
dependencies = [
|
|
455
|
+
"proc-macro2",
|
|
456
|
+
"quote",
|
|
457
|
+
"unicode-ident",
|
|
458
|
+
]
|
|
459
|
+
|
|
460
|
+
[[package]]
|
|
461
|
+
name = "syn"
|
|
462
|
+
version = "3.0.5"
|
|
463
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
464
|
+
checksum = "12df2e0110f65b775f769bb17ef989067a1d931b2eb822bd4346631eeada89f9"
|
|
465
|
+
dependencies = [
|
|
466
|
+
"proc-macro2",
|
|
467
|
+
"quote",
|
|
468
|
+
"unicode-ident",
|
|
469
|
+
]
|
|
470
|
+
|
|
471
|
+
[[package]]
|
|
472
|
+
name = "thiserror"
|
|
473
|
+
version = "2.0.20"
|
|
474
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
475
|
+
checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f"
|
|
476
|
+
dependencies = [
|
|
477
|
+
"thiserror-impl",
|
|
478
|
+
]
|
|
479
|
+
|
|
480
|
+
[[package]]
|
|
481
|
+
name = "thiserror-impl"
|
|
482
|
+
version = "2.0.20"
|
|
483
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
484
|
+
checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af"
|
|
485
|
+
dependencies = [
|
|
486
|
+
"proc-macro2",
|
|
487
|
+
"quote",
|
|
488
|
+
"syn 3.0.5",
|
|
489
|
+
]
|
|
490
|
+
|
|
491
|
+
[[package]]
|
|
492
|
+
name = "toml_datetime"
|
|
493
|
+
version = "1.1.1+spec-1.1.0"
|
|
494
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
495
|
+
checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7"
|
|
496
|
+
dependencies = [
|
|
497
|
+
"serde_core",
|
|
498
|
+
]
|
|
499
|
+
|
|
500
|
+
[[package]]
|
|
501
|
+
name = "toml_edit"
|
|
502
|
+
version = "0.25.13+spec-1.1.0"
|
|
503
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
504
|
+
checksum = "6975367e4d2ef766d86af01ffad14b622fecc8d4357a998fbc4deb6e9bacaf9b"
|
|
505
|
+
dependencies = [
|
|
506
|
+
"indexmap",
|
|
507
|
+
"toml_datetime",
|
|
508
|
+
"toml_parser",
|
|
509
|
+
"winnow",
|
|
510
|
+
]
|
|
511
|
+
|
|
512
|
+
[[package]]
|
|
513
|
+
name = "toml_parser"
|
|
514
|
+
version = "1.1.3+spec-1.1.0"
|
|
515
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
516
|
+
checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56"
|
|
517
|
+
dependencies = [
|
|
518
|
+
"winnow",
|
|
519
|
+
]
|
|
520
|
+
|
|
521
|
+
[[package]]
|
|
522
|
+
name = "typenum"
|
|
523
|
+
version = "1.20.1"
|
|
524
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
525
|
+
checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20"
|
|
526
|
+
|
|
527
|
+
[[package]]
|
|
528
|
+
name = "unicode-ident"
|
|
529
|
+
version = "1.0.24"
|
|
530
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
531
|
+
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
|
532
|
+
|
|
533
|
+
[[package]]
|
|
534
|
+
name = "version_check"
|
|
535
|
+
version = "0.9.5"
|
|
536
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
537
|
+
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
|
538
|
+
|
|
539
|
+
[[package]]
|
|
540
|
+
name = "wincode"
|
|
541
|
+
version = "0.6.1"
|
|
542
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
543
|
+
checksum = "bfc6339f1ba427bf7ad7c42403b28e524832ba2ddb5eef1bb2cc3b85db6b7b75"
|
|
544
|
+
dependencies = [
|
|
545
|
+
"pastey",
|
|
546
|
+
"proc-macro2",
|
|
547
|
+
"quote",
|
|
548
|
+
"thiserror",
|
|
549
|
+
"wincode-derive",
|
|
550
|
+
]
|
|
551
|
+
|
|
552
|
+
[[package]]
|
|
553
|
+
name = "wincode-derive"
|
|
554
|
+
version = "0.5.1"
|
|
555
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
556
|
+
checksum = "11d582d9fc9d813264407a9e16bfa16846ccf15ef032f9bbcd700741bdc00255"
|
|
557
|
+
dependencies = [
|
|
558
|
+
"darling",
|
|
559
|
+
"proc-macro2",
|
|
560
|
+
"quote",
|
|
561
|
+
"syn 2.0.119",
|
|
562
|
+
]
|
|
563
|
+
|
|
564
|
+
[[package]]
|
|
565
|
+
name = "winnow"
|
|
566
|
+
version = "1.0.4"
|
|
567
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
568
|
+
checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81"
|
|
569
|
+
dependencies = [
|
|
570
|
+
"memchr",
|
|
571
|
+
]
|
|
572
|
+
|
|
573
|
+
[[package]]
|
|
574
|
+
name = "zeroize"
|
|
575
|
+
version = "1.9.0"
|
|
576
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
577
|
+
checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e"
|
|
578
|
+
|
|
579
|
+
[[package]]
|
|
580
|
+
name = "zoo-host"
|
|
581
|
+
version = "0.1.0"
|
|
582
|
+
dependencies = [
|
|
583
|
+
"libm",
|
|
584
|
+
"pinocchio",
|
|
585
|
+
"pinocchio-system",
|
|
586
|
+
"solana-address",
|
|
587
|
+
"solana-sha256-hasher",
|
|
588
|
+
]
|
|
589
|
+
|
|
590
|
+
[[package]]
|
|
591
|
+
name = "zoo-vm"
|
|
592
|
+
version = "0.1.0"
|
|
593
|
+
dependencies = [
|
|
594
|
+
"pinocchio",
|
|
595
|
+
"zoo-host",
|
|
596
|
+
]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "zoo-vm"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
description = "The shared openzoo-transmute runtime program: every site is accounts (bytecode + assets + manifest + KV); deployed once per cluster."
|
|
6
|
+
license = "MIT"
|
|
7
|
+
|
|
8
|
+
[lib]
|
|
9
|
+
name = "zoo_vm"
|
|
10
|
+
crate-type = ["cdylib", "lib"]
|
|
11
|
+
|
|
12
|
+
[dependencies]
|
|
13
|
+
pinocchio = "0.11.2"
|
|
14
|
+
zoo-host = { path = "../zoo-host" }
|
|
15
|
+
|
|
16
|
+
[profile.release]
|
|
17
|
+
opt-level = "z"
|
|
18
|
+
lto = "fat"
|
|
19
|
+
codegen-units = 1
|
|
20
|
+
panic = "abort"
|
|
21
|
+
strip = true
|
|
22
|
+
debug = false
|
|
23
|
+
overflow-checks = false
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
//! zoo-vm: the shared runtime program. Sites are data.
|
|
2
|
+
//!
|
|
3
|
+
//! Instruction data: `[tag][site_id: 32][payload]`.
|
|
4
|
+
//! * TAG_SITE_INIT payload = () accounts: authority, site PDA, system
|
|
5
|
+
//! * TAG_SITE_SET_AUTHORITY payload = new authority accounts: authority, site PDA
|
|
6
|
+
//! * TAG_VM_ASSET_INIT/WRITE/CLOSE payload = as the compiled-site asset tags
|
|
7
|
+
//! accounts: authority, site PDA, asset PDA, system
|
|
8
|
+
//! * TAG_VM_INVOKE payload = bridge event (wire::Req)
|
|
9
|
+
//! accounts: payer, system, site PDA, code asset, ...kv PDAs
|
|
10
|
+
#![no_std]
|
|
11
|
+
extern crate alloc;
|
|
12
|
+
|
|
13
|
+
use pinocchio::{error::ProgramError, AccountView, Address, ProgramResult};
|
|
14
|
+
use zoo_host::{assets, site, vm, wire, Ctx, Val, ERR_BAD_WIRE, ERR_KV_MISSING, TAG_SITE_INIT, TAG_SITE_SET_AUTHORITY, TAG_VM_ASSET_CLOSE, TAG_VM_ASSET_INIT, TAG_VM_ASSET_WRITE, TAG_VM_INVOKE};
|
|
15
|
+
|
|
16
|
+
pinocchio::program_entrypoint!(process_instruction);
|
|
17
|
+
pinocchio::default_allocator!();
|
|
18
|
+
pinocchio::nostd_panic_handler!();
|
|
19
|
+
|
|
20
|
+
pub fn process_instruction(program_id: &Address, accounts: &mut [AccountView], data: &[u8]) -> ProgramResult {
|
|
21
|
+
let (tag, rest) = data.split_first().ok_or(ProgramError::Custom(ERR_BAD_WIRE))?;
|
|
22
|
+
match *tag {
|
|
23
|
+
TAG_SITE_INIT => site::init(program_id, accounts, rest),
|
|
24
|
+
TAG_SITE_SET_AUTHORITY => site::set_authority(program_id, accounts, rest),
|
|
25
|
+
TAG_VM_ASSET_INIT => {
|
|
26
|
+
let (id, payload) = site::site_id_from(rest)?;
|
|
27
|
+
assets::init_ns(program_id, accounts, payload, Some(id), assets::Auth::Site(id))
|
|
28
|
+
}
|
|
29
|
+
TAG_VM_ASSET_WRITE => {
|
|
30
|
+
let (id, payload) = site::site_id_from(rest)?;
|
|
31
|
+
assets::write_ns(program_id, accounts, payload, Some(id), assets::Auth::Site(id))
|
|
32
|
+
}
|
|
33
|
+
TAG_VM_ASSET_CLOSE => {
|
|
34
|
+
let (id, payload) = site::site_id_from(rest)?;
|
|
35
|
+
assets::close_ns(program_id, accounts, payload, Some(id), assets::Auth::Site(id))
|
|
36
|
+
}
|
|
37
|
+
TAG_VM_INVOKE => invoke(program_id, accounts, rest),
|
|
38
|
+
_ => Err(ProgramError::InvalidInstructionData),
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
fn invoke(program_id: &Address, accounts: &mut [AccountView], data: &[u8]) -> ProgramResult {
|
|
43
|
+
let (site_id, payload) = site::site_id_from(data)?;
|
|
44
|
+
let req = wire::parse_req(payload).map_err(|_| ProgramError::Custom(ERR_BAD_WIRE))?;
|
|
45
|
+
// accounts[2] = site PDA (identity check), accounts[3] = the code asset.
|
|
46
|
+
let (site_addr, _) = site::site_pda(program_id, &site_id);
|
|
47
|
+
let site_acc = accounts.get(2).ok_or(ProgramError::NotEnoughAccountKeys)?;
|
|
48
|
+
if *site_acc.address() != site_addr || !site_acc.owned_by(program_id) {
|
|
49
|
+
return Err(ProgramError::InvalidSeeds);
|
|
50
|
+
}
|
|
51
|
+
let code_hash = assets::path_hash(zoo_host::CODE_PATH);
|
|
52
|
+
let (code_addr, _) = assets::pda_for_hash_ns(program_id, Some(&site_id), &code_hash);
|
|
53
|
+
let code_acc = accounts.get(3).ok_or(ProgramError::NotEnoughAccountKeys)?;
|
|
54
|
+
if *code_acc.address() != code_addr || !code_acc.owned_by(program_id) {
|
|
55
|
+
return Err(ProgramError::InvalidAccountData);
|
|
56
|
+
}
|
|
57
|
+
// Copy the module out so the account borrow does not outlive the run
|
|
58
|
+
// (the handler may write KV accounts; the code account is never written).
|
|
59
|
+
let code: alloc::vec::Vec<u8> = {
|
|
60
|
+
let d = code_acc.try_borrow()?;
|
|
61
|
+
if d.len() < assets::FIXED_HEADER || d[0] != 1 {
|
|
62
|
+
return Err(ProgramError::InvalidAccountData);
|
|
63
|
+
}
|
|
64
|
+
let total = u32::from_le_bytes([d[2], d[3], d[4], d[5]]) as usize;
|
|
65
|
+
let start = assets::FIXED_HEADER + d[6] as usize;
|
|
66
|
+
d.get(start..start + total).ok_or(ProgramError::InvalidAccountData)?.to_vec()
|
|
67
|
+
};
|
|
68
|
+
let route = req.route as usize;
|
|
69
|
+
let mut cx = Ctx::new(program_id, accounts, req, &[]);
|
|
70
|
+
cx.ns = Some(site_id);
|
|
71
|
+
let outcome = vm::invoke_module(&mut cx, &code, route);
|
|
72
|
+
if !cx.kv.missing.is_empty() {
|
|
73
|
+
for pda in cx.kv.missing.iter() {
|
|
74
|
+
wire::log_kv_missing(pda);
|
|
75
|
+
}
|
|
76
|
+
return Err(ProgramError::Custom(ERR_KV_MISSING));
|
|
77
|
+
}
|
|
78
|
+
match outcome {
|
|
79
|
+
Ok(()) => {}
|
|
80
|
+
Err(thrown) => {
|
|
81
|
+
cx.res = vm::error_resp(&thrown);
|
|
82
|
+
cx.sent = true;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if !cx.sent {
|
|
86
|
+
cx.res = wire::Resp::json_error(504, "handler returned without a response");
|
|
87
|
+
}
|
|
88
|
+
let bytes = wire::encode_resp(&cx.res);
|
|
89
|
+
wire::emit(&bytes);
|
|
90
|
+
let _ = Val::Undef;
|
|
91
|
+
Ok(())
|
|
92
|
+
}
|