-
Notifications
You must be signed in to change notification settings - Fork 47
experiment: build indexes for utxoset with a different command #825
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -51,6 +51,20 @@ fn prepare_chain( | |||||||||||||||||||||||||||||||||||||||||
| Ok(()) | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| fn prepare_state( | ||||||||||||||||||||||||||||||||||||||||||
| state: &mut dolos_redb3::state::StateStore, | ||||||||||||||||||||||||||||||||||||||||||
| pb: &crate::feedback::ProgressBar, | ||||||||||||||||||||||||||||||||||||||||||
| ) -> miette::Result<()> { | ||||||||||||||||||||||||||||||||||||||||||
| let db = state.db_mut().unwrap(); | ||||||||||||||||||||||||||||||||||||||||||
| pb.set_message("compacting state"); | ||||||||||||||||||||||||||||||||||||||||||
| db.compact().into_diagnostic()?; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| pb.set_message("checking state integrity"); | ||||||||||||||||||||||||||||||||||||||||||
| db.check_integrity().into_diagnostic()?; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| Ok(()) | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| pub fn run( | ||||||||||||||||||||||||||||||||||||||||||
| config: &RootConfig, | ||||||||||||||||||||||||||||||||||||||||||
| args: &Args, | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -74,9 +88,8 @@ pub fn run( | |||||||||||||||||||||||||||||||||||||||||
| .append_path_with_name(&path, "wal") | ||||||||||||||||||||||||||||||||||||||||||
| .into_diagnostic()?; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| prepare_chain(&mut stores.archive, &pb)?; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| if args.include_chain { | ||||||||||||||||||||||||||||||||||||||||||
| prepare_chain(&mut stores.archive, &pb)?; | ||||||||||||||||||||||||||||||||||||||||||
| let path = root.join("chain"); | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| archive | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -87,13 +100,14 @@ pub fn run( | |||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| if args.include_state { | ||||||||||||||||||||||||||||||||||||||||||
| prepare_state(&mut stores.state, &pb)?; | ||||||||||||||||||||||||||||||||||||||||||
| let path = root.join("state"); | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| archive | ||||||||||||||||||||||||||||||||||||||||||
| .append_path_with_name(&path, "state") | ||||||||||||||||||||||||||||||||||||||||||
| .into_diagnostic()?; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| pb.set_message("creating archive"); | ||||||||||||||||||||||||||||||||||||||||||
| pb.set_message("creating state"); | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
102
to
111
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Progress message is set after the operation completes. The message "creating state" is set on line 110 after the archive append operation has already completed. This provides misleading feedback to the user. Consider setting the message before the operation begins, similar to how 🔎 Proposed fix if args.include_state {
+ pb.set_message("creating state");
prepare_state(&mut stores.state, &pb)?;
let path = root.join("state");
archive
.append_path_with_name(&path, "state")
.into_diagnostic()?;
-
- pb.set_message("creating state");
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| archive.finish().into_diagnostic()?; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
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.
🧩 Analysis chain
🏁 Script executed:
rg -n "apply_utxoset\(" --type rust -A 2Repository: txpipe/dolos
Length of output: 1950
Breaking API change incomplete:
apply_utxosetrequiresdefer_indexesparameter, but 3 call sites were not updated.The signature change from
apply_utxoset(&self, delta: &UtxoSetDelta)toapply_utxoset(&self, delta: &UtxoSetDelta, defer_indexes: bool)is a breaking change. However, the following call sites were not updated:crates/testing/src/toy_domain.rs:20crates/testing/src/toy_domain.rs:130crates/redb3/src/state/utxoset.rs:456All these calls still use the old signature without the
defer_indexesparameter. Update them to pass the parameter (typicallyfalsebased on other call sites).🤖 Prompt for AI Agents