Skip to content

Commit

Permalink
Resolve FIXMEs in state crate
Browse files Browse the repository at this point in the history
  • Loading branch information
slowli committed Feb 2, 2024
1 parent d652fea commit 822e58c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
2 changes: 0 additions & 2 deletions core/lib/state/src/rocksdb/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,6 @@ async fn recovering_factory_deps_from_snapshot() {
all_factory_deps.insert(bytecode_hash, bytecode.clone());

let number = MiniblockNumber(number);
// FIXME (PLA-589): don't store miniblocks once the corresponding foreign keys are removed
create_miniblock(&mut conn, number, vec![]).await;
conn.factory_deps_dal()
.insert_factory_deps(number, &HashMap::from([(bytecode_hash, bytecode)]))
.await
Expand Down
24 changes: 11 additions & 13 deletions core/lib/state/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,17 @@ pub(crate) async fn prepare_postgres_for_snapshot_recovery(
.await
.unwrap();

// FIXME (PLA-589): don't store miniblock / L1 batch once the corresponding foreign keys are removed
let snapshot_storage_logs = gen_storage_logs(100..200);
create_miniblock(
conn,
snapshot_recovery.miniblock_number,
snapshot_storage_logs.clone(),
)
.await;
create_l1_batch(
conn,
snapshot_recovery.l1_batch_number,
&snapshot_storage_logs,
)
.await;
conn.storage_logs_dal()
.insert_storage_logs(
snapshot_recovery.miniblock_number,
&[(H256::zero(), snapshot_storage_logs.clone())],
)
.await;
let mut written_keys: Vec<_> = snapshot_storage_logs.iter().map(|log| log.key).collect();
written_keys.sort_unstable();
conn.storage_logs_dedup_dal()
.insert_initial_writes(snapshot_recovery.l1_batch_number, &written_keys)
.await;
(snapshot_recovery, snapshot_storage_logs)
}

0 comments on commit 822e58c

Please sign in to comment.