Skip to content

Commit 0f1213d

Browse files
authored
fix: native FriReducedOpeningRecord size calculation (#1905)
The size of `a_prev_buf` (i.e. `a_prev_size`) was not being factored in the size calculation for `FriReducedOpeningRecordMut`, sometimes making the record too small.
1 parent fb9007d commit 0f1213d

File tree

1 file changed

+3
-0
lines changed
  • extensions/native/circuit/src/fri

1 file changed

+3
-0
lines changed

extensions/native/circuit/src/fri/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,9 @@ impl<F> SizedRecord<FriReducedOpeningLayout> for FriReducedOpeningRecordMut<'_,
676676
fn size(layout: &FriReducedOpeningLayout) -> usize {
677677
let mut total_len = size_of::<FriReducedOpeningHeaderRecord>();
678678
total_len += layout.metadata.length * size_of::<FriReducedOpeningWorkloadRowRecord<F>>();
679+
if !layout.metadata.is_init {
680+
total_len += layout.metadata.length * size_of::<F>();
681+
}
679682
total_len += size_of::<FriReducedOpeningCommonRecord<F>>();
680683
total_len
681684
}

0 commit comments

Comments
 (0)