-
Notifications
You must be signed in to change notification settings - Fork 189
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
Precompile Backend #562
Draft
Roee-87
wants to merge
20
commits into
a16z:main
Choose a base branch
from
Roee-87:rr-jolt-precompile-backend
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Precompile Backend #562
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
9d21aa7
added precompile code for common directory
Roee-87 e7e56aa
added comments for jolt-core/jolt/instruction/ecall.rs
Roee-87 c2d1abb
added prcompile directory to jotl-core/jolt/
Roee-87 337af2a
added precompile template code to jolt-sdk
Roee-87 379541c
added skeleton code for ecall.rs
Roee-87 8b15c33
removed extra two virtual advice registers
Roee-87 ab4d42d
added prove and verify placeholder functions in jolt-sdk/macros/lib.rs
Roee-87 9d0231a
added skeleton code to tracer/src/emulator/cpu.rs
Roee-87 053d7f3
added set_precompile_output_word() to mmu.rs
Roee-87 da40ee3
updated mmu precompile methods
Roee-87 3f38bd5
updated cpu.rs
Roee-87 f65d5f3
added ok(()) to ecall method
Roee-87 e85ddbe
updated precompile mod.rs for jolt-core
Roee-87 691efe6
added 16 advice instruction to ecall.rs
Roee-87 b70ce3c
added 16 advice instructions to ecall.rs
Roee-87 8f06579
added conditional for precompile output to load method
Roee-87 e813eac
fixed typo
Roee-87 b3b57ae
unsure of how to handle store() method in rv_trace.rs
Roee-87 9499b18
refactored rv_trace.rs to include conditionals for precompiles in sto…
Roee-87 c972066
added correct address for panic mem region
Roee-87 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
This file contains 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,15 @@ | ||
pub fn bn254_add(input_1: [u8; 16], input_2: [u8; 16]) -> [u8; 16] { | ||
// This is a placeholder for the actual implementation. | ||
[0; 16] | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
#[test] | ||
fn test_bn254_add() { | ||
let input_1 = [1; 16]; | ||
let input_2 = [2; 16]; | ||
let expected_output = [3; 16]; | ||
assert_eq!(bn254_add(input_1, input_2), expected_output); | ||
} | ||
} |
This file contains 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 @@ | ||
pub mod bn254_add; | ||
|
||
pub enum Precompile { | ||
Bn254_add, | ||
} | ||
|
||
impl Precompile { | ||
pub fn from_u64(value: u64) -> Option<Self> { | ||
match value { | ||
0 => None, | ||
1 => Some(Precompile::Bn254_add), | ||
_ => None, | ||
} | ||
} | ||
|
||
pub fn execute(&self, inputs: &[u8]) -> Vec<u8> { | ||
match self { | ||
Precompile::Bn254_add => bn254_add::bn254_add(inputs), | ||
} | ||
} | ||
} | ||
// trait to deserialize the raw input bytes and serialize the outputs |
This file contains 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 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 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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The store method only takes one value as an input. Should there be additional Option inputs for precompile input and output?