Conversation
|
When I set |
|
You will not get any finalization during sync because the whole archiving process is skipped for already archived blocks and finalization is only called from there. To re-enable archiving of already archived history you'll have to do something like this: diff --git a/crates/sc-consensus-subspace/src/archiver.rs b/crates/sc-consensus-subspace/src/archiver.rs
--- a/crates/sc-consensus-subspace/src/archiver.rs (revision 51c4da575186f81c98b550ad92bcc6a7ba8fffe4)
+++ b/crates/sc-consensus-subspace/src/archiver.rs (date 1723552439720)
@@ -845,7 +845,7 @@
"Checking if block needs to be skipped"
);
if best_archived_block_number >= block_number_to_archive
- || last_archived_block_number > block_number_to_archive
+ // || last_archived_block_number > block_number_to_archive
{
// This block was already archived, skip
debug!(
@@ -958,6 +958,13 @@
block_number_to_archive, block_hash_to_archive
);
But then you don't need to modify sync target or archiving depth at all if you want to just verify finalization, something like this is sufficient: diff --git a/crates/sc-consensus-subspace/src/archiver.rs b/crates/sc-consensus-subspace/src/archiver.rs
--- a/crates/sc-consensus-subspace/src/archiver.rs (revision 51c4da575186f81c98b550ad92bcc6a7ba8fffe4)
+++ b/crates/sc-consensus-subspace/src/archiver.rs (date 1723552439720)
@@ -845,7 +845,7 @@
"Checking if block needs to be skipped"
);
if best_archived_block_number >= block_number_to_archive
- || last_archived_block_number > block_number_to_archive
+ // || last_archived_block_number > block_number_to_archive
{
// This block was already archived, skip
debug!(
@@ -958,6 +958,13 @@
block_number_to_archive, block_hash_to_archive
);
+ finalize_block(
+ client,
+ None,
+ *block.block.header().parent_hash(),
+ *block.block.header().number() - One::one(),
+ );
+
if parent_block_hash != best_archived_block_hash {
let error = format!(
"Attempt to switch to a different fork beyond archiving depth, \ |
|
I'll submit a patch that will warn and suggest users to wipe the database separately (if we can't transparently fix it before then) |
This simple change ensures that the first imported block is finalized and allows to finalize all other blocks afterwards successfully.
Code contributor checklist: