EIP-3860: Limit and Meter Initcode
EIP-3860 (Shanghai) caps contract creation initcode at 49152 bytes (0xc000) and meters initcode execution by 2 gas per 32-byte word. Without this cap, a very large initcode could consume excessive resources during contract deployment.
Why It Was Needed
Pre-3860, an attacker could submit a transaction creating a contract with a 10MB initcode, forcing every full node to process the entire blob just to determine the deploy fails (or succeeds with absurd code). Cheap DoS surface.
Neo Equivalent
The Neo NEF (Neo Executable Format) has explicit limits baked in:
- Script size: max 1 MB per contract (much higher than 48 KB but still bounded).
- Manifest size: max 64 KB.
- Method count, parameter counts, etc.: all bounded.
Contract deployment cost on Neo scales linearly with NEF size via the network fee (byte-cost) plus a flat deployment cost from ContractManagement.GetMinimumDeploymentFee().
Live on Neo TestNet
Both implementations are deployed on Neo N3 TestNet (network magic 894710606).
| Implementation | Contract Hash | Deploy Tx |
|---|---|---|
Solidity (neo-solc) | 0x5d95f5db9f06ee751778208c36c408a49968d728 | 0xfe360560…230ca8 |
Neo C# (nccs) | 0xb58a104cecaaa87e7c44915464f09b60e4768337 | 0xe648287f…cbed74 |
Cross-implementation invocations match on maxInitcodeSize. Source pairs under docs/standards-mirror/deployments/eip-3860/.
