Skip to content

Meyer9/mainnet tx generator #79

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

Closed

Conversation

meyer9
Copy link
Collaborator

@meyer9 meyer9 commented Jun 10, 2025

Description

Testing

@cb-heimdall
Copy link
Collaborator

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@meyer9 meyer9 changed the base branch from main to meyer9/mainnet-stats-lookup June 10, 2025 22:04

src := rand.New(rand.NewSource(100))
for i := 0; i < maxAccounts; i++ {
key, err := ecdsa.GenerateKey(crypto.S256(), src)

Check failure

Code scanning / CodeQL

Use of insufficient randomness as the key of a cryptographic algorithm

This cryptographic algorithm depends on a [random number](1) generated with a cryptographically weak RNG.

Copilot Autofix

AI 14 days ago

To fix the issue, replace the use of math/rand with crypto/rand, which provides a cryptographically secure random number generator. Specifically:

  1. Replace rand.New(rand.NewSource(100)) with crypto/rand.Reader to ensure the random source is cryptographically secure.
  2. Update the ecdsa.GenerateKey function to use crypto/rand.Reader as the random source.

This change ensures that the generated private keys are unpredictable and secure for cryptographic purposes.


Suggested changeset 1
runner/payload/simulator/worker.go

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/runner/payload/simulator/worker.go b/runner/payload/simulator/worker.go
--- a/runner/payload/simulator/worker.go
+++ b/runner/payload/simulator/worker.go
@@ -10,3 +10,3 @@
 
-	"math/rand"
+	"crypto/rand"
 
@@ -211,5 +211,4 @@
 
-	src := rand.New(rand.NewSource(100))
 	for i := 0; i < maxAccounts; i++ {
-		key, err := ecdsa.GenerateKey(crypto.S256(), src)
+		key, err := ecdsa.GenerateKey(crypto.S256(), cryptoRand.Reader)
 		if err != nil {
EOF
@@ -10,3 +10,3 @@

"math/rand"
"crypto/rand"

@@ -211,5 +211,4 @@

src := rand.New(rand.NewSource(100))
for i := 0; i < maxAccounts; i++ {
key, err := ecdsa.GenerateKey(crypto.S256(), src)
key, err := ecdsa.GenerateKey(crypto.S256(), cryptoRand.Reader)
if err != nil {
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
@meyer9 meyer9 force-pushed the meyer9/mainnet-stats-lookup branch from 3960fd4 to e5a6e3d Compare June 11, 2025 14:58
@meyer9 meyer9 force-pushed the meyer9/mainnet-tx-generator branch from 18a814e to a0bf306 Compare June 11, 2025 14:59
@meyer9 meyer9 force-pushed the meyer9/mainnet-stats-lookup branch from e5a6e3d to 8c054c6 Compare June 11, 2025 16:23
@meyer9 meyer9 force-pushed the meyer9/mainnet-tx-generator branch from a0bf306 to e6209c1 Compare June 11, 2025 16:24
@meyer9 meyer9 force-pushed the meyer9/mainnet-stats-lookup branch from 8c054c6 to ae23636 Compare June 12, 2025 20:19
@meyer9 meyer9 force-pushed the meyer9/mainnet-tx-generator branch from 2bc82f2 to 4c858f6 Compare June 12, 2025 20:20
@meyer9 meyer9 force-pushed the meyer9/mainnet-stats-lookup branch from ae23636 to 7f709cc Compare June 12, 2025 20:48
@meyer9 meyer9 force-pushed the meyer9/mainnet-tx-generator branch from 4c858f6 to 42d5487 Compare June 12, 2025 20:48
@meyer9 meyer9 force-pushed the meyer9/mainnet-tx-generator branch 2 times, most recently from 5a56a68 to 39c8cf0 Compare June 24, 2025 22:12
@meyer9 meyer9 force-pushed the meyer9/mainnet-stats-lookup branch from 7f709cc to e4b4a2a Compare June 24, 2025 22:14
@meyer9 meyer9 force-pushed the meyer9/mainnet-tx-generator branch 2 times, most recently from 691e9d0 to 5a972df Compare June 24, 2025 22:16
@meyer9 meyer9 force-pushed the meyer9/mainnet-tx-generator branch from 5a972df to 309a10f Compare June 24, 2025 22:18
@meyer9 meyer9 closed this Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants