Skip to content

feat(proto): reveal oracle request for simulation#1419

Open
ryutamago wants to merge 1 commit intomainfrom
leounoki/jstz-1048-reveal-oracle
Open

feat(proto): reveal oracle request for simulation#1419
ryutamago wants to merge 1 commit intomainfrom
leounoki/jstz-1048-reveal-oracle

Conversation

@ryutamago
Copy link
Collaborator

@ryutamago ryutamago commented Dec 11, 2025

Context

This is the final step enable oracle simulation in the kernel.

Closes: JSTZ-1048

Description

  • Moved Revealer trait to jstz_core: This makes the trait available for both simulation and non-simulation modes.

  • Refactored process_and_dispatch_request: Split the implementation into:

    • process_and_dispatch_request_impl<Rv: Revealer> - A generic implementation that accepts any type implementing Revealer
    • Two feature-gated wrapper functions process_and_dispatch_request that call the impl with:
      • HostRevealer for simulation mode (uses reveal channel for oracle requests)
      • () stub type for non-simulation mode (oracle requests use protocol context instead )
  • Added simulation oracle dispatch: Implemented dispatch_oracle::<Rv> for simulation mode that encodes HTTP requests and sends them via the reveal channel using simulation::send_request.

  • Added error conversion: Implemented From<jstz_core::Error> for Response to handle reveal channel error.

  • Cleaned up the imports of fetch_handler.rs: grouped the imports by crates

  • Updated Makefile to run proto test with the simulation feature

Manually testing the PR

  • existing test passes
  • cargo nextest run -p jstz_proto --features v2_runtime,simulation

@ryutamago ryutamago force-pushed the leounoki/jstz-1048-reveal-oracle branch from 575cc3e to e39d7e5 Compare December 11, 2025 17:13
@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

❌ Patch coverage is 77.27273% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.61%. Comparing base (f0500f6) to head (31d9895).

Files with missing lines Patch % Lines
crates/jstz_proto/src/runtime/v2/fetch/http.rs 0.00% 8 Missing ⚠️
crates/jstz_core/src/revealer.rs 0.00% 2 Missing ⚠️
Files with missing lines Coverage Δ
...s/jstz_proto/src/runtime/v2/fetch/fetch_handler.rs 95.86% <100.00%> (+0.02%) ⬆️
crates/jstz_core/src/revealer.rs 0.00% <0.00%> (ø)
crates/jstz_proto/src/runtime/v2/fetch/http.rs 94.81% <0.00%> (-1.83%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f0500f6...31d9895. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ryutamago ryutamago changed the title Leounoki/jstz 1048 reveal oracle feat(proto): reveal oracle request for simulation Dec 16, 2025
@ryutamago ryutamago force-pushed the leounoki/jstz-1048-reveal-oracle branch from e39d7e5 to 337f494 Compare December 16, 2025 12:58
@ryutamago ryutamago requested a review from zcabter December 16, 2025 13:27
@ryutamago ryutamago force-pushed the leounoki/jstz-1048-reveal-oracle branch from 337f494 to a41b7c6 Compare December 16, 2025 16:27
@ryutamago ryutamago force-pushed the leounoki/jstz-1048-reveal-oracle branch from a41b7c6 to 31d9895 Compare January 2, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants