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(anvil): migrate in-house Genesis to alloy-genesis #6970

Merged
merged 6 commits into from
Feb 1, 2024

Conversation

Evalir
Copy link
Member

@Evalir Evalir commented Jan 31, 2024

Motivation

We were using a duped genesis struct for anvil.

Solution

Switches anvil to use alloy-genesis

@Evalir Evalir marked this pull request as ready for review February 1, 2024 15:20
@Evalir Evalir changed the title wip(anvil): migrate in-house Genesis to alloy-genesis feat(anvil): migrate in-house Genesis to alloy-genesis Feb 1, 2024
@Evalir Evalir marked this pull request as draft February 1, 2024 15:22
@Evalir Evalir marked this pull request as ready for review February 1, 2024 15:23
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.

Comment on lines 837 to 843
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;
Copy link
Member Author

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?

@Evalir Evalir requested a review from mattsse February 1, 2024 18:42
crates/anvil/src/config.rs Outdated Show resolved Hide resolved
@Evalir Evalir requested a review from mattsse February 1, 2024 19:46
@Evalir
Copy link
Member Author

Evalir commented Feb 1, 2024

ci failure unrelated

@Evalir Evalir merged commit b73df7c into master Feb 1, 2024
20 checks passed
@Evalir Evalir deleted the evalir/mig-anvil-genesis branch February 1, 2024 20:05
RPate97 pushed a commit to RPate97/foundry that referenced this pull request Feb 3, 2024
…-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
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