-
Notifications
You must be signed in to change notification settings - Fork 548
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
base: georgeee/redo-16186-for-better-review-base
Are you sure you want to change the base?
Changes from 1 commit
37fde44
33ce3c3
71bd217
e053563
788ab19
37e3584
f070475
ffbfe45
b2eb3df
34d7a98
d5a56e3
7860cdf
3062393
eaba812
09bd9bd
2249d75
10df606
39b7c74
eefcc50
bb8ebe1
c1d7fbd
b47cf86
cb395b2
b98f42f
60b5ab3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -154,11 +154,10 @@ let there_and_back_again ~num_txn_per_acct ~txns_per_block ~slot_time ~fill_rate | |
~origin_sender_secret_key_path | ||
~(origin_sender_secret_key_pw_option : string option) | ||
~returner_secret_key_path ~(returner_secret_key_pw_option : string option) | ||
~graphql_target_node_option ~minimum_user_command_fee () = | ||
~graphql_target_node_option ~minimum_user_command_fee ~logger () = | ||
let open Deferred.Let_syntax in | ||
(* define the rate limiting function *) | ||
let open Logger in | ||
let logger = Logger.create () in | ||
let limit_level = | ||
let slot_limit = | ||
Float.( | ||
|
@@ -310,8 +309,6 @@ let there_and_back_again ~num_txn_per_acct ~txns_per_block ~slot_time ~fill_rate | |
return () | ||
|
||
let output_there_and_back_cmds = | ||
let genesis_constants = Genesis_constants.Compiled.genesis_constants in | ||
let compile_config = Mina_compile_config.Compiled.t in | ||
let open Command.Let_syntax in | ||
Command.async | ||
~summary: | ||
|
@@ -390,23 +387,32 @@ let output_there_and_back_cmds = | |
transactions, if this is not present then we use the env var \ | ||
MINA_PRIVKEY_PASS" | ||
(optional string) | ||
and config_file = Cli_lib.Flag.config_files | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're calling a list of config files here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a typo, there are a few more places like this one, fixed in 6d26821 |
||
and graphql_target_node_option = | ||
flag "--graphql-target-node" ~aliases:[ "graphql-target-node" ] | ||
~doc: | ||
"URL The graphql node to send graphl commands to. must be in \ | ||
format `<ip>:<port>`. default is `127.0.0.1:3085`" | ||
(optional string) | ||
and minimum_user_command_fee = | ||
let default = compile_config.default_transaction_fee in | ||
Cli_lib.Flag.fee_common | ||
~minimum_user_command_fee:genesis_constants.minimum_user_command_fee | ||
~default_transaction_fee:default | ||
in | ||
there_and_back_again ~num_txn_per_acct ~txns_per_block ~txn_fee_option | ||
~slot_time ~fill_rate ~rate_limit ~rate_limit_level ~rate_limit_interval | ||
~origin_sender_secret_key_path ~origin_sender_secret_key_pw_option | ||
~returner_secret_key_path ~returner_secret_key_pw_option | ||
~graphql_target_node_option ~minimum_user_command_fee ) | ||
and minimum_user_command_fee_opt = Cli_lib.Flag.fee_common in | ||
fun () -> | ||
let open Deferred.Let_syntax in | ||
let logger = Logger.create () in | ||
let%bind minimum_user_command_fee = | ||
let%map conf = | ||
Runtime_config.Constants.load_constants ~logger config_file | ||
in | ||
Option.value | ||
~default: | ||
(Runtime_config.Constants.genesis_constants conf) | ||
.minimum_user_command_fee minimum_user_command_fee_opt | ||
in | ||
there_and_back_again ~num_txn_per_acct ~txns_per_block ~txn_fee_option | ||
~slot_time ~fill_rate ~rate_limit ~rate_limit_level | ||
~rate_limit_interval ~origin_sender_secret_key_path | ||
~origin_sender_secret_key_pw_option ~returner_secret_key_path | ||
~returner_secret_key_pw_option ~graphql_target_node_option | ||
~minimum_user_command_fee ~logger () ) | ||
|
||
let () = | ||
Command.run | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,10 @@ open Signature_lib | |
open Mina_base | ||
open Mina_transaction | ||
|
||
(* TODO consider a better way of setting a default transaction fee than | ||
a fixed compile-time value *) | ||
let default_transaction_fee = Currency.Fee.of_nanomina_int_exn 250000000 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Revert |
||
|
||
module Client = Graphql_lib.Client.Make (struct | ||
let preprocess_variables_string = Fn.id | ||
|
||
|
@@ -513,14 +517,8 @@ let send_payment_graphql = | |
flag "--amount" ~aliases:[ "amount" ] | ||
~doc:"VALUE Payment amount you want to send" (required txn_amount) | ||
in | ||
let genesis_constants = Genesis_constants.Compiled.genesis_constants in | ||
let compile_config = Mina_compile_config.Compiled.t in | ||
let args = | ||
Args.zip3 | ||
(Cli_lib.Flag.signed_command_common | ||
~minimum_user_command_fee:genesis_constants.minimum_user_command_fee | ||
~default_transaction_fee:compile_config.default_transaction_fee ) | ||
receiver_flag amount_flag | ||
Args.zip3 Cli_lib.Flag.signed_command_common receiver_flag amount_flag | ||
in | ||
Command.async ~summary:"Send payment to an address" | ||
(Cli_lib.Background_daemon.graphql_init args | ||
|
@@ -530,6 +528,7 @@ let send_payment_graphql = | |
-> | ||
let%map response = | ||
let input = | ||
let fee = Option.value ~default:default_transaction_fee fee in | ||
Mina_graphql.Types.Input.SendPaymentInput.make_input ~to_:receiver | ||
~from:sender ~amount ~fee ?memo ?nonce () | ||
in | ||
|
@@ -548,21 +547,14 @@ let delegate_stake_graphql = | |
~doc:"PUBLICKEY Public key to which you want to delegate your stake" | ||
(required public_key_compressed) | ||
in | ||
let genesis_constants = Genesis_constants.Compiled.genesis_constants in | ||
let compile_config = Mina_compile_config.Compiled.t in | ||
let args = | ||
Args.zip2 | ||
(Cli_lib.Flag.signed_command_common | ||
~minimum_user_command_fee:genesis_constants.minimum_user_command_fee | ||
~default_transaction_fee:compile_config.default_transaction_fee ) | ||
receiver_flag | ||
in | ||
let args = Args.zip2 Cli_lib.Flag.signed_command_common receiver_flag in | ||
Command.async ~summary:"Delegate your stake to another public key" | ||
(Cli_lib.Background_daemon.graphql_init args | ||
~f:(fun | ||
graphql_endpoint | ||
({ Cli_lib.Flag.sender; fee; nonce; memo }, receiver) | ||
-> | ||
let fee = Option.value ~default:default_transaction_fee fee in | ||
let%map response = | ||
Graphql_client.query_exn | ||
Graphql_queries.Send_delegation.( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,6 @@ | |
|
||
|
||
(*BEGIN src/config/amount_defaults/standard.mlh*) | ||
[%%define default_transaction_fee "5"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This whole commit should really be reverted. What a nightmare. |
||
[%%define default_snark_worker_fee "1"] | ||
[%%define minimum_user_command_fee "2"] | ||
(*END src/config/amount_defaults/standard.mlh*) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -352,32 +352,24 @@ end | |
|
||
type signed_command_common = | ||
{ sender : Signature_lib.Public_key.Compressed.t | ||
; fee : Currency.Fee.t | ||
; fee : Currency.Fee.t option | ||
; nonce : Mina_base.Account.Nonce.t option | ||
; memo : string option | ||
} | ||
|
||
let fee_common ~default_transaction_fee ~minimum_user_command_fee : | ||
Currency.Fee.t Command.Param.t = | ||
let fee_common : Currency.Fee.t option Command.Param.t = | ||
Command.Param.flag "--fee" ~aliases:[ "fee" ] | ||
~doc: | ||
(Printf.sprintf | ||
"FEE Amount you are willing to pay to process the transaction \ | ||
(default: %s) (minimum: %s)" | ||
(Currency.Fee.to_mina_string default_transaction_fee) | ||
(Currency.Fee.to_mina_string minimum_user_command_fee) ) | ||
(Command.Param.optional_with_default default_transaction_fee | ||
Arg_type.txn_fee ) | ||
Comment on lines
-355
to
-361
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing this information arbitrarily? No thanks. |
||
|
||
let signed_command_common ~default_transaction_fee ~minimum_user_command_fee : | ||
signed_command_common Command.Param.t = | ||
~doc:"FEE Amount you are willing to pay to process the transaction" | ||
(Command.Param.optional Arg_type.txn_fee) | ||
|
||
let signed_command_common : signed_command_common Command.Param.t = | ||
let open Command.Let_syntax in | ||
let open Arg_type in | ||
let%map_open sender = | ||
flag "--sender" ~aliases:[ "sender" ] | ||
(required public_key_compressed) | ||
~doc:"PUBLICKEY Public key from which you want to send the transaction" | ||
and fee = fee_common ~default_transaction_fee ~minimum_user_command_fee | ||
and fee = fee_common | ||
and nonce = | ||
flag "--nonce" ~aliases:[ "nonce" ] | ||
~doc: | ||
|
@@ -410,15 +402,10 @@ module Signed_command = struct | |
flag "--amount" ~aliases:[ "amount" ] | ||
~doc:"VALUE Payment amount you want to send" (required txn_amount) | ||
|
||
let fee ~default_transaction_fee ~minimum_user_command_fee = | ||
let fee = | ||
let open Command.Param in | ||
flag "--fee" ~aliases:[ "fee" ] | ||
~doc: | ||
(Printf.sprintf | ||
"FEE Amount you are willing to pay to process the transaction \ | ||
(default: %s) (minimum: %s)" | ||
(Currency.Fee.to_mina_string default_transaction_fee) | ||
(Currency.Fee.to_mina_string minimum_user_command_fee) ) | ||
Comment on lines
-408
to
-412
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Put it back. |
||
~doc:"FEE Amount you are willing to pay to process the transaction" | ||
(optional txn_fee) | ||
|
||
let valid_until = | ||
|
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.
Clarification: commit f070475 (Remove default_transaction_fee from node_config) also adds
--config-file
to thebatch_txn_tool
app