Skip to content

refactor: remove generic impl for Host#2738

Merged
rakita merged 1 commit intobluealloy:mainfrom
Troublor:host_impl
Jul 21, 2025
Merged

refactor: remove generic impl for Host#2738
rakita merged 1 commit intobluealloy:mainfrom
Troublor:host_impl

Conversation

@Troublor
Copy link
Contributor

This PR resolves #2732.

The generic implementation for revm::interpreter::Host is replaced with an explicit implementation for revm::context::Context struct type. This decoupling enables the specialization of host behavior for customized context types.

PS: I added one dependency in the revm-interpreter, making it additionally depend on revm-context. I am not sure whether this dependency is appropriate or not, or whether there are other ways to do this.

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 20, 2025

CodSpeed Performance Report

Merging #2738 will not alter performance

Comparing Troublor:host_impl (9dd184a) with main (25b46e8)

Summary

✅ 161 untouched benchmarks

Copy link
Member

@rakita rakita left a comment

Choose a reason for hiding this comment

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

How would it look if we require ContextTr to implement Host ContextTr: Host?

@Troublor
Copy link
Contributor Author

Troublor commented Jul 21, 2025

@rakita Then there will be cycle dependency I think. The crate revm-interpreter, which defines Host, already depends on context_interface, which defines ContextTr.

@rakita
Copy link
Member

rakita commented Jul 21, 2025

@rakita Then there will be cycle dependency I think. The crate revm-interpreter, which defines Host, already depends on context_interface, which defines ContextTr.

@Troublor, we could move Host to the context-interface to have interface traits in one place

@Troublor
Copy link
Contributor Author

@rakita Updated. Please see if it is appropriate.

@Troublor Troublor requested a review from rakita July 21, 2025 15:36
Copy link
Member

@rakita rakita left a comment

Choose a reason for hiding this comment

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

Looks great

@rakita rakita merged commit 55c59dd into bluealloy:main Jul 21, 2025
29 checks passed
This was referenced Jul 21, 2025
@Troublor Troublor deleted the host_impl branch July 22, 2025 02:03
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.

[feat] Remove generic implementation for Host trait

2 participants