Skip to content

Commit

Permalink
Revert "Send uncoded commitment"
Browse files Browse the repository at this point in the history
This reverts commit ee302ec.
  • Loading branch information
gianbelinche committed Sep 27, 2024
1 parent a8b6258 commit d40d033
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 169 deletions.
5 changes: 1 addition & 4 deletions core/lib/l1_contract_interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@ sha2.workspace = true
sha3.workspace = true
hex.workspace = true
once_cell.workspace = true
rlp.workspace = true
serde.workspace = true
bincode.workspace = true

[dev-dependencies]
serde.workspace = true
serde_json.workspace = true
serde_with = { workspace = true, features = ["base64", "hex"] }

140 changes: 0 additions & 140 deletions core/lib/l1_contract_interface/src/i_executor/structures/blob_info.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use rlp::decode;
use zksync_types::{
commitment::{
pre_boojum_serialize_commitments, serialize_commitments, L1BatchCommitmentMode,
Expand All @@ -14,8 +13,6 @@ use crate::{
i_executor::commit::kzg::{KzgInfo, ZK_SYNC_BYTES_PER_BLOB},
Tokenizable,
};
use bincode;
use super::blob_info::BlobInfo;

/// These are used by the L1 Contracts to indicate what DA layer is used for pubdata
const PUBDATA_SOURCE_CALLDATA: u8 = 0;
Expand Down Expand Up @@ -220,27 +217,14 @@ impl Tokenizable for CommitBatchInfo<'_> {
}
(L1BatchCommitmentMode::Validium, PubdataDA::Custom) => {
let mut operator_da_input = vec![PUBDATA_SOURCE_CUSTOM];

let commitment = &self
.l1_batch_with_metadata
.metadata
.da_blob_id
.clone()
.unwrap_or_default();

let data = &hex::decode(commitment).unwrap()[3..];

let blob_info: BlobInfo = match decode(&data) {
Ok(blob_info) => blob_info,
Err(e) => panic!("Error decoding commitment: {}", e)
};

let bytes = match bincode::serialize(&blob_info) {
Ok(bytes) => bytes,
Err(e) => panic!("Error serializing commitment: {}", e)
};

operator_da_input.extend(bytes);
operator_da_input.extend(
&self
.l1_batch_with_metadata
.metadata
.da_blob_id
.clone()
.unwrap_or_default()
);
operator_da_input
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
mod commit_batch_info;
mod stored_batch_info;
mod blob_info;

pub use self::{commit_batch_info::CommitBatchInfo, stored_batch_info::StoredBatchInfo};

0 comments on commit d40d033

Please sign in to comment.