-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
fix(sui): be consistent about sui config directory #20474
Conversation
## Description When a `--config` is supplied and it is a directory, we treat it as the sui config directory in some but not all cases. This changes makes it so that if `--config` does not look like a YAML file, then it is treated like it should be the config directory, and that location is used everywhere the config directory is expected. ## Test plan Manually tested running `sui start`, `sui start --config ...`.
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
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.
Thanks for fixing this, though I am a scared of this change. The existing logic there is a mess :p.
if !network_config.exists() { | ||
genesis(None, None, None, false, epoch_duration_ms, None, false) |
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.
Wouldn't this potentially override other settings in the sui_config
dir?
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.
Ah, genesis
will fail if the folder is not empty, so we're probably safe.
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.
This logic is pre-existing, but judging by the error message, genesis will not run if the directory is non-empty.
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.
Yes, I did that messy logic 😅 trying to preserve compatibility between sui-test-validator
and sui start
. :D
I'm a little scared as well -- this change actually started as a pretty benign formatting change for the extra long-line containing the error message, but then I couldn't resist pulling the thread that I noticed with the config directories being set in various places... |
Description
When a
--config
is supplied and it is a directory, we treat it as the sui config directory in some but not all cases. This changes makes it so that if--config
does not look like a YAML file, then it is treated like it should be the config directory, and that location is used everywhere the config directory is expected.Test plan
Manually tested running
sui start
,sui start --network.config ...
:A custom config directory can be generated by taking a copy of the current config directory and tweaking it:
You can test that the local network is up and running by querying for its chain identifier:
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.
sui start
.