Skip to content

feat(kernel): publish simulation receipt at the end of simulation#1414

Open
zcabter wants to merge 1 commit intomainfrom
ryan/jstz-998
Open

feat(kernel): publish simulation receipt at the end of simulation#1414
zcabter wants to merge 1 commit intomainfrom
ryan/jstz-998

Conversation

@zcabter
Copy link
Collaborator

@zcabter zcabter commented Dec 9, 2025

Context

A simulation receipt needs to be published at the end of simulation. Today, the simulation receipt looks very similar to a Receipt but later on, it will contain more metadata about the simulation like gas.

Closes https://linear.app/tezos/issue/JSTZ-998/publish-simulation-receipt-event-when-simulation

Description

Added SimulationReceipt event and publish_receipt to control how receipts are published. If simulation, then we publish the event, otherwise publish original receipt debug logs. The original debug log behaviour is maintained as it is not related to this PR.

Manually testing the PR

cargo nextest run -p jstz_kernel --features riscv_kernel,simulation

@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

❌ Patch coverage is 0% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.32%. Comparing base (ad83e73) to head (22c54bd).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/kernels/jstz_kernel/src/lib.rs 0.00% 12 Missing ⚠️
crates/jstz_proto/src/receipt.rs 0.00% 9 Missing ⚠️
crates/jstz_proto/src/executor/fa_deposit.rs 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
crates/jstz_proto/src/operation.rs 97.34% <ø> (ø)
crates/jstz_proto/src/executor/fa_deposit.rs 92.37% <0.00%> (ø)
crates/jstz_proto/src/receipt.rs 60.86% <0.00%> (-9.14%) ⬇️
crates/kernels/jstz_kernel/src/lib.rs 48.07% <0.00%> (-12.90%) ⬇️

... and 1 file with indirect coverage changes


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 ad83e73...22c54bd. 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.

@zcabter zcabter requested a review from ryutamago December 11, 2025 10:26
Base automatically changed from ryan/jstz-997 to main December 11, 2025 11:15
"tezos-smart-rollup/extra",
"tezos-smart-rollup/native-kernel",
]
simulation = ["jstz_core/simulation", "jstz_proto/simulation"]
Copy link
Collaborator

@ryutamago ryutamago Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since jstz_proto already enables jstz_core/simulation we can remove redundancy by:

Suggested change
simulation = ["jstz_core/simulation", "jstz_proto/simulation"]
simulation = ["jstz_proto/simulation"]

@ryutamago ryutamago assigned zcabter and unassigned ryutamago Dec 16, 2025
Comment on lines +2 to +7
#[cfg(feature = "simulation")]
use jstz_core::event::EventPublish;
use jstz_core::kv::{Storage, Transaction};
use jstz_crypto::{public_key::PublicKey, smart_function_hash::SmartFunctionHash};
use jstz_proto::executor;
#[cfg(feature = "simulation")]
use jstz_proto::receipt::SimulationReceipt;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

#[cfg(feature = "simulation")]
use { jstz_core::event::EventPublish, jstz_proto::receipt::SimulationReceipt}

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

Comments