Commit 44061d0
authored
fix(galoisd): correct signature/validator count check in Poll (#5471)
fixes #5428
## Summary
both `Poll` implementations had two input-validation guards comparing
each commit's `Signatures` slice length against itself, so the condition
was always false and the "More signatures than validators" error never
fired.
a malformed request with more signatures than validators would skip the
check entirely and reach the prover. this fixes both comparisons to use
`Validators` on the right-hand side. the same copy paste bug was in both
server files; both are patched in this commit
## Changes
- `galoisd/grpc/server.go`: compare `Signatures` against `Validators`
for both the trusted and untrusted commits
- `galoisd/grpc/bls12381_server.go`: same fix (the guard was copy pasted
from `server.go` with the same typo)
- `galoisd/grpc/server_test.go`: regression test that `Poll` rejects a
commit with more signatures than validators, covering both server types
and both commit fields (4 sub-cases total)
## Testing
`go test ./grpc/...` in `galoisd\`. the new test fails before the fix
(the dead guard is skipped so a zero-value server hits the job-slot
check and returns `busy_building`), and passes after. also ran `go build
./grpc/...` and `go vet ./grpc/...`3 files changed
Lines changed: 53 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
| 308 | + | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
| 311 | + | |
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
0 commit comments