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

fix: use clearer explanation for bytecode limits #1013

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions docs/build/developer-reference/contract-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ Each zkEVM bytecode must adhere to the following format:

- Its length must be divisible by 32.
- Its length in words (32-byte chunks) should be odd. In other words, `bytecodeLength % 64 == 32`.
- It can not be longer than `2^16` 32-byte words, i.e. `2^21` bytes.

Note: the `2^21` is a VM limit, but the deployed bytecode has to be published to L1, which imposes a pubdata limit, which is normally smaller.
By default, for each batch, it's set to 100000 bytes for hyperchains using calldata DA, and 120000 per each EIP-4844 blob.
- There is a VM limit, the bytecode can not be more than `2^16` 32-byte words, i.e. `2^21` bytes.
- The bootloader has a memory limit for supplying pubdata of 450999 bytes, therefore limiting the contract size to it as well. This limit is valid for Validium hyperchains, that don’t have to publish the bytecode to the base layer.
- For rollups that must publish the deployed bytecode to the base layer (e.g. Ethereum), there is an additional pubdata limit, which is normally smaller. By default, for each batch, this limit is set to 100000 bytes for hyperchains using calldata DA, or 120000\*number_of_blobs, for hyperchains using EIP-4844 blobs.

The 32-byte hash of the bytecode of a zkSync contract is calculated in the following way:

Expand Down