### 01-core-architecture/01-components.txt *GenVM* Components Overview *************************** Introduction ============ *GenVM* is a WebAssembly-based virtual machine that enables "Intelligent Contracts" - smart contracts capable of performing non- deterministic operations (AI inference, web scraping, real-world data access) while maintaining blockchain consensus. This document provides an architectural overview of *GenVM*'s major components and how they work together. High-Level Architecture ======================= [graph] *GenVM* Executor ================ The *GenVM* Executor is the heart of the system, providing a modified WebAssembly runtime with blockchain-specific capabilities. Executor itself is a supervisor of *sub-VM*s. **Key Responsibilities:** * Contract execution in deterministic and non-deterministic modes * RAM management (memory) * State management and storage operations * Communication with *Module*s and the *host* **Major Subcomponents:** * **VM Core**: Dual-mode WebAssembly execution engine * **WASI Implementation**: Standard and GenLayer-specific system interfaces * **:term:`Host` Functions**: Bridge between contracts and the *host* environment * **Caching System**: Module compilation and execution optimization *Sub-VM* -------- *GenVM*'s unique dual execution model is implemented by using multiple wasm *sub-VM*s. **Deterministic Mode:** - Executes blockchain consensus logic - Provides reproducible results across all validators - Handles storage operations, message passing, and standard computation **Non-Deterministic Mode:** - Executes AI inference, web scraping, and external data access - Results are validated through consensus mechanisms - Isolated from deterministic state to prevent contamination WASI Interfaces --------------- *GenVM* exposes two WebAssembly System Interfaces: **WASI Preview 1 (``wasip1``)** - Standard WASI interface with deterministic modifications - File system operations, environment access, time functions - Modified to ensure reproducible behavior across validators **:term:`GenLayer WASI SDK` (``genlayer_sdk``)** - Blockchain-specific operations and primitives - Storage access, message passing, contract deployment - Non-deterministic operation triggers and validation Runners (libraries) ------------------- Language runtimes provide the execution environment for different programming languages: **Python Runtime** - Custom CPython build compiled to WebAssembly with software floating point implementation for deterministic mode * GenLayer Python SDK for blockchain primitives * Curated standard library for deterministic execution * Support for some necessary libraries (NumPy, PIL) GenVM requires some built-in runners to be accessible by contracts. They are identified by hashes of their "tar" contents *Host* Interface ---------------- The *Host* Interface manages communication between *GenVM* and the blockchain node. Host is responsible for providing blockchain state to *GenVM* and updating it. *Module*s ========= *Module*s provide non-deterministic capabilities through isolated services: **LLM :term:`Module`** - Large Language Model inference capabilities - Supports multiple AI providers and models - Configurable prompts and response processing - Support for *greyboxing* **Web :term:`Module`** - Web scraping and HTTP request capabilities - Webpage rendering and content extraction - Domain filtering and security controls They are separated from executor for following reasons: * replace-ability * privileges containment *Manager* ========= The *Manager* oversees *Module*s and is responsible for correct GenVM Executor version selection ### 01-core-architecture/02-host-interface.txt *Host* Interface Protocol ************************* Overview ======== The *Host* Interface defines the communication protocol between GenVM and the blockchain node. GenVM launches with "--host" (socket address) and "--message" (JSON data) parameters and communicates via a binary protocol over TCP or Unix domain sockets. Process Management ================== GenVM Execution --------------- **Launch Parameters**: * "--host": TCP address or "unix://" prefixed Unix domain socket * "--message": Message data as JSON following message schema **Process Control**: * **Graceful Shutdown**: Send "SIGTERM" signal * **Force Termination**: Send "SIGKILL" if not responding * **Crash Detection**: Process exit before sending result indicates crash (should be reported as bug) **Node Responsibilities**: Node decides how to receive code and messages from users. GenVM only knows about calldata and message data. Communication Protocol ====================== Pseudocode is available in Host Loop Pseudocode Binary Protocol Design ---------------------- Data Types and Results ====================== VM Result Codes --------------- **Result Types**: * "Return": Successful execution * "VMError": VM-produced error that usually can't be handled * "UserError": User-produced error Result Encoding --------------- **Non-deterministic Blocks and Sandbox Encoding**: * 1 byte of result code * Result data: calldata for "Return", string for "VMError" or "UserError" **Parent VM Result Encoding**: * 1 byte of result code * Data format: * "Return": calldata * "VMError" / "UserError": "{ "message": "string", "fingerprint": ... }" **Host Responsibility**: Calculating storage updates, hashes, and state management (similar to Ethereum's dirty storage override pattern). Method ID Reference =================== Method IDs are available as JSON in the build system for code generation. Error Handling ============== * **Protocol Errors**: Most methods return error codes, with "json/errors/ok" indicating success * **Communication Failures**: Socket communication errors indicate protocol violations * **Process Termination**: Unexpected process exit indicates GenVM crash and should be reported ### 01-core-architecture/03-modules/01-web.txt Web *Module* ************ Web Scraping Capabilities ========================= * HTML parsing and data extraction * JavaScript execution and dynamic content handling via webdriver HTTP Request Handling ===================== * **Protocol Support**: * HTTP/HTTPS request execution * Custom header specification and management * Authentication mechanism support via RFC9421 * Proxy and routing configuration * **Error Handling**: * Network timeout and retry mechanisms * HTTP error code interpretation * Connection failure recovery Security and Compliance ======================= * Whitelist top-level domain filtering * Whitelist port filtering * URL pattern matching and validation * Execution time limits and timeouts ### 01-core-architecture/03-modules/02-llm.txt Large Language Model (LLM) Module ********************************* Capabilities ============ * **AI Inference**: * Text generation * Image recognition * **Multi-Provider Support**: * Integration with various AI service providers * Load balancing across multiple endpoints * Failover mechanisms for service availability * Cost optimization through provider selection * **:term:`Greyboxing` Support**: * Exposing temperature * Using different providers * Providing built-in functions for text and image manipulation Configuration ============= * **Model Parameters**: * Model selection and version specification * Temperature and sampling parameter control * Maximum token limits and constraints * Custom prompt templates and formatting * **Provider Settings**: * API endpoint configuration and authentication * Timeout and retry policy specification * Cost tracking and budget controls * **Security Controls**: * Content filtering and safety measures * Input validation and sanitization * Output monitoring and compliance checking * Privacy protection and data handling ### 01-core-architecture/03-modules/03-greyboxing.txt Greyboxing ********** It refers to the technique of preventing attacks on LLMs. Implementing it is a responsibility of every node, as bundled presets can be attacked. Greyboxing can be achieved by a few methods: 1. Using different llms, potentially selected based on the request itself 2. Randomizing llm calling parameters 3. Modifying prompts The LLM *Module* provides greyboxing capabilities via lua scripting. Retrieving Data from *Host* =========================== Host can provide additional data to the *Module* to help it make decisions, only transaction id and node address are required, as they are required for signing requests. Current Built-in Filters ======================== To simplify implementation, we provide a set of built-in filters that can be used from the script Text ---- * Zero width character removal * Whitespace normalization * Unicode normalization Image ----- * Unsharpen * GuassianNoise * JPEG reconversion Example Usage ============= args.prompt = lib.rs.filter_text(args.prompt, { 'NFKC', 'RmZeroWidth', 'NormalizeWS' }) args.images[0] = lib.rs.filter_image(args.images[0], { { Unsharpen = { 2.0, 4.0 } }, { GaussianNoise = 0.05 }, { JpegRecompress = 0.8 } }) ### 01-core-architecture/03-modules/index.txt *Module*s ********* Overview of GenVM's core architectural components and design patterns. * Web *Module* * Web Scraping Capabilities * HTTP Request Handling * Security and Compliance * Large Language Model (LLM) Module * Capabilities * Configuration * Greyboxing * Retrieving Data from *Host* * Current Built-in Filters * Example Usage Overview ======== *Module*s provide GenVM with non-deterministic capabilities that extend beyond traditional blockchain operations. These modules enable intelligent contracts to interact with AI services, access web content, and process real-world data while maintaining consensus through specialized validation mechanisms. Module Architecture =================== Design Principles ----------------- * **Isolation**: *Module*s run in separate processes to prevent contamination of deterministic execution * **Extensibility**: Lua scripting support * **Security**: Controlled access Communication Protocol ---------------------- * **WebSocket Interface**: * Asynchronous communication between GenVM and modules * Message serialization using Calldata Encoding * Request-response pattern with timeout handling * Connection lifecycle management and reconnection * **Message Structure**: * Standardized request/response envelope * Type-safe parameter encoding * Error handling and status reporting Module Lifecycle ---------------- * **Initialization**: * Module process startup * Configuration loading and validation * Initial health check * Binding listening address * **Operation**: * Accepting GenVM connections * Request processing and external service interaction * Result validation and transformation * Resource monitoring and usage tracking * Error handling and recovery procedures * **Termination**: * Graceful shutdown and resource cleanup ### 01-core-architecture/index.txt Core Architecture ***************** Overview of GenVM's core architectural components and design patterns. * *GenVM* Components Overview * Introduction * High-Level Architecture * *GenVM* Executor * *Module*s * *Manager* * *Host* Interface Protocol * Overview * Process Management * Communication Protocol * Data Types and Results * Method ID Reference * Error Handling ### 02-vm/01-wasm-runtime.txt Modified *Wasmtime* Runtime *************************** GenVM is based on Wasmtime, the reference WebAssembly runtime, with specific modifications for blockchain use: * **Deterministic Execution**: Modified for reproducible results across validators * **Resource Limits**: Integrated memory constraints * **Error fingerprinting**: Capturing VM state on errors * **Floating Point Handling**: Floating point operations ban in deterministic mode ### 02-vm/index.txt VM and Supervisor Architecture ****************************** * Modified *Wasmtime* Runtime ### appendix/host-loop.txt Host Loop Pseudocode ******************** **Constants**: ACCOUNT_ADDR_SIZE = 20 SLOT_ID_SIZE = 32 **Data Encoding Functions**: write_byte_slice(arr): write_u32_le len(arr) write_bytes arr read_slice(): len := read_u32_le data := read_bytes(len) return data Protocol Loop ============= The *host* processes requests in a loop until "consume_result": loop: method_id := read_byte match method_id json/methods/storage_read: read_type := read_byte as json/storage_type address := read_bytes(ACCOUNT_ADDR_SIZE) slot := read_bytes(SLOT_ID_SIZE) index := read_u32_le len := read_u32_le data, err := host_storage_read(read_type, address, slot, index, len) if err != json/errors/ok: write_byte err else: write_byte json/errors/ok write_bytes data # must be exactly len in size json/methods/consume_result: host_result := read_slice() # this is needed to ensure that genvm doesn't close socket before all data is read write_byte 0x00 break json/methods/get_leader_nondet_result: call_no := read_u32_le data, err := host_get_leader_nondet_result(call_no) if err != json/errors/ok: write_byte err else: write_byte json/errors/ok write_byte_slice data json/methods/post_nondet_result: call_no := read_u32_le result := read_slice() err := host_post_nondet_result(call_no, result) if err != json/errors/ok: write_byte err else: write_byte json/errors/ok json/methods/post_message: address := read_bytes(ACCOUNT_ADDR_SIZE) calldata := read_slice() message_data := read_slice() # JSON string err := host_post_message(address, calldata, message_data) if err != json/errors/ok: write_byte err else: write_byte json/errors/ok json/methods/consume_fuel: gas := read_u64_le host_consume_fuel(gas) # note: this method doesn't send any response json/methods/deploy_contract: calldata := read_slice() code := read_slice() message_data := read_slice() # JSON string err := host_deploy_contract(calldata, code, message_data) if err != json/errors/ok: write_byte err else: write_byte json/errors/ok json/methods/eth_call: address := read_bytes(ACCOUNT_ADDR_SIZE) calldata := read_slice() result, err := host_eth_call(address, calldata) if err != json/errors/ok: write_byte err else: write_byte json/errors/ok write_byte_slice result json/methods/eth_send: address := read_bytes(ACCOUNT_ADDR_SIZE) calldata := read_slice() message_data := read_slice() # JSON string err := host_eth_send(address, calldata, message_data) if err != json/errors/ok: write_byte err else: write_byte json/errors/ok json/methods/get_balance: address := read_bytes(ACCOUNT_ADDR_SIZE) balance, err := host_get_balance(address) if err != json/errors/ok: write_byte err else: write_byte json/errors/ok write_bytes balance.to_le_bytes(32) # 256-bit integer json/methods/remaining_fuel_as_gen: fuel, err := host_remaining_fuel_as_gen() if err != json/errors/ok: write_byte err else: write_byte json/errors/ok write_bytes fuel.to_le_bytes(8) # 64-bit integer, must be safe integer (fits in double) json/methods/notify_nondet_disagreement: call_no := read_u32_le host_notify_nondet_disagreement(call_no) # note: this method doesn't send any response ### appendix/index.txt Appendix ******** * Host Loop Pseudocode * Protocol Loop * Runners Versions * Manager API ### appendix/manager-api.txt Manager API *********** The GenVM Manager is an HTTP server that provides an API for managing GenVM instances, modules, and related operations. GET /status **Get manager status** Returns the current status of the manager, its modules, permits, and running executions. Status Codes: * 200 OK -- Manager status POST /module/start **Start a module** Start a module with the specified configuration. Status Codes: * 200 OK -- Module started successfully * 500 Internal Server Error -- Error response POST /module/stop **Stop a module** Stop a running module. Status Codes: * 200 OK -- Module stop result * 500 Internal Server Error -- Error response POST /genvm/run **Start a GenVM execution** Start a new GenVM instance for contract execution. The request body uses calldata binary encoding (not JSON). The schema below shows the logical structure that must be encoded using the calldata format. Status Codes: * 200 OK -- GenVM instance started * 500 Internal Server Error -- Error response GET /genvm/{genvm_id} **Get GenVM status** Get the status of a specific GenVM instance. Parameters: * **genvm_id** (*integer*) -- Unique identifier of the GenVM instance Status Codes: * 200 OK -- GenVM status * 500 Internal Server Error -- Error response DELETE /genvm/{genvm_id} **Shutdown GenVM instance** Gracefully shutdown a GenVM instance. Parameters: * **genvm_id** (*integer*) -- Unique identifier of the GenVM instance Query Parameters: * **wait_timeout_ms** (*integer*) -- Timeout in milliseconds to wait for graceful shutdown Status Codes: * 200 OK -- Shutdown result POST /contract/detect-version **Detect contract version** Detect the major version specification from contract bytecode. Status Codes: * 200 OK -- Detected version * 500 Internal Server Error -- Error response Request Headers: * **Deployment-Timestamp** -- Contract deployment timestamp in RFC3339 format (Required) POST /log/level **Set log level** Set the logging level for the manager. Status Codes: * 200 OK -- Log level set * 500 Internal Server Error -- Error response POST /manifest/reload **Reload manifest** Reload the executor version manifest. Status Codes: * 200 OK -- Manifest reloaded * 500 Internal Server Error -- Error response POST /env **Set environment variable** Set an environment variable in the manager process. Status Codes: * 200 OK -- Environment variable set * 500 Internal Server Error -- Error response GET /permits **Get permits** Get the current number of execution permits available. Status Codes: * 200 OK -- Current permits POST /permits **Set permits** Set the number of execution permits. Status Codes: * 200 OK -- Permits set * 500 Internal Server Error -- Error response POST /llm/check **Check LLM availability** Test availability and functionality of LLM provider configurations. Status Codes: * 200 OK -- LLM availability results * 500 Internal Server Error -- Error response GET /vm-error/describe **Describe VM error** Get a human-readable description for a VM error code. Query Parameters: * **error** (*string*) -- The VM error code to describe (Required) Status Codes: * 200 OK -- Error description * 500 Internal Server Error -- Error response { "v0.1.0": { "cpython": [ "1s66bd44b80habdw2ayf4hyncvpkmmjwva0h6nkk738flsd5nis0" ], "models-all-MiniLM-L6-v2": [ "1sfhqijjsnsf6ik1zvdv4vxjidrjhsbnk1vgs1c5ksgv193flyqb" ], "py-genlayer": [ "15qfivjvy80800rh998pcxmd2m8va1wq2qzqhz850n8ggcr4i9q0" ], "py-genlayer-multi": [ "0cwifyzi3956f9yxdpq5kk3ihazv2llsxfj626zbadrg4cizwhq5" ], "py-lib-cloudpickle": [ "1pqxan7lxsjrvs66b4a7k81w7rrgbsqi3hxhp7b4bn4gks1b64rb" ], "py-lib-genlayer-embeddings": [ "09h0i209wrzh4xzq86f79c60x0ifs7xcjwl53ysrnw06i54ddxyi" ], "py-lib-genlayer-std": [ "0asq35p8mzlzwgxcrx5v51srnsqyj72cq7993way1vqddwxcvkq4" ], "py-lib-protobuf": [ "0riri6vk1ma3cnmlwls3d4771y0cf3c44afsl6gwfmnl2cpcbdl1" ], "py-lib-word_piece_tokenizer": [ "0m4yvkrbqnyygs4g3mmp11kprylks23q9m0pxnkpm1fg4kpck3qq" ], "softfloat": [ "17b5yad9r9jzcflawqi12r5llhgklfr6lp75r915r99l4wg8ni4n" ] }, "v0.1.3": { "cpython": [ "1s66bd44b80habdw2ayf4hyncvpkmmjwva0h6nkk738flsd5nis0" ], "models-all-MiniLM-L6-v2": [ "1sfhqijjsnsf6ik1zvdv4vxjidrjhsbnk1vgs1c5ksgv193flyqb" ], "py-genlayer": [ "1j12s63yfjpva9ik2xgnffgrs6v44y1f52jvj9w7xvdn7qckd379" ], "py-genlayer-multi": [ "0xn02qjjqlpxadhs124cwrr5ddqs7dxcc6m5a7c6801hv54l66p0" ], "py-lib-cloudpickle": [ "1pqxan7lxsjrvs66b4a7k81w7rrgbsqi3hxhp7b4bn4gks1b64rb" ], "py-lib-genlayer-embeddings": [ "09h0i209wrzh4xzq86f79c60x0ifs7xcjwl53ysrnw06i54ddxyi" ], "py-lib-genlayer-std": [ "1mds1jiy7phn7b7irqviwbl8lp026dsxfkzv88gj0lkmvcqk5aak" ], "py-lib-protobuf": [ "0riri6vk1ma3cnmlwls3d4771y0cf3c44afsl6gwfmnl2cpcbdl1" ], "py-lib-word_piece_tokenizer": [ "0m4yvkrbqnyygs4g3mmp11kprylks23q9m0pxnkpm1fg4kpck3qq" ], "softfloat": [ "17b5yad9r9jzcflawqi12r5llhgklfr6lp75r915r99l4wg8ni4n" ] }, "v0.1.8-runner-hash___": { "cpython": [ "1s66bd44b80habdw2ayf4hyncvpkmmjwva0h6nkk738flsd5nis0" ], "models-all-MiniLM-L6-v2": [ "1sfhqijjsnsf6ik1zvdv4vxjidrjhsbnk1vgs1c5ksgv193flyqb" ], "py-genlayer": [ "132536jbnxkd1axfxg5rpfr5b60cr11adm2y4r90hgn0l59qsp9w" ], "py-genlayer-multi": [ "0iddpsb7hsrqv10xf4sjdiknba0m3fkm2x9xldy7ci3gj1fpkpjy" ], "py-lib-cloudpickle": [ "1pqxan7lxsjrvs66b4a7k81w7rrgbsqi3hxhp7b4bn4gks1b64rb" ], "py-lib-genlayer-embeddings": [ "09h0i209wrzh4xzq86f79c60x0ifs7xcjwl53ysrnw06i54ddxyi" ], "py-lib-genlayer-std": [ "0mmsw09shx3613jzkhbmqyqw60h6b27hy7bjdbb1msfp40g2idi6" ], "py-lib-protobuf": [ "0riri6vk1ma3cnmlwls3d4771y0cf3c44afsl6gwfmnl2cpcbdl1" ], "py-lib-word_piece_tokenizer": [ "0m4yvkrbqnyygs4g3mmp11kprylks23q9m0pxnkpm1fg4kpck3qq" ], "softfloat": [ "17b5yad9r9jzcflawqi12r5llhgklfr6lp75r915r99l4wg8ni4n" ] }, "v0.2.1": { "cpython": [ "1bk9g3zgym0rrpd9lk584cxfaa4rg0cz36w6xhzkqdj1m2p4xa9n" ], "models-all-MiniLM-L6-v2": [ "0d1skbkxl1ij1sfm0jvnh18ih5a9mxfiny0myqnyf0wa5jc50mis" ], "py-genlayer": [ "1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" ], "py-genlayer-multi": [ "06zyvrlivjga0d5jlpdbprksc0pa6jmllxvp8s20hq1l512vh5yk" ], "py-lib-cloudpickle": [ "1dlk6mnfabi0z7r39635amyfzw8xb6rm8bv4pmgv6ji1bfx9hghd" ], "py-lib-genlayer-embeddings": [ "0bmbm3cyfwxsyh454z53vxqjf47wz2q7smcqp1q4g4a6k2kidnyk" ], "py-lib-genlayer-std": [ "11rhn002yfajawsz7fai6mykznbxkxs6l91iskj5cm82c92qhy3v" ], "py-lib-protobuf": [ "0riri6vk1ma3cnmlwls3d4771y0cf3c44afsl6gwfmnl2cpcbdl1" ], "py-lib-word_piece_tokenizer": [ "0vjc9x1qqv7bgkf9aldqsi708892vzh2w7mwzhq6w1174qan4bas" ], "softfloat": [ "08g85lmbfjngvvjyx1gr1pyk61nqba0y42gba8wrb1qd3zkv2gmd" ] }, "v0.2.4": { "cpython": [ "1bk9g3zgym0rrpd9lk584cxfaa4rg0cz36w6xhzkqdj1m2p4xa9n" ], "models-all-MiniLM-L6-v2": [ "0d1skbkxl1ij1sfm0jvnh18ih5a9mxfiny0myqnyf0wa5jc50mis" ], "py-genlayer": [ "1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" ], "py-genlayer-multi": [ "06zyvrlivjga0d5jlpdbprksc0pa6jmllxvp8s20hq1l512vh5yk" ], "py-lib-cloudpickle": [ "1dlk6mnfabi0z7r39635amyfzw8xb6rm8bv4pmgv6ji1bfx9hghd" ], "py-lib-genlayer-embeddings": [ "0bmbm3cyfwxsyh454z53vxqjf47wz2q7smcqp1q4g4a6k2kidnyk" ], "py-lib-genlayer-std": [ "11rhn002yfajawsz7fai6mykznbxkxs6l91iskj5cm82c92qhy3v" ], "py-lib-protobuf": [ "0riri6vk1ma3cnmlwls3d4771y0cf3c44afsl6gwfmnl2cpcbdl1" ], "py-lib-word_piece_tokenizer": [ "0vjc9x1qqv7bgkf9aldqsi708892vzh2w7mwzhq6w1174qan4bas" ], "softfloat": [ "08g85lmbfjngvvjyx1gr1pyk61nqba0y42gba8wrb1qd3zkv2gmd" ] }, "v0.2.5": { "cpython": [ "1bk9g3zgym0rrpd9lk584cxfaa4rg0cz36w6xhzkqdj1m2p4xa9n" ], "models-all-MiniLM-L6-v2": [ "0d1skbkxl1ij1sfm0jvnh18ih5a9mxfiny0myqnyf0wa5jc50mis" ], "py-genlayer": [ "1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" ], "py-genlayer-multi": [ "06zyvrlivjga0d5jlpdbprksc0pa6jmllxvp8s20hq1l512vh5yk" ], "py-lib-cloudpickle": [ "1dlk6mnfabi0z7r39635amyfzw8xb6rm8bv4pmgv6ji1bfx9hghd" ], "py-lib-genlayer-embeddings": [ "0bmbm3cyfwxsyh454z53vxqjf47wz2q7smcqp1q4g4a6k2kidnyk" ], "py-lib-genlayer-std": [ "11rhn002yfajawsz7fai6mykznbxkxs6l91iskj5cm82c92qhy3v" ], "py-lib-protobuf": [ "0riri6vk1ma3cnmlwls3d4771y0cf3c44afsl6gwfmnl2cpcbdl1" ], "py-lib-word_piece_tokenizer": [ "0vjc9x1qqv7bgkf9aldqsi708892vzh2w7mwzhq6w1174qan4bas" ], "softfloat": [ "08g85lmbfjngvvjyx1gr1pyk61nqba0y42gba8wrb1qd3zkv2gmd" ] }, "vTEST": { "cpython": [ "1bk9g3zgym0rrpd9lk584cxfaa4rg0cz36w6xhzkqdj1m2p4xa9n" ], "models-all-MiniLM-L6-v2": [ "0d1skbkxl1ij1sfm0jvnh18ih5a9mxfiny0myqnyf0wa5jc50mis" ], "py-genlayer": [ "1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" ], "py-genlayer-multi": [ "06zyvrlivjga0d5jlpdbprksc0pa6jmllxvp8s20hq1l512vh5yk" ], "py-lib-cloudpickle": [ "1dlk6mnfabi0z7r39635amyfzw8xb6rm8bv4pmgv6ji1bfx9hghd" ], "py-lib-genlayer-embeddings": [ "0bmbm3cyfwxsyh454z53vxqjf47wz2q7smcqp1q4g4a6k2kidnyk" ], "py-lib-genlayer-std": [ "11rhn002yfajawsz7fai6mykznbxkxs6l91iskj5cm82c92qhy3v" ], "py-lib-protobuf": [ "0riri6vk1ma3cnmlwls3d4771y0cf3c44afsl6gwfmnl2cpcbdl1" ], "py-lib-word_piece_tokenizer": [ "0vjc9x1qqv7bgkf9aldqsi708892vzh2w7mwzhq6w1174qan4bas" ], "softfloat": [ "08g85lmbfjngvvjyx1gr1pyk61nqba0y42gba8wrb1qd3zkv2gmd" ] } } ### appendix/runners-versions.txt Runners Versions **************** { "v0.1.0": { "cpython": [ "1s66bd44b80habdw2ayf4hyncvpkmmjwva0h6nkk738flsd5nis0" ], "models-all-MiniLM-L6-v2": [ "1sfhqijjsnsf6ik1zvdv4vxjidrjhsbnk1vgs1c5ksgv193flyqb" ], "py-genlayer": [ "15qfivjvy80800rh998pcxmd2m8va1wq2qzqhz850n8ggcr4i9q0" ], "py-genlayer-multi": [ "0cwifyzi3956f9yxdpq5kk3ihazv2llsxfj626zbadrg4cizwhq5" ], "py-lib-cloudpickle": [ "1pqxan7lxsjrvs66b4a7k81w7rrgbsqi3hxhp7b4bn4gks1b64rb" ], "py-lib-genlayer-embeddings": [ "09h0i209wrzh4xzq86f79c60x0ifs7xcjwl53ysrnw06i54ddxyi" ], "py-lib-genlayer-std": [ "0asq35p8mzlzwgxcrx5v51srnsqyj72cq7993way1vqddwxcvkq4" ], "py-lib-protobuf": [ "0riri6vk1ma3cnmlwls3d4771y0cf3c44afsl6gwfmnl2cpcbdl1" ], "py-lib-word_piece_tokenizer": [ "0m4yvkrbqnyygs4g3mmp11kprylks23q9m0pxnkpm1fg4kpck3qq" ], "softfloat": [ "17b5yad9r9jzcflawqi12r5llhgklfr6lp75r915r99l4wg8ni4n" ] }, "v0.1.3": { "cpython": [ "1s66bd44b80habdw2ayf4hyncvpkmmjwva0h6nkk738flsd5nis0" ], "models-all-MiniLM-L6-v2": [ "1sfhqijjsnsf6ik1zvdv4vxjidrjhsbnk1vgs1c5ksgv193flyqb" ], "py-genlayer": [ "1j12s63yfjpva9ik2xgnffgrs6v44y1f52jvj9w7xvdn7qckd379" ], "py-genlayer-multi": [ "0xn02qjjqlpxadhs124cwrr5ddqs7dxcc6m5a7c6801hv54l66p0" ], "py-lib-cloudpickle": [ "1pqxan7lxsjrvs66b4a7k81w7rrgbsqi3hxhp7b4bn4gks1b64rb" ], "py-lib-genlayer-embeddings": [ "09h0i209wrzh4xzq86f79c60x0ifs7xcjwl53ysrnw06i54ddxyi" ], "py-lib-genlayer-std": [ "1mds1jiy7phn7b7irqviwbl8lp026dsxfkzv88gj0lkmvcqk5aak" ], "py-lib-protobuf": [ "0riri6vk1ma3cnmlwls3d4771y0cf3c44afsl6gwfmnl2cpcbdl1" ], "py-lib-word_piece_tokenizer": [ "0m4yvkrbqnyygs4g3mmp11kprylks23q9m0pxnkpm1fg4kpck3qq" ], "softfloat": [ "17b5yad9r9jzcflawqi12r5llhgklfr6lp75r915r99l4wg8ni4n" ] }, "v0.1.8-runner-hash___": { "cpython": [ "1s66bd44b80habdw2ayf4hyncvpkmmjwva0h6nkk738flsd5nis0" ], "models-all-MiniLM-L6-v2": [ "1sfhqijjsnsf6ik1zvdv4vxjidrjhsbnk1vgs1c5ksgv193flyqb" ], "py-genlayer": [ "132536jbnxkd1axfxg5rpfr5b60cr11adm2y4r90hgn0l59qsp9w" ], "py-genlayer-multi": [ "0iddpsb7hsrqv10xf4sjdiknba0m3fkm2x9xldy7ci3gj1fpkpjy" ], "py-lib-cloudpickle": [ "1pqxan7lxsjrvs66b4a7k81w7rrgbsqi3hxhp7b4bn4gks1b64rb" ], "py-lib-genlayer-embeddings": [ "09h0i209wrzh4xzq86f79c60x0ifs7xcjwl53ysrnw06i54ddxyi" ], "py-lib-genlayer-std": [ "0mmsw09shx3613jzkhbmqyqw60h6b27hy7bjdbb1msfp40g2idi6" ], "py-lib-protobuf": [ "0riri6vk1ma3cnmlwls3d4771y0cf3c44afsl6gwfmnl2cpcbdl1" ], "py-lib-word_piece_tokenizer": [ "0m4yvkrbqnyygs4g3mmp11kprylks23q9m0pxnkpm1fg4kpck3qq" ], "softfloat": [ "17b5yad9r9jzcflawqi12r5llhgklfr6lp75r915r99l4wg8ni4n" ] }, "v0.2.1": { "cpython": [ "1bk9g3zgym0rrpd9lk584cxfaa4rg0cz36w6xhzkqdj1m2p4xa9n" ], "models-all-MiniLM-L6-v2": [ "0d1skbkxl1ij1sfm0jvnh18ih5a9mxfiny0myqnyf0wa5jc50mis" ], "py-genlayer": [ "1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" ], "py-genlayer-multi": [ "06zyvrlivjga0d5jlpdbprksc0pa6jmllxvp8s20hq1l512vh5yk" ], "py-lib-cloudpickle": [ "1dlk6mnfabi0z7r39635amyfzw8xb6rm8bv4pmgv6ji1bfx9hghd" ], "py-lib-genlayer-embeddings": [ "0bmbm3cyfwxsyh454z53vxqjf47wz2q7smcqp1q4g4a6k2kidnyk" ], "py-lib-genlayer-std": [ "11rhn002yfajawsz7fai6mykznbxkxs6l91iskj5cm82c92qhy3v" ], "py-lib-protobuf": [ "0riri6vk1ma3cnmlwls3d4771y0cf3c44afsl6gwfmnl2cpcbdl1" ], "py-lib-word_piece_tokenizer": [ "0vjc9x1qqv7bgkf9aldqsi708892vzh2w7mwzhq6w1174qan4bas" ], "softfloat": [ "08g85lmbfjngvvjyx1gr1pyk61nqba0y42gba8wrb1qd3zkv2gmd" ] }, "v0.2.4": { "cpython": [ "1bk9g3zgym0rrpd9lk584cxfaa4rg0cz36w6xhzkqdj1m2p4xa9n" ], "models-all-MiniLM-L6-v2": [ "0d1skbkxl1ij1sfm0jvnh18ih5a9mxfiny0myqnyf0wa5jc50mis" ], "py-genlayer": [ "1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" ], "py-genlayer-multi": [ "06zyvrlivjga0d5jlpdbprksc0pa6jmllxvp8s20hq1l512vh5yk" ], "py-lib-cloudpickle": [ "1dlk6mnfabi0z7r39635amyfzw8xb6rm8bv4pmgv6ji1bfx9hghd" ], "py-lib-genlayer-embeddings": [ "0bmbm3cyfwxsyh454z53vxqjf47wz2q7smcqp1q4g4a6k2kidnyk" ], "py-lib-genlayer-std": [ "11rhn002yfajawsz7fai6mykznbxkxs6l91iskj5cm82c92qhy3v" ], "py-lib-protobuf": [ "0riri6vk1ma3cnmlwls3d4771y0cf3c44afsl6gwfmnl2cpcbdl1" ], "py-lib-word_piece_tokenizer": [ "0vjc9x1qqv7bgkf9aldqsi708892vzh2w7mwzhq6w1174qan4bas" ], "softfloat": [ "08g85lmbfjngvvjyx1gr1pyk61nqba0y42gba8wrb1qd3zkv2gmd" ] }, "v0.2.5": { "cpython": [ "1bk9g3zgym0rrpd9lk584cxfaa4rg0cz36w6xhzkqdj1m2p4xa9n" ], "models-all-MiniLM-L6-v2": [ "0d1skbkxl1ij1sfm0jvnh18ih5a9mxfiny0myqnyf0wa5jc50mis" ], "py-genlayer": [ "1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" ], "py-genlayer-multi": [ "06zyvrlivjga0d5jlpdbprksc0pa6jmllxvp8s20hq1l512vh5yk" ], "py-lib-cloudpickle": [ "1dlk6mnfabi0z7r39635amyfzw8xb6rm8bv4pmgv6ji1bfx9hghd" ], "py-lib-genlayer-embeddings": [ "0bmbm3cyfwxsyh454z53vxqjf47wz2q7smcqp1q4g4a6k2kidnyk" ], "py-lib-genlayer-std": [ "11rhn002yfajawsz7fai6mykznbxkxs6l91iskj5cm82c92qhy3v" ], "py-lib-protobuf": [ "0riri6vk1ma3cnmlwls3d4771y0cf3c44afsl6gwfmnl2cpcbdl1" ], "py-lib-word_piece_tokenizer": [ "0vjc9x1qqv7bgkf9aldqsi708892vzh2w7mwzhq6w1174qan4bas" ], "softfloat": [ "08g85lmbfjngvvjyx1gr1pyk61nqba0y42gba8wrb1qd3zkv2gmd" ] }, "vTEST": { "cpython": [ "1bk9g3zgym0rrpd9lk584cxfaa4rg0cz36w6xhzkqdj1m2p4xa9n" ], "models-all-MiniLM-L6-v2": [ "0d1skbkxl1ij1sfm0jvnh18ih5a9mxfiny0myqnyf0wa5jc50mis" ], "py-genlayer": [ "1jb45aa8ynh2a9c9xn3b7qqh8sm5q93hwfp7jqmwsfhh8jpz09h6" ], "py-genlayer-multi": [ "06zyvrlivjga0d5jlpdbprksc0pa6jmllxvp8s20hq1l512vh5yk" ], "py-lib-cloudpickle": [ "1dlk6mnfabi0z7r39635amyfzw8xb6rm8bv4pmgv6ji1bfx9hghd" ], "py-lib-genlayer-embeddings": [ "0bmbm3cyfwxsyh454z53vxqjf47wz2q7smcqp1q4g4a6k2kidnyk" ], "py-lib-genlayer-std": [ "11rhn002yfajawsz7fai6mykznbxkxs6l91iskj5cm82c92qhy3v" ], "py-lib-protobuf": [ "0riri6vk1ma3cnmlwls3d4771y0cf3c44afsl6gwfmnl2cpcbdl1" ], "py-lib-word_piece_tokenizer": [ "0vjc9x1qqv7bgkf9aldqsi708892vzh2w7mwzhq6w1174qan4bas" ], "softfloat": [ "08g85lmbfjngvvjyx1gr1pyk61nqba0y42gba8wrb1qd3zkv2gmd" ] } } ### glossary.txt Glossary ******** Greyboxing A set of techniques to prevent forcing LLMs to do unintended by contract creator actions. Host The blockchain node that runs GenVM and communicates with it. Module External service providing non-deterministic capabilities. Manager The GenVM component responsible for managing modules and GenVM versions. ### index.txt GenVM Implementation Specification ********************************** Note: Single text file docs for AI This is a specification of this implementation of GenVM. The specification has been split into multiple sections for better organization and maintainability. Contents: ^^^^^^^^^ * Glossary * Core Architecture * *GenVM* Components Overview * Introduction * High-Level Architecture * *GenVM* Executor * *Module*s * *Manager* * *Host* Interface Protocol * Overview * Process Management * Communication Protocol * Data Types and Results * Method ID Reference * Error Handling * VM and Supervisor Architecture * Modified *Wasmtime* Runtime * Appendix * Host Loop Pseudocode * Protocol Loop * Runners Versions * Manager API