Refactor, move solana-validator CLI related configs to its own module#28548
Refactor, move solana-validator CLI related configs to its own module#28548mvines merged 4 commits intosolana-labs:masterfrom
Conversation
da112f4 to
b84aead
Compare
|
Solved conflicts. Looks like 2 arguments related to blockstore were deprecated at #28409 . Ready for review ! |
|
Hi @mvines , apologies for the direct ping, just trying to follow contributing guides . Could you help me on reviewing this ? Thank you in advance ! |
|
Ouups, just realised it got conflicts again. Will move it to draft again. Early feedback still appreciated. |
97de5fd to
ed7c774
Compare
|
The branch is now updated with latest changes. The last conflict was due to this new addition . I think this is ready for review again. |
mvines
left a comment
There was a problem hiding this comment.
Thanks for doing this. Looks fine to me overall, just one nit.
Do you think validator/src/bin/solana-test-validator.rs deserves the same treatment for its cli config?
| .long("no-bpf-jit") | ||
| .takes_value(false) | ||
| .help("Disable the just-in-time compiler and instead use the interpreter for SBF. Windows always disables JIT."), | ||
| .help("Disable the just-in-time compiler and instead use the interpreter for BPF. Windows always disables JIT."), |
There was a problem hiding this comment.
Oops can you please restore this line
|
Looks like CI wants you to run |
The main function of the validator is getting big. Improve readability by moving away the CLI setup stuff to its own module.
ed7c774 to
f31988c
Compare
|
Hello @mvines. Here is a list of updates:
Yes. I was worried about the size of the PR. Planned to do it a second PR. But here is it f31988c . Let me know what do you think. I did the same md5 checks as in the first refactor (see updated PR description).
Probably a squash is a good idea if merged. I think this is ready for review again ! |
|
Ah ! gotcha. CI failed again. Thats probably because: $ cargo fmt --all
Warning: can't set `imports_granularity = One`, unstable features are only available in nightly channel.
...This one did the trick: cargo +nightly fmt --allFixed at 5b05edc . I hope. Sorry inconveniences. |
|
Thanks for the PR! |
Thanks for review 🙂 |
…solana-labs#28548) * Refactor, move validator CLI related stuff to its own module(cli.rs) The main function of the validator is getting big. Improve readability by moving away the CLI setup stuff to its own module. * Restore help cli line * Refactor, move test validator CLI config to cli.rs module * Fix imports (cargo fmt)
Problem
The main function of the validator is getting big. I found it a bit difficult to track the code.
Summary of Changes
There is no behavioural change on this PR. Its just a refactor:
cli.rs, leaving the main function a bit more lightweight.Checks that i did
The most sensible change here are the defaults grouping. As the CLI defaults are shown in the output when invoking it with
--help, i thought the following commands to be useful for a minimal check, to ensure no behavioural change:And similar for the test validator part:
Edit: updated with latest changes (conflict solving).
Edit2: updated with latest changes (conflict solving). Added test validator check.