Skip to content

Commit 04db20e

Browse files
authored
Allow cost model to be called without an actual witness (#30)
* Update Cost model * Support only one polynomial commitments scheme. * Rename ModelCircuit -> CircuitModel * Update Cost model Avoid running MockProver for cost model We copied the `Assignment` implementation of the MockProver, but in here we do not need to unwrap the witnesses (which was why the MockProver always needed `Value::known` instead of `Value::unknown`. Now we can run the cost model without assigned values. * Run apt-get update before installing libfontconfig * Remove instance from cost model (use only nb_instances)
1 parent 3e0ed05 commit 04db20e

File tree

5 files changed

+392
-79
lines changed

5 files changed

+392
-79
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
override: false
2929
- name: Install libfontconfig1-dev
3030
if: runner.os == 'Linux'
31-
run: sudo apt-get install -y libfontconfig1-dev
31+
run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev
3232
- name: Run tests
3333
uses: actions-rs/cargo@v1
3434
with:
@@ -45,7 +45,7 @@ jobs:
4545
- wasm32-wasi
4646

4747
steps:
48-
- run: sudo apt-get install -y libfontconfig1-dev
48+
- run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev
4949
- uses: actions/checkout@v3
5050
- uses: actions-rs/toolchain@v1
5151
with:
@@ -63,7 +63,7 @@ jobs:
6363
runs-on: ubuntu-latest
6464

6565
steps:
66-
- run: sudo apt-get install -y libfontconfig1-dev
66+
- run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev
6767
- uses: actions/checkout@v3
6868
- uses: actions-rs/toolchain@v1
6969
with:
@@ -80,7 +80,7 @@ jobs:
8080
runs-on: ubuntu-latest
8181

8282
steps:
83-
- run: sudo apt-get install -y libfontconfig1-dev
83+
- run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev
8484
- uses: actions/checkout@v3
8585
- uses: actions-rs/toolchain@v1
8686
with:
@@ -103,7 +103,7 @@ jobs:
103103
timeout-minutes: 30
104104
runs-on: ubuntu-latest
105105
steps:
106-
- run: sudo apt-get install -y libfontconfig1-dev
106+
- run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev
107107
- uses: actions/checkout@v3
108108
- uses: actions-rs/toolchain@v1
109109
with:

.github/workflows/lints-beta.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
continue-on-error: true
1313

1414
steps:
15-
- run: sudo apt-get install -y libfontconfig1-dev
15+
- run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev
1616
- uses: actions/checkout@v3
1717
- uses: actions-rs/toolchain@v1
1818
with:

.github/workflows/lints-stable.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- run: sudo apt-get install -y libfontconfig1-dev
13+
- run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev
1414
- uses: actions/checkout@v3
1515
- uses: actions-rs/toolchain@v1
1616
with:

examples/proof-size.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use halo2_proofs::{
55
};
66
use halo2curves::pasta::Fp;
77

8-
use halo2_proofs::dev::cost_model::{from_circuit_to_model_circuit, CommitmentScheme};
8+
use halo2_proofs::dev::cost_model::from_circuit_to_circuit_model;
99
use halo2_proofs::plonk::{Expression, Selector, TableColumn};
1010
use halo2_proofs::poly::Rotation;
1111

@@ -88,12 +88,7 @@ const K: u32 = 11;
8888
fn main() {
8989
let circuit = TestCircuit {};
9090

91-
let model = from_circuit_to_model_circuit::<_, _, 32, 32>(
92-
Some(K),
93-
&circuit,
94-
vec![],
95-
CommitmentScheme::KZGGWC,
96-
);
91+
let model = from_circuit_to_circuit_model::<_, _, 32, 32>(Some(K), &circuit, 10);
9792
println!(
9893
"Cost of circuit with 8 bit lookup table: \n{}",
9994
serde_json::to_string_pretty(&model).unwrap()

0 commit comments

Comments
 (0)