From 0603d602d0f0aa7b2ed4d23396479338601ceacb Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Wed, 4 May 2022 23:57:26 +0000 Subject: [PATCH] Rename `anchor` to `root`, and `pub_input_anchor` to `anchor` This ensures that we are consistent in the circuit in referring to the public bundle anchor as `anchor`, and the calculated Merkle tree root as `root`. --- src/circuit.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/circuit.rs b/src/circuit.rs index 7e1faa65..7accc42d 100644 --- a/src/circuit.rs +++ b/src/circuit.rs @@ -145,7 +145,7 @@ impl plonk::Circuit for Circuit { ]; // Constrain v_old - v_new = magnitude * sign - // Either v_old = 0, or anchor equals public input + // Either v_old = 0, or calculated root = anchor // Constrain v_old = 0 or enable_spends = 1. // Constrain v_new = 0 or enable_outputs = 1. let q_orchard = meta.selector(); @@ -156,8 +156,8 @@ impl plonk::Circuit for Circuit { let magnitude = meta.query_advice(advices[2], Rotation::cur()); let sign = meta.query_advice(advices[3], Rotation::cur()); - let anchor = meta.query_advice(advices[4], Rotation::cur()); - let pub_input_anchor = meta.query_advice(advices[5], Rotation::cur()); + let root = meta.query_advice(advices[4], Rotation::cur()); + let anchor = meta.query_advice(advices[5], Rotation::cur()); let enable_spends = meta.query_advice(advices[6], Rotation::cur()); let enable_outputs = meta.query_advice(advices[7], Rotation::cur()); @@ -172,8 +172,8 @@ impl plonk::Circuit for Circuit { v_old.clone() - v_new.clone() - magnitude * sign, ), ( - "Either v_old = 0, or anchor equals public input", - v_old.clone() * (anchor - pub_input_anchor), + "Either v_old = 0, or root = anchor", + v_old.clone() * (root - anchor), ), ( "v_old = 0 or enable_spends = 1",