-
Notifications
You must be signed in to change notification settings - Fork 817
Closed
Labels
featureNew feature or lib abilityNew feature or lib ability
Description
Working on 4.0 support in my application, and trying to figure out what the correct pattern is for passing an Evm
to a thread.
My use case is I have an Evm
that has been built (DB, BlockEnv, etc), and I'd like to simulate multiple parallel transactions (with different inputs) in that environment.
My previous (pseudo)code was:
fn simulate(evm: EVM) {
some_list
.par_iter() // <-- rayon parallelization
.for_each(|item| {
let mut evm = evm.clone();
// modify evm transaction env
// simulate txn
});
}
Looks like in 4.0, Evm
can't be safely sent between threads. Is there any recommended way to accomplish this? Should I just be pulling out the DB + Env, and sending those to the thread and rebuilding a new Evm?
Metadata
Metadata
Assignees
Labels
featureNew feature or lib abilityNew feature or lib ability