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

Remove unconfigurable_constants module #16196

Open
wants to merge 8 commits into
base: martin/create-constants-loader-part-1
Choose a base branch
from

Conversation

martyall
Copy link
Member

@martyall martyall commented Oct 7, 2024

Depends on #16186

Fixes #16107

The problem

We have this mina_node_config.unconfigurable_constants package that is leaking out the usage of mina_node_config. We need to access these fields via the standard *_constants records.

Solution

  • Delete mina_node_config.unconfigurable_constants
  • Remove all direct access to Node_config values in the codebase outside of signature_kind, genesis_constants and mina_compile_config modules
  • Many of the unconfigurable_constants were duplicated in both Mina_compile_config and Genesis_constants. It seems more natural to keep them in one place and Genesis_constants is the obvious choice. Remove the duplicated fields.

@martyall martyall changed the base branch from develop to martin/create-constants-loader-part-1 October 7, 2024 21:04
@MinaProtocol MinaProtocol deleted a comment from mergify bot Oct 7, 2024
@martyall
Copy link
Member Author

martyall commented Oct 7, 2024

!ci-nightly-me

@martyall
Copy link
Member Author

martyall commented Oct 7, 2024

@martyall martyall marked this pull request as ready for review October 8, 2024 00:00
@martyall martyall requested a review from a team as a code owner October 8, 2024 00:00
Logger.make_itn_logger_config
~rpc_handshake_timeout:compile_config.rpc_handshake_timeout
~rpc_heartbeat_timeout:
( compile_config.rpc_heartbeat_timeout |> Time.Span.to_sec
Copy link
Member

Choose a reason for hiding this comment

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

This seems to be a repeated pattern. What if we make rpc_heartbeat_timeout of compile config a TIme_ns.Span.t?


let zkapp_cmd_limit_hardcap = 128

(* These are fine to be non-configurable *)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
(* These are fine to be non-configurable *)

(Args.zip5 config_file payment_path_flag proof_path_flag address_flag
token_flag )
~f:(fun port (config_file, payment_path, proof_path, pk, token_id) ->
let%bind compile_config =
Copy link
Member

Choose a reason for hiding this comment

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

Code below is repeated more than ten times, probably we could remove the duplication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants