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

feat(pruning): Record L1 batch root hash in pruning logs #3266

Merged
merged 5 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE pruning_log
DROP COLUMN pruned_l1_batch_root_hash;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- nullable for backward compatibility
ALTER TABLE pruning_log
ADD COLUMN pruned_l1_batch_root_hash BYTEA DEFAULT NULL;
4 changes: 2 additions & 2 deletions core/lib/dal/src/consensus_dal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,10 @@ impl ConsensusDal<'_, '_> {
.get_pruning_info()
.await
.context("get_pruning_info()")?;
Ok(match info.last_soft_pruned_l2_block {
Ok(match info.last_soft_pruned {
// It is guaranteed that pruning info values are set for storage recovered from
// snapshot, even if pruning was not enabled.
Some(last_pruned) => validator::BlockNumber(last_pruned.0.into()) + 1,
Some(last_pruned) => validator::BlockNumber(last_pruned.l2_block.0.into()) + 1,
// No snapshot and no pruning:
None => validator::BlockNumber(0),
})
Expand Down
Loading
Loading