Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Add full blob encoding and consistency check #1379

Merged
merged 10 commits into from
Jul 25, 2024
Merged
Changes from 2 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
23 changes: 19 additions & 4 deletions aggregator/src/tests/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::{
aggregation::{
AssignedBarycentricEvaluationConfig, BarycentricEvaluationConfig, BlobDataConfig, RlcConfig,
},
blob::{BatchData, PointEvaluationAssignments, N_BYTES_U256},
blob::{BatchData, PointEvaluationAssignments, N_BLOB_BYTES, N_BYTES_U256},
param::ConfigParams,
BatchDataConfig, MAX_AGG_SNARKS,
};
Expand Down Expand Up @@ -288,7 +288,7 @@ fn blob_circuit_completeness() {
.chain(std::iter::once(vec![3, 100, 24, 30]))
.collect::<Vec<_>>();

for blob in [
for (idx, blob) in [
full_blob,
one_chunk,
two_chunks,
Expand All @@ -298,8 +298,23 @@ fn blob_circuit_completeness() {
nonempty_chunk_followed_by_empty_chunk,
empty_and_nonempty_chunks,
all_empty_except_last,
] {
assert_eq!(check_data(BatchData::from(&blob)), Ok(()), "{:?}", blob);
]
.into_iter()
.enumerate()
{
let batch_data = BatchData::from(&blob);

// First blob is purposely constructed to take full blob space
if idx == 0 {
let encoded_len = batch_data.get_encoded_batch_data_bytes().len();
assert_eq!(
encoded_len,
N_BLOB_BYTES,
"should be full blob: expected={N_BLOB_BYTES}, got={encoded_len}",
);
}

assert_eq!(check_data(batch_data), Ok(()), "{:?}", blob);
}
}

Expand Down
Loading