Skip to content

Commit 8e2385a

Browse files
committed
clean up
1 parent 7482636 commit 8e2385a

File tree

3 files changed

+8
-41
lines changed

3 files changed

+8
-41
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ serde_json = "1.0.140"
2424
base64 = "0.22.1"
2525
schemars = "1.0.0-alpha.17"
2626

27-
# Uncomment for debugging with https://github.com/ed255/plonky2/tree/feat/debug
28-
[patch."https://github.com/0xPolygonZero/plonky2"]
29-
plonky2 = { path = "../plonky2/plonky2" }
27+
# Uncomment for debugging with https://github.com/ed255/plonky2/ at branch `feat/debug`. The repo directory needs to be checked out next to the pod2 repo directory.
28+
# [patch."https://github.com/0xPolygonZero/plonky2"]
29+
# plonky2 = { path = "../plonky2/plonky2" }
3030

3131
[features]
3232
default = ["backend_plonky2"]

src/backends/plonky2/circuits/mainpod.rs

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ impl OperationVerifyGate {
269269
op_code_ok,
270270
op_arg_types_ok,
271271
op_arg_range_ok,
272-
op_args_eq, // FAILING
273-
st_ok, // FAILING
272+
op_args_eq,
273+
st_ok,
274274
])
275275
}
276276

@@ -465,8 +465,6 @@ impl MainPodVerifyGate {
465465
.collect();
466466
let id = builder.hash_n_to_hash_no_pad::<PoseidonHash>(pub_statements_flattened);
467467

468-
// 3. TODO check that all `input_statements` of type `ValueOf` with origin=SELF have unique keys (no duplicates). Maybe we can do this via the NewEntry operation (check that the key doesn't exist in a previous statement with ID=SELF)
469-
470468
// 4. Verify type
471469
let type_statement = &pub_statements[0];
472470
// TODO: Store this hash in a global static with lazy init so that we don't have to
@@ -480,6 +478,8 @@ impl MainPodVerifyGate {
480478
);
481479
builder.connect_flattenable(type_statement, &expected_type_statement);
482480

481+
// 3. check that all `input_statements` of type `ValueOf` with origin=SELF have unique keys
482+
// (no duplicates). We do this in the verification of NewEntry operation.
483483
// 5. Verify input statements
484484
let mut op_verifications = Vec::new();
485485
for (i, (st, op)) in input_statements.iter().zip(operations.iter()).enumerate() {
@@ -645,29 +645,6 @@ mod tests {
645645
Ok(())
646646
}
647647

648-
#[test]
649-
fn test_operation_verify_eq_from_entries() -> Result<()> {
650-
let st1: mainpod::Statement =
651-
Statement::ValueOf(AnchoredKey(SELF, "hello".into()), 55.into()).into();
652-
let st2: mainpod::Statement = Statement::ValueOf(
653-
AnchoredKey(PodId(Value::from(75).into()), "world".into()),
654-
55.into(),
655-
)
656-
.into();
657-
let st: mainpod::Statement = Statement::Equal(
658-
AnchoredKey(SELF, "hello".into()),
659-
AnchoredKey(PodId(Value::from(75).into()), "world".into()),
660-
)
661-
.into();
662-
let op = mainpod::Operation(
663-
OperationType::Native(NativeOperation::EqualFromEntries),
664-
vec![OperationArg::Index(0), OperationArg::Index(1)],
665-
OperationAux::None,
666-
);
667-
let prev_statements = vec![st1.clone(), st2];
668-
operation_verify(st, op, prev_statements)
669-
}
670-
671648
#[test]
672649
fn test_operation_verify() -> Result<()> {
673650
// None

src/backends/plonky2/mainpod.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,14 @@ impl PodProver for Prover {
5151
let operations = MockMainPod::process_private_statements_operations(
5252
params,
5353
&statements,
54-
&[], // TODO: fill in the merkle proofs
54+
&[], // TODO: fill in the merkle proofs for Contains/NotContains ops
5555
inputs.operations,
5656
)
5757
.unwrap();
5858
let operations =
5959
MockMainPod::process_public_statements_operations(params, &statements, operations)
6060
.unwrap();
6161

62-
// for (i, op) in statements.iter().enumerate() {
63-
// println!("DBG st {}: {:?}", i, op);
64-
// }
65-
6662
let public_statements =
6763
statements[statements.len() - params.max_public_statements..].to_vec();
6864
// get the id out of the public statements
@@ -75,12 +71,6 @@ impl PodProver for Prover {
7571
};
7672
main_pod.set_targets(&mut pw, &input)?;
7773

78-
// for (target, name) in &builder.target_names {
79-
// if let Some(v) = pw.target_values.get(target) {
80-
// println!("DBG {}={}", name, v);
81-
// }
82-
// }
83-
8474
// generate & verify proof
8575
let data = builder.build::<C>();
8676
let proof = data.prove(pw)?;

0 commit comments

Comments
 (0)