Skip to content

Commit

Permalink
fix: r1cs oiteration exit once s1 read
Browse files Browse the repository at this point in the history
  • Loading branch information
glamperd authored and ctrlc03 committed Dec 29, 2023
1 parent 7f457fb commit 9fbb74f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/actions/src/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,10 @@ export const getR1CSInfo = (localR1CSFilePath: string): CircuitMetadata => {

// Jump to first section.
pointer = 12
let found = false

// For each section
for (let i = 0; i < numberOfSections; i++) {
for (let i = 0; i < numberOfSections && !found; i++) {
// Read section type.
const sectionType = ffUtils.leBuff2int(readBytesFromFile(localR1CSFilePath, 0, 4, pointer))

Expand Down Expand Up @@ -485,6 +486,8 @@ export const getR1CSInfo = (localR1CSFilePath: string): CircuitMetadata => {
pointer += 8

constraints = Number(ffUtils.leBuff2int(readBytesFromFile(localR1CSFilePath, 0, 4, pointer)))

found = true
}

pointer += 8 + Number(sectionSize)
Expand Down

0 comments on commit 9fbb74f

Please sign in to comment.