-
Notifications
You must be signed in to change notification settings - Fork 159
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: add --diff
flag to archive export
#3284
Conversation
} | ||
} | ||
|
||
pub fn stream_graph<DB: Blockstore, T: Iterator<Item = Tipset> + Unpin>( |
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.
Any way to indicate fail_on_dead_links: false
in the function name or doc? e.g. stream_graph_unstrict
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've updated the documentation of both stream_graph
and stream_chain
.
@@ -69,6 +72,9 @@ pub enum ArchiveCommands { | |||
/// How many state-roots to include. Lower limit is 900 for `calibnet` and `mainnet`. | |||
#[arg(short, long, default_value_t = 2000)] | |||
depth: ChainEpochDelta, | |||
/// Do not include any values reachable from this epoch | |||
#[arg(short, long)] | |||
diff: Option<ChainEpochDelta>, |
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.
It's a bit confusing, doc says epoch while code says epoch delta
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.
Updated to epoch-diff
.
.context("diff epoch must be smaller than target epoch")?; | ||
let diff_ts: &Tipset = &diff_ts; | ||
let mut stream = stream_graph(&store, diff_ts.clone().chain(&store)); | ||
while stream.try_next().await?.is_some() {} |
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.
Does it make sense to warn in into_seen
when the stream is not fully consumed or move stream consuming logic into into_seen
?
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.
You don't always want to consume the entire stream.
Summary of changes
Changes introduced in this pull request:
--diff
flag for exporting the set difference of two snapshots.Reference issue to close (if applicable)
Closes #3204
Other information and links
Change checklist