Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement read_buf for zkVM stdin #137349

Merged
merged 1 commit into from
Feb 25, 2025

Conversation

thaliaarchi
Copy link
Contributor

@thaliaarchi thaliaarchi commented Feb 20, 2025

For the zkVM, even when a guest buffer is uninitialized, from the host's perspective it is just a normal piece of memory which was initialized before letting the guest write into it. This makes sys_read safe to use with an uninitialized buffer. See risc0/risc0#2853.

cc @bobbobbio, @flaub

r? @Noratrieb

Tracked in #136756

For the zkVM, even when a guest buffer is uninitialized, from the host's
perspective it is just a normal piece of memory which was initialized
before letting the guest write into it. This makes `sys_read` safe to
use with an uninitialized buffer. See
risc0/risc0#2853.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 20, 2025
@Noratrieb
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Feb 23, 2025

📌 Commit 98b0f05 has been approved by Noratrieb

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 23, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 25, 2025
Rollup of 8 pull requests

Successful merges:

 - rust-lang#134655 (Stabilize `hash_extract_if`)
 - rust-lang#135933 (Explain how Vec::with_capacity is faithful)
 - rust-lang#136668 (Stabilize `core::str::from_utf8_mut` as `const`)
 - rust-lang#136775 (Update `String::from_raw_parts` safety requirements)
 - rust-lang#137109 (stabilize extract_if)
 - rust-lang#137349 (Implement `read_buf` for zkVM stdin)
 - rust-lang#137493 (configure.py: don't instruct user to run nonexistent program)
 - rust-lang#137516 (remove some unnecessary rustc_const_unstable)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5094010 into rust-lang:master Feb 25, 2025
6 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Feb 25, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 25, 2025
Rollup merge of rust-lang#137349 - thaliaarchi:io-optional-methods/zkvm, r=Noratrieb

Implement `read_buf` for zkVM stdin

For the zkVM, even when a guest buffer is uninitialized, from the host's perspective it is just a normal piece of memory which was initialized before letting the guest write into it. This makes `sys_read` safe to use with an uninitialized buffer. See risc0/risc0#2853.

cc `@bobbobbio,` `@flaub`

r? `@Noratrieb`

Tracked in rust-lang#136756
@thaliaarchi thaliaarchi deleted the io-optional-methods/zkvm branch February 25, 2025 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants