Reject oversized calldata offsets in native EraVM assembly

Some ABI decoders use an intentionally huge calldata offset to obtain a zero word. That convention can panic when compiled for native EraVM because its supported offset range is bounded.

Check the offset before loading

The native instruction compatibility rules specify a panic for calldataload offsets greater than 2^32 minus 33. The example probe is one above that threshold. Treat it as malformed input before reaching the assembly load.

largest documented safe CALLDATALOAD offset = 2^32 - 33
probe offset                              = 2^32 - 32

Validate additions and length calculations in a sufficiently wide integer type. An attacker can supply an offset whose arithmetic wraps into what looks like a small valid range. Check the actual input length independently of the VM maximum.

Exercise the compiled decoder

Use boundary fixtures around the limit and truncated normal inputs. A successful test on a standard Ethereum VM does not test native lowering of this instruction. Separate explicit application errors from a VM panic when exposing diagnostics. docs.zksync.io ZKsync documentation