Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
"ierc",
"IGSE",
"incentivized",
"incrementation",
"indexeddb",
"interruptible",
"IPFS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ impl<let NumPreviousRollups: u32, let NumVkIndices: u32> CheckpointRootInputsVal
}

self.validate_start_states();

self.validate_end_states();
}

fn validate_previous_rollup_proofs_and_vks(self) {
Expand Down Expand Up @@ -114,20 +112,4 @@ impl<let NumPreviousRollups: u32, let NumVkIndices: u32> CheckpointRootInputsVal
"Hash of the previous block header is not the last leaf in the archive tree",
);
}

fn validate_end_states(self) {
let end_sponge_blob =
self.previous_rollups[NumPreviousRollups - 1].public_inputs.end_sponge_blob;

// Check that the number of absorbed blob fields is not larger than the maximum number of fields allowed.
// Note: It must not equal the max allowed number because an additional checkpoint end marker will be absorbed
// in `checkpoint_rollup_public_inputs_composer`.
assert(
end_sponge_blob.num_absorbed_fields < FIELDS_PER_BLOB * BLOBS_PER_CHECKPOINT,
"Attempted to overfill blobs",
);

// The `end_sponge_blob` is validated against the injected blob fields in
// `checkpoint_rollup_public_inputs_composer.nr`, after the checkpoint end marker is absorbed.
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,15 @@ impl SpongeBlob {
}

pub fn absorb_checkpoint_end_marker(&mut self) {
// If you ever increase the size of an `end_marker` beyond 1 Field, you need to adjust this
// incrementation accordingly:
self.num_absorbed_fields += 1;
let end_marker = create_checkpoint_end_marker(self.num_absorbed_fields);
// Check that the number of absorbed blob fields is not larger than the maximum number of fields allowed.
assert(
self.num_absorbed_fields <= FIELDS_PER_BLOB * BLOBS_PER_CHECKPOINT,
"Attempted to overfill blobs",
);
let end_marker: Field = create_checkpoint_end_marker(self.num_absorbed_fields);
self.sponge.absorb(end_marker);
}

Expand Down