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(cast): add options to randomize initial nonce #6443

Merged
merged 4 commits into from
Nov 27, 2023
Merged

Conversation

DaniPopes
Copy link
Member

@DaniPopes DaniPopes commented Nov 27, 2023

Motivation

There is currently no way to randomize the initial nonce since it always starts at 0.

Solution

Randomize the nonce by default, with an optional --seed. This randomization can be disabled with --no-random.
Also fix a panic with -j0.

Copy link
Member

@Evalir Evalir left a comment

Choose a reason for hiding this comment

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

nice, lgtm

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

help message not specific enough

#[clap(long, value_name = "HEX")]
seed: Option<B256>,

/// Don't initialize the nonce with a random value, and instead use the default value of 0.
Copy link
Member

Choose a reason for hiding this comment

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

which nonce?


/// Address of the caller. Used for the first 20 bytes of the salt.
#[clap(long, value_name = "ADDRESS")]
caller: Option<Address>,

/// Seed for the random number generator that's used to initialize the nonce.
Copy link
Member

Choose a reason for hiding this comment

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

which nonce?

Copy link
Member Author

Choose a reason for hiding this comment

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

oops meant salt not nonce

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm

@mattsse mattsse merged commit 23aa303 into master Nov 27, 2023
20 checks passed
@mattsse mattsse deleted the dani/create2-rng branch November 27, 2023 23:56
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.

3 participants