Skip to content
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

Create mappings from a specified start index #3194

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions crates/sc-consensus-subspace/src/archiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,13 @@ where
.rev()
.filter_map(|segment_index| segment_headers_store.get_segment_header(segment_index))
{
// If we're re-creating mappings for existing segments, ignore those segments. This
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does achieve the goal, but what I think would be a better fix is to not call this function at all and remove create_object_mappings from its arguments (if this is a long-term desired behavior.

Updated code in the later commit is also questionable, why writing explicit segment_index >= target_segment_index is the same exact check is done by create_object_mappings.for_segment(segment_index) { below?

// archives them again, and creates their mappings.
// TODO: create historic mappings without doing expensive re-archiving operations
if create_object_mappings {
continue;
}

let last_archived_block_number = segment_header.last_archived_block().number;
if NumberFor::<Block>::from(last_archived_block_number) > best_block_to_archive {
// Last archived block in segment header is too high for current state of the chain
Expand Down