-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/ef io interface #579
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
Merged
Merged
Feat/ef io interface #579
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
22f99d9
ppend public output across commit ECALLs and raise the totalcap to 64 KB
jotabulacios bfd9912
Add the EF zkVM IO interface
jotabulacios c29f380
lint
jotabulacios 9f297e8
Raise public output cap to 1 MB, guard load_bytes overflow, drop no_m…
jotabulacios 18aa907
Return Result from load_bytes to drop the guest-reachable panic in Pr…
jotabulacios 49aa99b
Merge branch 'main' into feature/ef-io-interface
jotabulacios 0509fa6
adress comments
jotabulacios 3d14e56
Use usize::try_from
jotabulacios b02891b
Guard private input length cast and cross-check public_output before …
jotabulacios 703d082
Merge branch 'main' into feature/ef-io-interface
jotabulacios File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| [target.riscv64im-lambda-vm-elf] | ||
| rustflags = [ | ||
| "--cfg", "getrandom_backend=\"custom\"", | ||
| "-C", "passes=lower-atomic" | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| [workspace] | ||
|
|
||
| [package] | ||
| name = "ef_io_demo" | ||
| version = "0.1.0" | ||
| edition = "2024" | ||
|
|
||
| [dependencies] | ||
| lambda-vm-syscalls = { path = "../../../../syscalls" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| // Demo guest exercising the EF zkVM IO interface (`read_input` / `write_output`). | ||
| // | ||
| // Reads the private input via the EF zero-copy `read_input` shim, then emits it | ||
| // back as the public output in TWO `write_output` calls (split in halves) to | ||
| // exercise the multi-call concatenation requirement of the EF spec. | ||
| use lambda_vm_syscalls as syscalls; | ||
|
|
||
| pub fn main() { | ||
| let mut buf_ptr: *const u8 = core::ptr::null(); | ||
| let mut buf_size: usize = 0; | ||
| unsafe { | ||
| syscalls::ef_io::read_input(&mut buf_ptr, &mut buf_size); | ||
| } | ||
|
|
||
| if buf_size > 0 { | ||
| let half = buf_size / 2; | ||
| unsafe { | ||
| syscalls::ef_io::write_output(buf_ptr, half); | ||
| syscalls::ef_io::write_output(buf_ptr.add(half), buf_size - half); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.