Skip to content

Conversation

@glyh
Copy link
Member

@glyh glyh commented Dec 6, 2025

As title.

This is actually an effort to bump to OCaml 5, which requires bumping core libs which in turn requires bumping ppx_optcomp.

ppx_optcomp is completely redesigned to another library and could not be used by us anymore, hence this refactor.

It turns out we can just go one step further and make the comp time dispatch to runtime and we can use same build for different profiles. This, with some CI effort, could divide the time it takes for building stuff by the number of profiles we have. I believe that number is 3/4 now.

Bonus:

  • you can write any turing complete logic now to calculate node configs
  • you can have OCaml type system to help to harden the node config

@glyh glyh requested review from a team as code owners December 6, 2025 16:58
@glyh glyh force-pushed the lyh/node-config-first-class-module branch 2 times, most recently from ea52977 to ca4844f Compare December 7, 2025 01:23
| p ->
failwithf "Invalid dune profile %s" p ()

include (val profile_to_use)
Copy link
Member Author

@glyh glyh Dec 7, 2025

Choose a reason for hiding this comment

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

trick I learnt from src/lib/verifier/verifier.ml

"ppx_bitstring.4.1.0"
"ppx_deriving.5.2.1"
"ppx_deriving_yojson.3.6.1"
"ppx_optcomp.v0.14.3"
Copy link
Member Author

@glyh glyh Dec 7, 2025

Choose a reason for hiding this comment

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

This is only removed from roots instead of installed as well. It's used as a transitive deps for another lib for now. We'll get rid of it when bumping to corev0.16

No rebuild of toolchain needed here because technically we're still using the same set of packages.

(pps
ppx_mina
ppx_version
; ppx_jane except ppx_optcomp
Copy link
Member Author

Choose a reason for hiding this comment

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

I think this comment is not relevant so might as well delete it.

Comment on lines 10 to 16
(rule
(target comptime.ml)
(deps
(sandbox none)
(:< gen.sh)
(universe))
(action
(run bash %{<} %{target})))
Copy link
Member Author

Choose a reason for hiding this comment

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

trick I learnt from src/lib/mina_version/normal/dune

@glyh glyh force-pushed the lyh/node-config-first-class-module branch from ca4844f to 3590d4f Compare December 7, 2025 01:29
dune_profile_val="None"
fi

printf 'let dune_profile : string option = %s\n' "$dune_profile_val" > "$1"
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the ugliest part of this solution. We could potentially use https://github.com/stedolan/ppx_stage. But that lib is too old and we need to have it update to date.

Right now I guess this hack is fine, as it's already used in mina_version.normal

@glyh glyh force-pushed the lyh/node-config-first-class-module branch 3 times, most recently from 26c5914 to f1f74e6 Compare December 7, 2025 01:55
@glyh glyh requested a review from dkijania December 7, 2025 02:01
@glyh glyh force-pushed the lyh/node-config-first-class-module branch from 971b975 to 8bdd1b6 Compare December 7, 2025 02:12

buildCommand = ''
mkdir -p $out/etc/coda/build_config
cp ${../src/config}/mainnet.mlh $out/etc/coda/build_config/BUILD.mlh
Copy link
Member Author

@glyh glyh Dec 7, 2025

Choose a reason for hiding this comment

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

/etc/coda/build_config/BUILD.mlh will no longer be present, added a changelog.

@glyh glyh force-pushed the lyh/node-config-first-class-module branch 2 times, most recently from 8b29b67 to 869bfdd Compare December 7, 2025 02:44
@glyh glyh force-pushed the lyh/node-config-first-class-module branch from 869bfdd to 055e66a Compare December 7, 2025 03:01
@glyh
Copy link
Member Author

glyh commented Dec 7, 2025

!ci-build-me

@glyh glyh requested a review from martyall December 8, 2025 07:28
Copy link
Member

@dkijania dkijania left a comment

Choose a reason for hiding this comment

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

+1 from infra/test related changes. Thanks fro removing mlh files from debians

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.

3 participants