Skip to content

Commit

Permalink
Update nits post review
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilLuta committed Oct 26, 2023
1 parent 2b1811a commit 1c9ff8f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
4 changes: 2 additions & 2 deletions core/lib/dal/src/transactions_dal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -979,8 +979,8 @@ impl TransactionsDal<'_, '_> {
let transactions = sqlx::query_as!(
StorageTransaction,
"SELECT * FROM transactions \
WHERE miniblock_number IS NOT NULL AND l1_batch_number IS NULL \
ORDER BY miniblock_number, index_in_block",
WHERE miniblock_number IS NOT NULL AND l1_batch_number IS NULL \
ORDER BY miniblock_number, index_in_block",
)
.fetch_all(self.storage.conn())
.await?;
Expand Down
32 changes: 18 additions & 14 deletions core/lib/zksync_core/src/basic_witness_input_producer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,33 @@ impl BasicWitnessInputProducer {
.context("failed to create vm for BasicWitnessInputProducer")?;

tracing::info!("Started execution of l1_batch: {l1_batch_number:?}");
let mut next_miniblocks_data = miniblocks_execution_data.iter().skip(1);
for miniblock_execution_data in miniblocks_execution_data.iter() {

let next_miniblocks_data = miniblocks_execution_data
.iter()
.skip(1)
.map(Some)
.chain([None]);
let miniblocks_data = miniblocks_execution_data.iter().zip(next_miniblocks_data);

for (miniblock_data, next_miniblock_data) in miniblocks_data {
tracing::debug!(
"Started execution of miniblock: {:?}, executing {:?} transactions",
miniblock_execution_data.number,
miniblock_execution_data.txs.len(),
miniblock_data.number,
miniblock_data.txs.len(),
);
for tx in &miniblock_execution_data.txs {
for tx in &miniblock_data.txs {
tracing::trace!("Started execution of tx: {tx:?}");
execute_tx(tx, &mut vm)
.context("failed to execute transaction in BasicWitnessInputProducer")?;
tracing::trace!("Finished execution of tx: {tx:?}");
}
if let Some(next_miniblock_data) = next_miniblocks_data.next() {
if let Some(next_miniblock_data) = next_miniblock_data {
vm.start_new_l2_block(L2BlockEnv::from_miniblock_data(next_miniblock_data));
}

tracing::debug!(
"Finished execution of miniblock: {:?}",
miniblock_execution_data.number
miniblock_data.number
);
}
vm.finish_batch();
Expand Down Expand Up @@ -130,13 +137,10 @@ impl JobProcessor for BasicWitnessInputProducer {
.mark_job_as_failed(job_id, started_at, error)
.await
.expect("errored whilst marking job as failed");
match attempts {
Some(tries) => {
tracing::warn!("Failed to process job: {job_id:?}, after {tries} tries.");
}
None => {
tracing::warn!("L1 Batch {job_id:?} was processed successfully by another worker.");
}
if let Some(tries) = attempts {
tracing::warn!("Failed to process job: {job_id:?}, after {tries} tries.");
} else {
tracing::warn!("L1 Batch {job_id:?} was processed successfully by another worker.");
}
}

Expand Down
2 changes: 0 additions & 2 deletions core/lib/zksync_core/src/metadata_calculator/updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,6 @@ impl TreeUpdater {
// That is, if we run multiple tree instances, we'll get metadata correspondence
// right away without having to implement dedicated code.

// If there is an `object_key`, then the witness is being processed.
// If not, it must've been skipped (witness/proving is done at a very small percentage on testnet).
if let Some(object_key) = &object_key {
let protocol_version_id = storage
.blocks_dal()
Expand Down

0 comments on commit 1c9ff8f

Please sign in to comment.