-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
[indexer] Standalone synthetic ingestion #20270
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Skipped Deployments
|
9be316b
to
895565e
Compare
895565e
to
a93b934
Compare
fs::remove_file(ingestion_dir.join("1.chk")).await.unwrap(); | ||
effects.created()[0].0 | ||
}; | ||
sim.override_next_checkpoint_number(starting_checkpoint); |
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 so this is what will set the next checkpoint file to starting_checkpoint.chk
println!( | ||
"About to build checkpoint, size: {}", | ||
self.transactions.len() | ||
); |
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.
do we want this println still?
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.
overall looks good, left a couple of minor comments.
let bytes = tokio::fs::read(&path).await.unwrap(); | ||
let checkpoint_data: CheckpointData = Blob::from_bytes(&bytes).unwrap(); | ||
if checkpoint_data.transactions.len() != checkpoint_size as usize { | ||
for tx in &checkpoint_data.transactions { |
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.
why do we want to print here, as there is another assert below?
assert_eq!(checkpoint_data.transactions.len(), checkpoint_size as usize);
// `request_gas` will create a transaction, which we don't want to include in the benchmark. | ||
// Put it in a checkpoint and then remove the checkpoint file. | ||
sim.create_checkpoint(); | ||
fs::remove_file(ingestion_dir.join("1.chk")).await.unwrap(); |
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.
is remove_file
necessary? as std::fs::write(path.join(file_name), blob.to_bytes())?;
will overwrite 0.chk
and 1.chk
after override_next_checkpoint_number
- if the test range covers cp 0 and cp 1, it will overwrite
- otherwise these 2 files are not used?
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 was hoping to have a mode where when you run benchmark from an ingestion dir, it automatically scan through all files in it
Description
Decouples ingestion and benchmarking, remove the benchmark related code from sui-indexer crate.
After this change, we will always first run synthetic ingestion to generate a workload, and then separately, run indexer to benchmark it.
This has a few benefits:
Also cleaned up the ingestion generation code by allowing generation from checkpoint 0, and made sure that every checkpoint has the same number of transactions.
Test plan
Updated tests.
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.