Commit 7846d16
authored
fix(challenge-sdk-wasm): align host function signatures and extend SDK types (#17)
* fix(challenge-sdk-wasm): align host function signatures with runtime interface
- Fix http_get, http_post, dns_resolve extern signatures to use 4 params
(req_ptr, req_len, resp_ptr, resp_len) matching the host linker registrations
- Add http_request extern for the generic HTTP host function
- Fix storage externs: rename storage_set to storage_propose_write, add
storage_delete, update return types to match host pack_result convention
- Update all wrapper functions to pass correct arguments
- Change host_http_post to accept single serialized request (body is part
of the HttpPostRequest struct deserialized by the host)
* feat(challenge-sdk-wasm): extend guest SDK types and add platform host functions
Extend the guest SDK to support richer evaluation types and new host
function modules needed by term-challenge.
Types (types.rs): Add optional fields to EvaluationInput (submission_id,
participant_id, epoch, metadata) and EvaluationOutput (score_f64, results,
execution_time_ms) with #[serde(default)] for backward compatibility. Update
the success() and error() constructors to initialize new fields as None.
Host functions (host_functions.rs): Add platform_exec module with
exec_command(cmd_ptr, cmd_len, resp_ptr, resp_len) -> i32 for sandboxed
command execution, and platform_time module with get_timestamp() -> i64.
Include safe Rust wrappers host_exec_command() and host_get_timestamp().
Trait (lib.rs): Add challenge_id() method to the Challenge trait with a
default implementation that delegates to name().
* ci: trigger CI after merge conflict resolution1 parent cfc8101 commit 7846d16
File tree
0 file changed
+0
-0
lines changed0 file changed
+0
-0
lines changed
0 commit comments