-
Notifications
You must be signed in to change notification settings - Fork 844
Feat/prover: add prover command line utilities #326
Feat/prover: add prover command line utilities #326
Conversation
let block = block_convert(Fr::rand(), bytecode, &builder.block); | ||
let circuit = TestCircuit::<Fr>::new(block, FixedTableTag::iterator().collect()); | ||
|
||
// TODO: can this be pre-generated to a file? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prover/src/bin/prover_cmd.rs
Outdated
{ | ||
// generate evm_circuit proof | ||
// | ||
// TODO: why blocks.txs()[0]? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be addressed in https://github.com/appliedzkp/zkevm-circuits/pull/292/files#diff-09bf944a4f9216c1053a271fea0ff2f7a985380789b990f8e4ac530159214df2R964-R967
Which updates block_convert
to be:
pub fn block_convert(
block: &circuit_input_builder::Block,
code_db: &bus_mapping::state_db::CodeDB,
) -> Block<Fp> {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Good work :)
I have two comments though:
- I saw a few
unwrap()
, maybe you could replace them withexpect()
for a more friendly message in case of panic. - I noticed that
gen_params
uses arguments whileprover_cmd
uses env variables. Why is that?
For the future I suggest taking a look at https://github.com/clap-rs/clap for argument parsing (it also supports setting arguments from env vars), so that we get help messages and nice errors on invalid arguments for free. I think this will be useful once we have binaries that require more options.
prover/src/bin/prover_cmd.rs
Outdated
{ | ||
// generate evm_circuit proof | ||
// | ||
// TODO: why blocks.txs()[0]? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be addressed in https://github.com/appliedzkp/zkevm-circuits/pull/292/files#diff-09bf944a4f9216c1053a271fea0ff2f7a985380789b990f8e4ac530159214df2R964-R967
Which updates block_convert
to be:
pub fn block_convert(
block: &circuit_input_builder::Block,
code_db: &bus_mapping::state_db::CodeDB,
) -> Block<Fp> {
@@ -98,8 +98,8 @@ impl<F: FieldExt> EvmCircuit<F> { | |||
} | |||
} | |||
|
|||
#[cfg(test)] | |||
pub(crate) mod test { | |||
#[cfg(feature = "test")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😃
Will do :)
Sounds good. |
361f990
to
cb5731c
Compare
cb5731c
to
d0ed876
Compare
@ed255 Rebased :) |
@pinkiebell there seems to be a small formatting code issue: https://github.com/appliedzkp/zkevm-circuits/runs/5234903891?check_suite_focus=true |
sry, should run rustfmt in the root folder next time 😅 |
…ing-explorations#326) * test/keccak-normalize-table: unittest for normalize functions * test/keccak-normalize-table: test for the Chi table * test/keccak-normalize-table: move test to the new table module --------- Co-authored-by: Aurélien Nicolas <[email protected]>
The first version includes two commands:
gen_params
For generating circuit commitment parameters
prover_cmd
that generates circuit proofs and prints them as json to stdout.
Another rpc daemon is needed for a later stage so that it becomes possible to defer generating/requesting proofs over http.