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

Feat: Add safe nonce overrider #86

Merged
merged 4 commits into from
Oct 8, 2024
Merged

Feat: Add safe nonce overrider #86

merged 4 commits into from
Oct 8, 2024

Conversation

karacurt
Copy link
Contributor

@karacurt karacurt commented Oct 8, 2024

Adds a safe-nonce overrider flag to propose a different nonce for proposals.

Copy link
Contributor

@zomglings zomglings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't we just use the existing --nonce argument?

@zomglings
Copy link
Contributor

Couldn't we just use the existing --nonce argument?

Conversation with @karacurt convinced me his approach is correct. The safe- prefix makes it so that users can just do a <command> -h | grep "safe-" to see all safe-related configuration.

But --safe-nonce should parse as *big.Int, same as --nonce.

safeNonce = big.NewInt(0)
} else {
safeNonce = new(big.Int)
_, ok := safeNonce.SetString(safeNonceRaw, 10)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to use 0 instead of 10. That will also accept hex input, etc.

https://pkg.go.dev/math/big#Int.SetString

Copy link
Contributor

@zomglings zomglings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@karacurt karacurt merged commit 9384f33 into main Oct 8, 2024
1 check passed
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