Skip to content

Commit

Permalink
fix: use clearer explaination for bytecode limits
Browse files Browse the repository at this point in the history
  • Loading branch information
dimazhornyk committed Apr 5, 2024
1 parent 5cd3632 commit a7460f2
Showing 1 changed file with 3 additions and 4 deletions.
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

0 comments on commit a7460f2

Please sign in to comment.