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): implement anvil_rollback #9783

Merged
merged 3 commits into from
Jan 30, 2025

Conversation

jorgemmsilva
Copy link
Contributor

Motivation

Adds anvil_rollback RPC method. This method allows users to undo blocks that already been produced.
The existing anvil_reorg doesn't allow you to actually remove blocks, only to re-org in place.

Solution

The code is similar to anvil_reorg, we simply skip the mining step.

@grandizzy grandizzy changed the title implement anvil_rollback feat(anvil): implement anvil_rollback Jan 30, 2025
Copy link
Collaborator

@grandizzy grandizzy left a comment

Choose a reason for hiding this comment

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

thank you, overall looks good! left couple of comments, please check

crates/anvil/tests/it/anvil_api.rs Outdated Show resolved Hide resolved
crates/anvil/core/src/types.rs Outdated Show resolved Hide resolved
crates/anvil/src/eth/backend/mem/mod.rs Outdated Show resolved Hide resolved
crates/anvil/src/eth/backend/mem/mod.rs Show resolved Hide resolved
@grandizzy grandizzy added C-anvil Command: anvil T-feature Type: feature labels Jan 30, 2025
@grandizzy
Copy link
Collaborator

grandizzy commented Jan 30, 2025

thank you, looks good, clippy failures not related, going to fix them in master and rebase

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.

this lgtm

@grandizzy grandizzy enabled auto-merge (squash) January 30, 2025 12:09
Copy link
Member

@zerosnacks zerosnacks left a comment

Choose a reason for hiding this comment

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

Thanks! lgtm

@grandizzy grandizzy merged commit fbfd9bc into foundry-rs:master Jan 30, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-anvil Command: anvil T-feature Type: feature
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants