Open itegulov opened 6 days ago
How do you impersonate an address at all that is not an account you have? I seem to be unable to figure this one out.
@PatrickAlphaC you can use anvil_impersonate
endpoint to enable impersonation for the provided account. Here is an example.
For future though please ask questions under https://github.com/ZKsync-Community-Hub/zksync-developers/discussions.
We can't mix impersonated and non-impersonated transactions inside a single batch due to limitation of our current approach. Batch VM is initialized with either normal or impersonated bootloader at the start of a batch and it can't change dynamically without sealing both current block and current batch.
Our current solution is to force block/batch sealing when we see a transaction with impersonation status that differs from the first transactions in the batch. Thus making us start a new block/batch with flipped impersonation status.
Alternatives I currently see:
BOOTLOADER_CODE_PAGE
to the other bootloader's payload. Problems with this: we will have to expose low-level access to VM from upstream, concerns over how hacky and brittle this is, unsure if this will even work in general (I tried to prepare a quick PoC and met a lot of hard to debug VM errors).Regardless of direction we go with, I would consult with protocol first to see if there is another option that fits better here.
Marking as low priority for now as there has been no real demand/complaints here from real users.