Skip to content

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

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

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! 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants