Content pfp
Content
@
https://warpcast.com/~/channel/zksync
0 reply
0 recast
0 reaction

Pierre H. — q/dau pfp
Pierre H. — q/dau
@rektorship
https://github.com/zkSync-Community-Hub/zksync-developers/discussions/639#discussioncomment-10693912 why are zksync builds non-deterministic (both foundry and hardhat)? why does updating the smart account change the proxy bytecode? and why is there only one proxy bytecode that works for my account factory? @bountybot pays 100 USD to the person who can answer *all* these questions.
4 replies
0 recast
4 reactions

Pierre H. — q/dau pfp
Pierre H. — q/dau
@rektorship
https://github.com/zkSync-Community-Hub/zksync-developers/discussions/639#discussioncomment-10360021
0 reply
0 recast
0 reaction

gatedude.eth pfp
gatedude.eth
@gatedude
Hey fam, I visited the repo and read the conversation. A contributor actually suggested using ---no-optimization flag with Hardhat to reduce variability. Another also suggested you exploring @openzeppelin/contracts for deterministic builds. Here's my take on the question you asked: First, you need to understand that zkSync's build process involves generating random numbers (salts) for cryptographic purposes. Also these random numbers affect the compiled contract bytecode. But Foundry and Hardhat generate different random values, leading to non-deterministic builds. Also, the reason why updating the contract actually changes the proxy bytecode is because zkSync's smart accounts actually uses a proxy contract to manage account upgrades. When you update the smart contract, the proxy contract bytecode changes due to the "New account Logic" and the "Updated account-specefic data" like the public key for example.
2 replies
0 recast
1 reaction

Jai pfp
Jai
@jaivsdawrld
1. zkSync builds are non-deterministic because of the underlying cryptography, gas costs, and off-chain factors like the L1/L2 interaction that make bytecode unpredictable across those two different tools you mentioned (foundry/Hardhat) 2. Updating the smart account alters the proxy bytecode because the initialization logic changes, creating a new contract setup. 3. Only one proxy bytecode works since it's uniquely generated by your account factory's deployment logic and structure. Did some digging and Got some information from here https://docs.zksync.io/build
1 reply
0 recast
1 reaction

Solkamo2 pfp
Solkamo2
@zorryndra
zkSync builds need improvement for determinism. Smart account updates affecting proxy bytecode is suboptimal. Multiple options should be available for account factory
0 reply
0 recast
1 reaction