-
Notifications
You must be signed in to change notification settings - Fork 615
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
Handler Lifetime #1151
Comments
Does |
It would, except it then raises issues with sharing objects between threads in Python. I vaguely recall there was some workaround for this that restricted the usage of the class in Python, but was wondering if there was a relatively quick win by having a handler that fully owns its members (assuming this would be more restrictive in some way, but we could probably live with this given our specific use case). |
This thread talks about pyclasses with static lifetimes PyO3/pyo3#502 |
Yeah, it would be very useful if the lifetime weren't required, for example it could be used as an associated type in a trait without making that associated type a GAT |
I would save a Context and recreate a Handler every time evm is called. |
Thanks @rakita, do have a sense of the overhead incurred with this approach? Our simulation use-case tends to include lots of Python loops calling the EVM. |
In comparison with the interpreter loop this shouldn't be noticeable. Handler is like 20-25 fields that need to be set and copy of 256 size array (instructions). |
Great, thanks for your help |
Hi, I'm trying to create a struct with an
Evm
as a field and then wrap this as a pyclass using pyo3, but classes with lifetime specifiers cannot be used as Pyclasses.I was curious if you had any thoughts on creating a
Handler
with no lifetime specifiers, and if this seemed like a sensible thing to do, or if there was some fundamental roadblock you could forsee?(Not suggesting this as a change to revm, just something I was considering implementing as part of our project to allow implementing a
pyclass
)The text was updated successfully, but these errors were encountered: