Skip to content

Commit

Permalink
Public input circuit optimization (privacy-scaling-explorations#730)
Browse files Browse the repository at this point in the history
* add constraints on calldata's tx_id and index columns so as to reduce length of rpi col

* add constraints on gas_cost col

* add lookup constraint to make sure the call_data_gas_cost assigned equals gas_cost that is calculated

* assert the first row of call_data

* fix: gas_cost_next = gas_cost + gas_next

* refine: assert call_data_gas_cost = 0 when call_data_length = 0

* refactor: use IsZeroChip

* refactor: assign names to hardcoded-constants

* add equality constraint between calldata value between rpi

* clippy and fmt

* tx_id' - tx_id can be larger than one

* remove leftover comments

* fix: tag is fixed col

* fmt

* add comment on using u16 fixed table

* fix comment

Co-authored-by: kunxian xia <[email protected]>
Co-authored-by: Zhang Zhuo <[email protected]>
  • Loading branch information
3 people authored Dec 3, 2022
1 parent 92f3d72 commit ff1bc52
Show file tree
Hide file tree
Showing 4 changed files with 486 additions and 34 deletions.
2 changes: 1 addition & 1 deletion circuit-benchmarks/src/pi_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ mod tests {

let n_tx = MAX_TXS;
for _ in 0..n_tx {
let eth_tx = eth_types::Transaction::from(&rand_tx(&mut rng, chain_id));
let eth_tx = eth_types::Transaction::from(&rand_tx(&mut rng, chain_id, true));
public_data.transactions.push(eth_tx);
}
public_data
Expand Down
Loading

0 comments on commit ff1bc52

Please sign in to comment.