-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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(anvil
): migrate in-house Genesis
to alloy-genesis
#6970
Conversation
anvil
): migrate in-house Genesis
to alloy-genesis
anvil
): migrate in-house Genesis
to alloy-genesis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets add private key to genesis account, geth also has these:
crates/anvil/src/config.rs
Outdated
env.cfg.chain_id = genesis.config.chain_id; | ||
env.block.timestamp = U256::from(genesis.timestamp); | ||
if let Some(base_fee) = genesis.base_fee_per_gas { | ||
env.block.basefee = U256::from(base_fee); | ||
} | ||
env.block.number = U256::from(genesis.nonce); | ||
env.block.coinbase = genesis.coinbase; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this applied these fields conditionally before (see genesis.apply()
)—but they're not conditional on alloy-genesis. Should check for any default values or just apply them like this?
ci failure unrelated |
…-rs#6970) * wip: migrate to alloy genesis * feat: switch out from in-house genesis to alloy genesis * chore: rem unneeded file * chore: update alloy, use from_bytes * chore: use proper fns on trait * chore: use block number
Motivation
We were using a duped genesis struct for anvil.
Solution
Switches anvil to use alloy-genesis