Skip to content

refactor(evm): DB generic instead of using lifetime-bound dyn trait#13949

Closed
mablr wants to merge 3 commits intofoundry-rs:masterfrom
mablr:refactor/evm-generic-db-param
Closed

refactor(evm): DB generic instead of using lifetime-bound dyn trait#13949
mablr wants to merge 3 commits intofoundry-rs:masterfrom
mablr:refactor/evm-generic-db-param

Conversation

@mablr
Copy link
Copy Markdown
Contributor

@mablr mablr commented Mar 26, 2026

Motivation

Replace the &'db mut dyn DatabaseExt lifetime parameter with a generic DB: Database<Error = DatabaseError> + Debug bound across FoundryEvm, FoundryHandler, EthRevmEvm, and related functions. Making them perfectly aligned with alloy-evm patterns.

Call sites in backend/mod.rs and backend/cow.rs updated to explicitly coerce to &mut dyn DatabaseExt where needed.

Replace the `&'db mut dyn DatabaseExt` lifetime parameter with a generic `DB: Database<Error = DatabaseError> + Debug` bound across FoundryEvm, FoundryHandler, EthRevmEvm, and related functions.

Call sites in backend/mod.rs and backend/cow.rs updated to explicitly coerce to `&mut dyn DatabaseExt` where needed.
zerosnacks
zerosnacks previously approved these changes Mar 26, 2026
Copy link
Copy Markdown
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.

Nice! 🥳

Copy link
Copy Markdown
Contributor Author

@mablr mablr left a comment

Choose a reason for hiding this comment

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

I’m closing this as it’s no longer relevant.

@mablr mablr closed this Apr 4, 2026
@github-project-automation github-project-automation bot moved this to Done in Foundry Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants