Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR #16186, split for re-review #16502

Open
wants to merge 25 commits into
base: georgeee/redo-16186-for-better-review-base
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
37fde44
Move transaction_capacity_log_2 to Runtime_config
georgeee Jan 22, 2025
33ce3c3
Introduce Runtime_config.Constants
georgeee Jan 22, 2025
71bd217
Rename Genesis_ledger_helper.init_from_config_file
georgeee Jan 22, 2025
e053563
Split out legacy part from inputs_from_config_file
georgeee Jan 22, 2025
788ab19
Add compile_config to Genesis_proof.Inputs
georgeee Jan 22, 2025
37e3584
Add config_files flag to Cli_lib
georgeee Jan 22, 2025
f070475
Remove default_transaction_fee from node_config
georgeee Jan 22, 2025
ffbfe45
Implement init_from_config_file (non-legacy)
georgeee Jan 22, 2025
b2eb3df
Use init_from_config_file in mina_lib tests
georgeee Jan 22, 2025
34d7a98
Use init_from_config_file in archive
georgeee Jan 22, 2025
d5a56e3
Accept optional --config-file in standalone SW
georgeee Jan 22, 2025
7860cdf
Accept optional --config-file in 'internal snark-worker'
georgeee Jan 22, 2025
3062393
Use load_constants in snarky_tests
georgeee Jan 22, 2025
eaba812
Accept optional --config-file in vrf cli commands
georgeee Jan 22, 2025
09bd9bd
Use load_constants in delegation_verify app
georgeee Jan 22, 2025
2249d75
Accept --config-file in hash ledger and two other
georgeee Jan 22, 2025
10df606
Accept optional --config-file for compile-time-constants
georgeee Jan 22, 2025
39b7c74
Accept optional --config-file in constraint_system_digests
georgeee Jan 22, 2025
eefcc50
Accept optional --config-file in 'internal run-prover'
georgeee Jan 22, 2025
bb8ebe1
Accept optional --config-file in 'internal run-verifier', 'internal r…
georgeee Jan 22, 2025
c1d7fbd
Move load_config_files to Genesis_ledger_helpers
georgeee Jan 22, 2025
b47cf86
Remove default_snark_worker_fee usage
georgeee Jan 22, 2025
cb395b2
Use non-legacy inputs_from_config_file in load_config_files
georgeee Jan 22, 2025
b98f42f
Remove legacy functions from Config_loader
georgeee Jan 22, 2025
60b5ab3
Remainder of changes from PR #16186
georgeee Jan 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 27 additions & 14 deletions src/lib/cli_lib/commands.ml
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,20 @@ module Vrf = struct
flag "--total-stake"
~doc:"AMOUNT The total balance of all accounts in the epoch ledger"
(optional int)
in
and config_file = Flag.config_files in
Exceptions.handle_nicely
@@ fun () ->
let env = Secrets.Keypair.env in
let constraint_constants =
Genesis_constants.Compiled.constraint_constants
let open Deferred.Let_syntax in
let%bind constraint_constants =
let logger = Logger.create () in
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary use of logging, removed in compatible.

let%map conf =
Runtime_config.Constants.load_constants ~logger config_file
in
Runtime_config.Constants.constraint_constants conf
in
if Option.is_some (Sys.getenv env) then
eprintf "Using password from environment variable %s\n" env ;
let open Deferred.Let_syntax in
(* TODO-someday: constraint constants from config file. *)
let%bind () =
let password =
Expand Down Expand Up @@ -297,17 +301,21 @@ module Vrf = struct
\"epochSeed\": _, \"delegatorIndex\": _} JSON message objects read on \
stdin"
(let open Command.Let_syntax in
let%map_open privkey_path = Flag.privkey_read_path in
let%map_open privkey_path = Flag.privkey_read_path
and config_file = Flag.config_files in
Exceptions.handle_nicely
@@ fun () ->
let constraint_constants =
Genesis_constants.Compiled.constraint_constants
in
let env = Secrets.Keypair.env in
if Option.is_some (Sys.getenv env) then
eprintf "Using password from environment variable %s\n" env ;
let open Deferred.Let_syntax in
(* TODO-someday: constraint constants from config file. *)
let%bind constraint_constants =
let logger = Logger.create () in
let%map conf =
Runtime_config.Constants.load_constants ~logger config_file
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary use of logging, removed in compatible.

in
Runtime_config.Constants.constraint_constants conf
in
let%bind () =
let password =
lazy
Expand Down Expand Up @@ -362,13 +370,18 @@ module Vrf = struct
totalStake: 1000000000}. The threshold is not checked against a \
ledger; this should be done manually to confirm whether threshold_met \
in the output corresponds to an actual won block."
( Command.Param.return @@ Exceptions.handle_nicely
(let open Command.Let_syntax in
let%map_open config_file = Flag.config_files in
Exceptions.handle_nicely
@@ fun () ->
let open Deferred.Let_syntax in
let constraint_constants =
Genesis_constants.Compiled.constraint_constants
let%bind constraint_constants =
let logger = Logger.create () in
let%map conf =
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary use of logging, removed in compatible.

Runtime_config.Constants.load_constants ~logger config_file
in
Runtime_config.Constants.constraint_constants conf
in
(* TODO-someday: constraint constants from config file. *)
let lexbuf = Lexing.from_channel In_channel.stdin in
let lexer = Yojson.init_lexer () in
let%bind () =
Expand Down Expand Up @@ -399,7 +412,7 @@ module Vrf = struct
(Error_json.error_to_yojson err) ) ;
`Repeat () )
in
exit 0 )
exit 0)

let command_group =
Command.group ~summary:"Commands for vrf evaluations"
Expand Down