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

DB rollback implementation #1910

Open
wants to merge 49 commits into
base: nightly
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
35e61f9
Initial rollback implementation
rakanalh Feb 18, 2025
5491250
Calculate down_to_block properly
rakanalh Feb 18, 2025
f43d5c4
Rename handles
rakanalh Feb 18, 2025
2a9269d
Remove dead code marker
rakanalh Feb 18, 2025
84b069c
Rename PruningNodeType to StorageNodeType
rakanalh Feb 18, 2025
c557599
Move macros to be used by other modules
rakanalh Feb 18, 2025
d7fde2e
Generalize ledger pruning
rakanalh Feb 18, 2025
293c4fd
Pass node type to rollback
rakanalh Feb 18, 2025
ced4395
Calculate down to version value
rakanalh Feb 18, 2025
06d3638
WIP test
rakanalh Feb 19, 2025
9bf82e4
Merge remote-tracking branch 'origin/nightly' into rakahalh/rollback
rakanalh Feb 19, 2025
4baf2e9
Fix merge breakage
rakanalh Feb 19, 2025
ef20e2f
Complete test
rakanalh Feb 19, 2025
f0a8e4c
Rollback to target L1 / L2 combo
rakanalh Feb 22, 2025
fa6cec8
Fix test
rakanalh Feb 22, 2025
52be3bb
Add TODO
rakanalh Feb 22, 2025
c07d48b
Check rollback in every DB type
rakanalh Feb 22, 2025
a65fa70
Merge remote-tracking branch 'origin/nightly' into rakahalh/rollback
rakanalh Feb 22, 2025
3d7dd21
Add test for fullnode
rakanalh Feb 22, 2025
dc97a7e
Add prover test
rakanalh Feb 22, 2025
1e04de1
Add sov-schema-db
rakanalh Feb 24, 2025
0bb52cd
Exclude provers from checking sequencer commitments
rakanalh Feb 24, 2025
b608d2a
Add more asserts in test
rakanalh Feb 24, 2025
eeab583
Clippy
rakanalh Feb 24, 2025
4235353
Fix sequencer test
rakanalh Feb 24, 2025
cd90f98
Disable logging
rakanalh Feb 24, 2025
9f1015d
Merge remote-tracking branch 'origin/nightly' into rakahalh/rollback
rakanalh Feb 25, 2025
7f8f9c0
Resolve test issues
rakanalh Feb 25, 2025
a06c7b6
Prune up to target l1
rakanalh Feb 25, 2025
825dab0
Delete short header proofs
rakanalh Feb 25, 2025
c94fdfb
Fix sequencer and full node tests
rakanalh Feb 25, 2025
251b988
Pass sequencer commitment l2 height
rakanalh Feb 25, 2025
e9d5625
Remove repetition
rakanalh Feb 25, 2025
15fa4ff
Suppress panic output
rakanalh Feb 26, 2025
7ef760c
Pass last commitment l2 height
rakanalh Feb 26, 2025
f7e991e
Cleanup
rakanalh Feb 26, 2025
918b732
Make it pass
rakanalh Feb 26, 2025
6ba427a
Clippy
rakanalh Feb 26, 2025
6c6c837
Disable logs in tests
rakanalh Feb 26, 2025
38d3e9b
Add test for fullnode rollbac/re-sync without rollinb back sequencer
rakanalh Feb 27, 2025
57d95a1
Check sequencer commitments
rakanalh Feb 27, 2025
55dd86f
Move check outside the loop
rakanalh Feb 27, 2025
3048538
Stop using L1RangeByl1Height
rakanalh Feb 27, 2025
4ecdd0b
Rollback light client slots differently
rakanalh Feb 27, 2025
cdee744
Iterate verified proofs
rakanalh Feb 27, 2025
a78de9c
Merge branch 'nightly' into rakahalh/rollback
eyusufatik Feb 27, 2025
6c2c770
Differentiate pruning logic from rollback
rakanalh Feb 28, 2025
001b1ab
Compare state roots
rakanalh Feb 28, 2025
0345ec8
Fix prover test
rakanalh Feb 28, 2025
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
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions bin/citrea/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ citrea-risc0-adapter = { path = "../../crates/risc0", features = ["native", "tes
sov-mock-da = { path = "../../crates/sovereign-sdk/adapters/mock-da", default-features = false }
sov-prover-storage-manager = { path = "../../crates/sovereign-sdk/full-node/sov-prover-storage-manager", features = ["test-utils"] }
sov-rollup-interface = { path = "../../crates/sovereign-sdk/rollup-interface", features = ["testing"] }
sov-schema-db = { path = "../../crates/sovereign-sdk/full-node/db/sov-schema-db" }

alloy = { workspace = true, features = ["hyper", "consensus", "rpc-types-eth", "provider-http", "signers", "signer-local"] }
alloy-rlp = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions bin/citrea/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use citrea_common::{from_toml_path, FromEnv, FullNodeConfig};
use citrea_light_client_prover::da_block_handler::StartVariant;
use citrea_stf::genesis_config::GenesisPaths;
use citrea_stf::runtime::{CitreaRuntime, DefaultContext};
use citrea_storage_ops::pruning::types::PruningNodeType;
use citrea_storage_ops::pruning::types::StorageNodeType;
use clap::Parser;
use metrics_exporter_prometheus::PrometheusBuilder;
use metrics_util::MetricKindMask;
Expand Down Expand Up @@ -380,7 +380,7 @@ where
if let Some(pruner_service) = pruner_service {
task_manager.spawn(|cancellation_token| async move {
pruner_service
.run(PruningNodeType::FullNode, cancellation_token)
.run(StorageNodeType::FullNode, cancellation_token)
.await
});
}
Expand Down
4 changes: 2 additions & 2 deletions bin/citrea/tests/common/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use citrea_common::{
use citrea_light_client_prover::da_block_handler::StartVariant;
use citrea_primitives::TEST_PRIVATE_KEY;
use citrea_stf::genesis_config::GenesisPaths;
use citrea_storage_ops::pruning::types::PruningNodeType;
use citrea_storage_ops::pruning::types::StorageNodeType;
use citrea_storage_ops::pruning::PruningConfig;
use short_header_proof_provider::{
NativeShortHeaderProofProviderService, SHORT_HEADER_PROOF_PROVIDER,
Expand Down Expand Up @@ -373,7 +373,7 @@ pub async fn start_rollup(
if let Some(pruner) = pruner {
task_manager.spawn(|cancellation_token| async move {
pruner
.run(PruningNodeType::FullNode, cancellation_token)
.run(StorageNodeType::FullNode, cancellation_token)
.await
});
}
Expand Down
1 change: 1 addition & 0 deletions bin/citrea/tests/mock/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ mod mempool;
mod proving;
mod pruning;
mod reopen;
mod rollback;
mod sequencer_behaviour;
mod sequencer_replacement;
mod soft_confirmation_rule_enforcer;
Expand Down
Loading
Loading