-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add two_plus_two Jolt zkVM puzzle wp
- Loading branch information
Xor0v0
authored and
Xor0v0
committed
Oct 1, 2024
1 parent
48d1313
commit 1fb95eb
Showing
21 changed files
with
4,084 additions
and
10 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,19 @@ | ||
FROM rust:1.67 | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY ./jolt ./jolt | ||
COPY ./server ./server | ||
|
||
WORKDIR /usr/src/app/server | ||
|
||
RUN cargo build --release | ||
|
||
# run the server once just to download the toolchain, this will crash but we do not care | ||
# god has already forgiven me for this | ||
# (also this has nothing to do with the challenge itself) | ||
RUN (echo "" | ./target/release/challenge); true | ||
|
||
RUN apt update && apt install -y socat | ||
|
||
ENTRYPOINT ["socat", "-t", "900", "-T", "120", "TCP4-LISTEN:5555,reuseaddr,fork", "EXEC:./target/release/challenge"] |
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,19 @@ | ||
diff --git a/jolt-core/src/r1cs/jolt_constraints.rs b/jolt-core/src/r1cs/jolt_constraints.rs | ||
index 5fb0d871..295dce32 100644 | ||
--- a/jolt-core/src/r1cs/jolt_constraints.rs | ||
+++ b/jolt-core/src/r1cs/jolt_constraints.rs | ||
@@ -289,13 +289,8 @@ impl<F: JoltField> R1CSConstraintBuilder<F> for UniformJoltConstraints { | ||
|
||
// if (rd != 0 && update_rd_with_lookup_output == 1) constrain(rd_val == LookupOutput) | ||
// if (rd != 0 && is_jump_instr == 1) constrain(rd_val == 4 * PC) | ||
- let rd_nonzero_and_lookup_to_rd = | ||
+ let _rd_nonzero_and_lookup_to_rd = | ||
cs.allocate_prod(JoltIn::Bytecode_RD, JoltIn::OpFlags_LookupOutToRd); | ||
- cs.constrain_eq_conditional( | ||
- rd_nonzero_and_lookup_to_rd, | ||
- JoltIn::RD_Write, | ||
- JoltIn::LookupOutput, | ||
- ); | ||
let rd_nonzero_and_jmp = cs.allocate_prod(JoltIn::Bytecode_RD, JoltIn::OpFlags_IsJmp); | ||
let lhs = JoltIn::Bytecode_ELFAddress + (PC_START_ADDRESS - PC_NOOP_SHIFT); | ||
let rhs = JoltIn::RD_Write; |
Submodule jolt
added at
0cc7aa
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,9 @@ | ||
# Author: @gio-d3141 | ||
# Dockerfile should build fine (will take a while) but the setup is kind of cursed, DM me if necessary | ||
|
||
git clone git@github.com:a16z/jolt.git | ||
cd jolt | ||
|
||
# just the latest commit at time of writing | ||
git checkout 0cc7aa31981ff8503fe256706d2aa9c320abd1cd | ||
git apply ../diff.patch |
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 @@ | ||
target/ |
Oops, something went wrong.