-
Notifications
You must be signed in to change notification settings - Fork 1.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: add directory paths to Snapshotter
and SnapshotProvider
#5283
Conversation
range.end(), | ||
) | ||
.into() | ||
// ATTENTION: if changing the name format, be sure to reflect those changes in |
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.
can we add a test to check that the result of filename_with_configuration
can be parsed by parse_filename
?
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.
added on #5373
pub fn with_snapshots( | ||
mut self, | ||
snapshots_path: PathBuf, | ||
highest_snapshot_tracker: watch::Receiver<Option<HighestSnapshots>>, | ||
) -> Self { | ||
self.snapshot_provider = Some(Arc::new( | ||
SnapshotProvider::default().with_highest_tracker(Some(highest_snapshot_tracker)), | ||
SnapshotProvider::new(snapshots_path) | ||
.with_highest_tracker(Some(highest_snapshot_tracker)), |
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 these arguments became too verbose, can we just pass a Arc<SnapshotProvider>
as an argument?
Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
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.
suggestion for rename
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.
pedantic nit
snapshots_path: PathBuf, | ||
chain_spec: Arc<ChainSpec>, | ||
block_interval: u64, |
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.
nit:
I'd like to move snapshots_path + block_interval to a new SnapshotterConfig
struct
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
PR into #5249
As title suggests.
Additionally:
strum::EnumString
for some primitive types.update_highest_snapshots_tracker
will look into the directory and find the highest block number for each segment type.