Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrect semaphore init could cause msm deadlock #411

Merged
merged 1 commit into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions ecc/bls12-377/multiexp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions ecc/bls12-378/multiexp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions ecc/bls12-381/multiexp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions ecc/bls24-315/multiexp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions ecc/bls24-317/multiexp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions ecc/bn254/multiexp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions ecc/bw6-633/multiexp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions ecc/bw6-756/multiexp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions ecc/bw6-761/multiexp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion ecc/secp256k1/multiexp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion internal/generator/ecc/template/multiexp.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ func _innerMsm{{ $.UPointName }}(p *{{ $.TJacobian }}, c uint64, points []{{ $.T
// (only if nbTasks < nbCPU)
var sem chan struct{}
if config.NbTasks < runtime.NumCPU() {
sem = make(chan struct{}, config.NbTasks * 2) // *2 because if chunk is overweight we split it in two
// we add nbChunks because if chunk is overweight we split it in two
sem = make(chan struct{}, config.NbTasks + int(nbChunks))
for i:=0; i < config.NbTasks; i++ {
sem <- struct{}{}
}
Expand Down