Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
dimazhornyk committed Jan 31, 2025
1 parent 87deeb0 commit 58da20b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
4 changes: 3 additions & 1 deletion core/lib/config/src/configs/da_dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ impl DADispatcherConfig {
max_rows_to_dispatch: Some(DEFAULT_MAX_ROWS_TO_DISPATCH),
max_retries: Some(DEFAULT_MAX_RETRIES),
use_dummy_inclusion_data: Some(DEFAULT_USE_DUMMY_INCLUSION_DATA),
inclusion_verification_transition_enabled: Some(DEFAULT_INCLUSION_VERIFICATION_TRANSITION_ENABLED),
inclusion_verification_transition_enabled: Some(
DEFAULT_INCLUSION_VERIFICATION_TRANSITION_ENABLED,
),
}
}

Expand Down
23 changes: 16 additions & 7 deletions core/lib/dal/src/data_availability_dal.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
use crate::{
models::storage_data_availability::{L1BatchDA, StorageDABlob},
Core,
};
use zksync_db_connection::{
connection::Connection,
error::DalResult,
instrument::{InstrumentExt, Instrumented},
};
use zksync_types::l2_to_l1_log::L2ToL1Log;
use zksync_types::{pubdata_da::DataAvailabilityBlob, Address, L1BatchNumber};
use zksync_types::{
l2_to_l1_log::L2ToL1Log, pubdata_da::DataAvailabilityBlob, Address, L1BatchNumber,
};

use crate::{
models::storage_data_availability::{L1BatchDA, StorageDABlob},
Core,
};

#[derive(Debug)]
pub struct DataAvailabilityDal<'a, 'c> {
Expand All @@ -29,7 +31,14 @@ impl DataAvailabilityDal<'_, '_> {
let update_result = sqlx::query!(
r#"
INSERT INTO
data_availability (l1_batch_number, blob_id, l2_da_validator_address, sent_at, created_at, updated_at)
data_availability (
l1_batch_number,
blob_id,
l2_da_validator_address,
sent_at,
created_at,
updated_at
)
VALUES
($1, $2, $3, $4, NOW(), NOW())
ON CONFLICT DO NOTHING
Expand Down
5 changes: 3 additions & 2 deletions core/lib/dal/src/models/storage_data_availability.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use chrono::{DateTime, NaiveDateTime, Utc};
use zksync_types::l2_to_l1_log::L2ToL1Log;
use zksync_types::{pubdata_da::DataAvailabilityBlob, Address, L1BatchNumber, H256};
use zksync_types::{
l2_to_l1_log::L2ToL1Log, pubdata_da::DataAvailabilityBlob, Address, L1BatchNumber, H256,
};

/// Represents a blob in the data availability layer.
#[derive(Debug, Clone)]
Expand Down
6 changes: 4 additions & 2 deletions core/lib/protobuf_config/src/da_dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ impl ProtoRepr for proto::DataAvailabilityDispatcher {
max_rows_to_dispatch: self.max_rows_to_dispatch,
max_retries: self.max_retries.map(|x| x as u16),
use_dummy_inclusion_data: self.use_dummy_inclusion_data,
inclusion_verification_transition_enabled: self.inclusion_verification_transition_enabled,
inclusion_verification_transition_enabled: self
.inclusion_verification_transition_enabled,
})
}

Expand All @@ -22,7 +23,8 @@ impl ProtoRepr for proto::DataAvailabilityDispatcher {
max_rows_to_dispatch: this.max_rows_to_dispatch,
max_retries: this.max_retries.map(Into::into),
use_dummy_inclusion_data: this.use_dummy_inclusion_data,
inclusion_verification_transition_enabled: this.inclusion_verification_transition_enabled,
inclusion_verification_transition_enabled: this
.inclusion_verification_transition_enabled,
}
}
}

0 comments on commit 58da20b

Please sign in to comment.