Skip to content

Commit 694c947

Browse files
committed
fix: cache compiled WASM module in execute_get_routes_from_bytes
This ensures the module is available for call_route later
1 parent 80d2a85 commit 694c947

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

bins/validator-node/src/wasm_executor.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,13 @@ impl WasmChallengeExecutor {
697697
.compile_module(wasm_bytes)
698698
.map_err(|e| anyhow::anyhow!("Failed to compile WASM module: {}", e))?;
699699

700+
// Cache the compiled module for later use by call_route
701+
let module = Arc::new(module);
702+
{
703+
let mut cache = self.module_cache.write();
704+
cache.insert(module_id.to_string(), Arc::clone(&module));
705+
}
706+
700707
// Note: Don't pass extra host functions - instantiate() already registers all of them
701708
let instance_config = InstanceConfig {
702709
network_policy: network_policy.clone(),

0 commit comments

Comments
 (0)