Background
In src/rpc/methods/eth/trace/parity.rs, the helper trace_is_evm_or_eam() currently uses a negation check (invoked_actor.id != ETHEREUM_ACCOUNT_MANAGER_ACTOR) which causes it to return true for virtually every non-EAM actor — not just EVM actors. This means any actor whose exit code numerically collides with an evm12::EVM_CONTRACT_* constant can be mislabeled as a Parity EVM error in trace_err_msg().
Forest currently mirrors Lotus behavior here, so addressing this is deferred to a follow-up.
Suggested Fix
Change the guard so it only returns true for actual EVM or EAM actors:
fn trace_is_evm_or_eam(trace: &ExecutionTrace) -> bool {
if let Some(invoked_actor) = &trace.invoked_actor {
+ let eam_actor_id = Address::ETHEREUM_ACCOUNT_MANAGER_ACTOR
+ .id()
+ .expect("EAM actor address should be an ID address");
is_evm_actor(&invoked_actor.state.code)
- || invoked_actor.id != Address::ETHEREUM_ACCOUNT_MANAGER_ACTOR.id().unwrap()
+ || invoked_actor.id == eam_actor_id
} else {
false
}
}
References
Background
In
src/rpc/methods/eth/trace/parity.rs, the helpertrace_is_evm_or_eam()currently uses a negation check (invoked_actor.id != ETHEREUM_ACCOUNT_MANAGER_ACTOR) which causes it to returntruefor virtually every non-EAM actor — not just EVM actors. This means any actor whose exit code numerically collides with anevm12::EVM_CONTRACT_*constant can be mislabeled as a Parity EVM error intrace_err_msg().Forest currently mirrors Lotus behavior here, so addressing this is deferred to a follow-up.
Suggested Fix
Change the guard so it only returns
truefor actual EVM or EAM actors:fn trace_is_evm_or_eam(trace: &ExecutionTrace) -> bool { if let Some(invoked_actor) = &trace.invoked_actor { + let eam_actor_id = Address::ETHEREUM_ACCOUNT_MANAGER_ACTOR + .id() + .expect("EAM actor address should be an ID address"); is_evm_actor(&invoked_actor.state.code) - || invoked_actor.id != Address::ETHEREUM_ACCOUNT_MANAGER_ACTOR.id().unwrap() + || invoked_actor.id == eam_actor_id } else { false } }References