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
Show file tree
Hide file tree
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
23 changes: 4 additions & 19 deletions src/lib/genesis_ledger_helper/lib/genesis_ledger_helper_lib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -425,25 +425,10 @@ let make_constraint_constants
in
let transaction_capacity_log_2 =
match config.transaction_capacity with
| Some (Log_2 i) ->
i
| Some (Txns_per_second_x10 tps_goal_x10) ->
let max_coinbases = 2 in
let max_user_commands_per_block =
(* block_window_duration is in milliseconds, so divide by 1000 divide
by 10 again because we have tps * 10
*)
tps_goal_x10 * block_window_duration_ms / (1000 * 10)
in
(* Log of the capacity of transactions per transition.
- 1 will only work if we don't have prover fees.
- 2 will work with prover fees, but not if we want a transaction
included in every block.
- At least 3 ensures a transaction per block and the staged-ledger
unit tests pass.
*)
1
+ Core_kernel.Int.ceil_log2 (max_user_commands_per_block + max_coinbases)
| Some transaction_capacity ->
Runtime_config.Proof_keys.Transaction_capacity
.to_transaction_capacity_log_2 ~block_window_duration_ms
~transaction_capacity
| None ->
default.transaction_capacity_log_2
in
Expand Down
24 changes: 24 additions & 0 deletions src/lib/runtime_config/runtime_config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,30 @@ module Proof_keys = struct
let small : t = Log_2 2

let medium : t = Log_2 3

let to_transaction_capacity_log_2 ~block_window_duration_ms
~transaction_capacity =
match transaction_capacity with
| Log_2 i ->
i
| Txns_per_second_x10 tps_goal_x10 ->
let max_coinbases = 2 in
let max_user_commands_per_block =
(* block_window_duration is in milliseconds, so divide by 1000 divide
by 10 again because we have tps * 10
*)
tps_goal_x10 * block_window_duration_ms / (1000 * 10)
in
(* Log of the capacity of transactions per transition.
- 1 will only work if we don't have prover fees.
- 2 will work with prover fees, but not if we want a transaction
included in every block.
- At least 3 ensures a transaction per block and the staged-ledger
unit tests pass.
*)
1
+ Core_kernel.Int.ceil_log2
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Core_kernel is already open.
(But I appreciate the faithful movement of the function instead of modifying it.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in 1db6920

(max_user_commands_per_block + max_coinbases)
end

type t =
Expand Down