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

[bug fix] Fix panic when there is only one entity in dac #43

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

cffls
Copy link
Contributor

@cffls cffls commented Jun 7, 2024

rand.Intn can't take 0 as an argument. This PR fixes a panic when there is only one entity in data committee.

[zkevm-node-sequence-sender-001] panic: invalid argument to Intn
[zkevm-node-sequence-sender-001]
[zkevm-node-sequence-sender-001] goroutine 1 [running]:
[zkevm-node-sequence-sender-001] math/rand.(*Rand).Intn(0x0?, 0x0?)
[zkevm-node-sequence-sender-001] 	/usr/local/go/src/math/rand/rand.go:180 +0x4c
[zkevm-node-sequence-sender-001] math/rand.Intn(0xc00013aaa0?)
[zkevm-node-sequence-sender-001] 	/usr/local/go/src/math/rand/rand.go:453 +0x25
[zkevm-node-sequence-sender-001] github.com/0xPolygonHermez/zkevm-sequence-sender/dataavailability/datacommittee.(*Backend).Init(0xc00013aaa0)
[zkevm-node-sequence-sender-001] 	/src/dataavailability/datacommittee/datacommittee.go:85 +0x7a
[zkevm-node-sequence-sender-001] github.com/0xPolygonHermez/zkevm-sequence-sender/dataavailability.New(...)
[zkevm-node-sequence-sender-001] 	/src/dataavailability/dataavailability.go:20

Copy link

sonarcloud bot commented Jun 7, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@Sharonbc01
Copy link

Tag @xavier-romero

@cffls cffls merged commit ab5413e into 0xPolygonHermez:develop Jun 10, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants