Skip to content
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

zkSync Smart Account produces wrong signature on zksyncInMemoryNode local network #2658

Open
1 task done
Haypierre opened this issue Aug 26, 2024 · 0 comments
Open
1 task done

Comments

@Haypierre
Copy link
Contributor

Haypierre commented Aug 26, 2024

Check existing issues

Viem Version

2.19.9

Current Behavior

Test run

description: deploy @openfort-xyz smart accounts (account implementation, factory, account proxy), deploy mockERC20, try to mint tokens, and check if the smart account balance has updated accordingly.

Env

Local zkSync Era in memory node: era_test_node fork https://sepolia.era.zksync.dev

Command to reproduce

yarn hardhat test --grep "sign with owner: balance should be updated" --nonce 42

Current behavior

The mint function call failed because of a bad signature. Debug logs from the openfort smart account output a different recovered address at every run. This should be visible on the terminal where the local zkSync node runs.

16:30:42  INFO ==== Console logs:
16:30:42  INFO ENTERING TRANSACTION VALIDATION: from %s and to %s d57049437b3b888908c351c4fc43e46c5b82d6f2 26493f0ac3fe050d6cda7583ac4db416239d1241
16:30:42  INFO BEFORE enough balance
16:30:42  INFO AFTER enough balance
16:30:42  INFO ENTERING SIGNATURE VALIDATION
16:30:42  INFO v value of signature %s 1b
16:30:42  INFO e996ae24f41eb98dd54bd97e2842d1bd355ae5083ee06efd62c0474c8f70c086
16:30:42  INFO 5f5fcc27319474e1c462e79f96fc0e75c9d01dd63e36f0d55e14e1aa15fd9644
16:30:42  INFO RECOVERED SIGNER ADDRESS is %s 33c59fa5cea3f1f6c00f6f6236038f7a8fa82303
16:30:42  INFO OWNER IS %s bc989fde9e54cad2ab4392af6df60f04873a033a

===> RECOVERED SIGNER ADDRESS SHOULD be equal to OWNER

Important note: it works fine on custom networks (e.g sophon)

Expected Behavior

Test pass, ecrevocer recovers the correct owner address.

Here is the Working Test with ethers

@Haypierre Haypierre changed the title zkSync Smart Account produces wrong signature on zksyncInMemoryNode zkSync Smart Account produces wrong signature on zksyncInMemoryNode local network Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@Haypierre and others