-
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
feat(crates/sui): add --with-data-ingestion to 'sui start' #20472
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Skipped Deployments
|
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 @unmaykr-aftermath ! The change seems reasonable. I've left some suggestions for how to preserve the backwards compatibility.
I'm not very familiar with how the local file based data ingestion is supposed to work, so cc @bmwill and @phoenix-o to judge whether the behaviour of always starting from the genesis checkpoint is expected.
crates/sui/src/sui_commands.rs
Outdated
// the indexer requires to set the fullnode's data ingestion directory | ||
// note that this overrides the default configuration that is set when running the genesis | ||
// command, which sets data_ingestion_dir to None. | ||
ensure!( | ||
with_data_ingestion.is_some(), | ||
"Cannot start the indexer without --with-data-ingestion." | ||
); |
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.
We can do something like this instead to retain the backwards compatibility:
// the indexer requires to set the fullnode's data ingestion directory | |
// note that this overrides the default configuration that is set when running the genesis | |
// command, which sets data_ingestion_dir to None. | |
ensure!( | |
with_data_ingestion.is_some(), | |
"Cannot start the indexer without --with-data-ingestion." | |
); | |
} | |
if with_indexer.is_some() && with_data_ingestion.is_none() { | |
with_data_ingestion = Some(tempdir()?.into_path()) | |
} |
crates/sui/src/sui_commands.rs
Outdated
@@ -734,7 +749,8 @@ async fn start( | |||
pg_address.clone(), | |||
None, | |||
None, | |||
Some(data_ingestion_path.clone()), | |||
// We checked above that --with-data-ingestion is set if --with-indexer is |
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.
Would need to change this comment along with the suggestion above.
Cargo.toml
Outdated
@@ -604,7 +604,11 @@ anemo-tower = { git = "https://github.com/mystenlabs/anemo.git", rev = "e609f769 | |||
|
|||
# core-types with json format for REST api | |||
# sui-sdk-types = { version = "0.0.1", features = ["hash", "serde", "schemars"] } | |||
sui-sdk-types = { git = "https://github.com/MystenLabs/sui-rust-sdk.git", rev = "31bd9da32a8057edc45da8f5e6a8f25b83919b93", features = ["hash", "serde", "schemars"] } | |||
sui-sdk-types = { git = "https://github.com/MystenLabs/sui-rust-sdk.git", rev = "31bd9da32a8057edc45da8f5e6a8f25b83919b93", features = [ |
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.
spurious change?
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, I didn't notice it. I had the taplo
LSP running
Cargo.toml
Outdated
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.
I think with the suggested change to how we handle the default/None
case, we can get rid of all changes here.
Thanks @unmaykr-aftermath. Just a couple of nits as I was thinking about this, mostly food for thought. Finally, I second the suggestion to not break existing way of starting the local network with |
Ah, and we should update the release notes with a description of what changed in the CLI section. I'll leave it to you and will double check before merging. Thanks again! @unmaykr-aftermath |
I agree. I'll go with |
This is right in the PR after Test Plan - the CLI checkbox is already selected, so we just need to add some description with the change. |
The name is more semantically aligned and the mechanics are now backwards compatible
@amnn @stefan-mysten I updated the PR's desc. and made the suggested code changes |
Thanks for the quick changes @unmaykr-aftermath. I'll give it a spin locally and then we can merge this! |
@unmaykr-aftermath looks good. I will fix the failing CI issues (tests + fmt) and then merge. Thanks for this. |
Description
Adds the
--data-ingestion-dir
option tosui start
that allows users to set a custom data ingestion directory where checkpoint files will be written to.This is useful, among other things, for testing a custom local reader indexing setup with low overhead.
This is not a breaking change, as
sui start --with-indexer
works as usual by creating a temporary directory for data ingestion, but now one can:sui start --data-ingestion-dir <path> --with-indexer
to also have checkpoints written to<path>
. May be useful for inspecting the datasui start --data-ingestion-dir <path>
to only have checkpoints written to<path>
, but not start an indexer serviceP.s.: every time I ran
sui start --with-data-ingestion=<path>
(no other arguments), the network started producing checkpoints from 0. Is this intended or was the network supposed to pick up from where it left off? Perhaps it's the full node syncing.Test plan
I tested it locally to verify that the checkpoints are indeed written to the configured directory. See the screenshot below.
sui start --with-indexer
still runs without problems and I verified that checkpoints were committed to the DB.I set
export SUI_CONFIG_DIR=~/.sui/test
for the above.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.
--data-ingestion-dir
option tosui start
to set a custom directory where to write the checkpoint files.