NilFoundation / proof-market-toolchain

A toolchain for interaction with the Proof Market protocol.
https://docs.nil.foundation/proof-market
MIT License
23 stars 5 forks source link

Running proof-generator without params or with -h/-v results in an attempt to find config.ini #61

Open NickVolynkin opened 1 year ago

NickVolynkin commented 1 year ago

When I run the proof-generator with empty input or with -h and -v, I get unexpected results:

root@5ffc715e5f63:/proof-market-toolchain# /proof-market-toolchain/build/bin/proof-generator/proof-generator
can not read options configuration file '/root/.config/config.ini'
terminate called after throwing an instance of 'boost::wrapexcept<boost::property_tree::ini_parser::ini_parser_error>'
  what():  /root/.config/config.ini: cannot open file
Aborted (core dumped)

root@5ffc715e5f63:/proof-market-toolchain# /proof-market-toolchain/build/bin/proof-generator/proof-generator -v
can not read options configuration file '/root/.config/config.ini'
terminate called after throwing an instance of 'boost::wrapexcept<boost::property_tree::ini_parser::ini_parser_error>'
  what():  /root/.config/config.ini: cannot open file
Aborted (core dumped)

# slightly different result, but still an error:
root@5ffc715e5f63:/proof-market-toolchain# /proof-market-toolchain/build/bin/proof-generator/proof-generator -h
Command_Line_Options:
  -h [ --help ]                         Display available command-line
                                        configuration arguments
  -c [ --configuration-files ] arg (=/root/.config/config.ini)
                                        Configuration files

NIL Proof Generator:
  -v [ --version ]                      Display version
  --proof_out arg                       Output file
  --circuit_input arg                   Circuit input file
  --public_input arg                    Public params input file

Json circuit description parsing failed: incomplete JSON
Json public_input parsing failed: incomplete JSON
terminate called after throwing an instance of 'boost::wrapexcept<std::invalid_argument>'
  what():  not an object
Aborted (core dumped)
root@5ffc715e5f63:/proof-market-toolchain# /proof-market-toolchain/build/bin/proof-generator/proof-generator
can not read options configuration file '/root/.config/config.ini'
terminate called after throwing an instance of 'boost::wrapexcept<boost::property_tree::ini_parser::ini_parser_error>'
  what():  /root/.config/config.ini: cannot open file
Aborted (core dumped)

The image is built from commit e7ac89512d6ea4a86b19fbb2ed5dca9fab08ea42, which is based on master branch commit 9008207fb82dde2b00cb879db487a3c1b563a5d4

Silur commented 1 year ago

This now resulted in parsing an empty config.ini that causes an abort at deserialization:

./build/bin/proof-generator/proof-generator --proof_out proof --circuit_input minacc-circuit --public_input minacc-input
terminate called after throwing an instance of 'boost::wrapexcept<std::invalid_argument>'
  what():  array required
Aborted (core dumped)

Instead of touch-ing an empty config, we should provide a default one IMO