-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Description
Our current account impersonation implementation relies on providing a known signer. This approach breaks down in scenarios where projects incorporate the nonce directly into their contract logic.
In these cases, even if the transaction from points to the impersonated account, the nonce must still come from that account. A simple workaround such as:
let payload = tx.dummy_signed_payload();
return self.send_raw_transaction(Bytes(payload)).await;
is not valid, since the resulting transaction fails signature validation.
To support impersonation correctly, we need to align with the EDR approach for fake signatures. Their method encodes the caller’s address directly into the signature (r and s) and uses a fixed recovery id. This produces deterministic, recognizable “fake signatures” that are still accepted by the runtime while maintaining nonce correctness.
Motivation
Implementing this behavior is the final step to enable full support for account impersonation in the dev-node. This will ensure 100% test coverage for LayerZero cc @TorstenStueber and allow developers to reliably simulate contract interactions involving arbitrary accounts.