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

attempt fix flaky tests 2 #902

Merged
merged 1 commit into from
Jul 18, 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
6 changes: 3 additions & 3 deletions crates/fullnode/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,14 +458,14 @@ where

self.storage_manager.finalize_l2(l2_height)?;

self.ledger_db
.commit_soft_batch(soft_batch_receipt, self.include_tx_body)?;

self.ledger_db.extend_l2_range_of_l1_slot(
SlotNumber(current_l1_block.header().height()),
BatchNumber(l2_height),
)?;

self.ledger_db
.commit_soft_batch(soft_batch_receipt, self.include_tx_body)?;

self.state_root = next_state_root;
self.batch_hash = soft_batch.hash;

Expand Down
4 changes: 2 additions & 2 deletions crates/prover/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ where
self.storage_manager
.save_change_set_l2(l2_height, slot_result.change_set)?;

self.storage_manager.finalize_l2(l2_height)?;

let batch_receipt = data_to_commit.batch_receipts()[0].clone();

let soft_batch_receipt = SoftBatchReceipt::<_, _, Da::Spec> {
Expand Down Expand Up @@ -379,8 +381,6 @@ where
l2_height, self.state_root
);

self.storage_manager.finalize_l2(l2_height)?;

Ok(())
}

Expand Down
10 changes: 5 additions & 5 deletions crates/sequencer/src/sequencer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,23 +510,23 @@ where
timestamp: signed_soft_batch.timestamp(),
};

self.storage_manager
.save_change_set_l2(l2_height, slot_result.change_set)?;

// TODO: this will only work for mock da
// when https://github.com/Sovereign-Labs/sovereign-sdk/issues/1218
// is merged, rpc will access up to date storage then we won't need to finalize rigth away.
// however we need much better DA + finalization logic here
self.storage_manager
.save_change_set_l2(l2_height, slot_result.change_set)?;

self.storage_manager.finalize_l2(l2_height)?;

self.ledger_db.commit_soft_batch(soft_batch_receipt, true)?;

// connect L1 and L2 height
self.ledger_db.extend_l2_range_of_l1_slot(
SlotNumber(da_block.header().height()),
BatchNumber(l2_height),
)?;

self.ledger_db.commit_soft_batch(soft_batch_receipt, true)?;

let l1_height = da_block.header().height();
info!(
"New block #{}, DA #{}, Tx count: #{}",
Expand Down
Loading