From 43c554bf1351674b371aba38cf49e0e7389ac71a Mon Sep 17 00:00:00 2001 From: cdetrio Date: Fri, 23 Jun 2017 15:02:54 +0200 Subject: [PATCH] add EIP-170 preamble and reference --- EIPS/eip-170.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/EIPS/eip-170.md b/EIPS/eip-170.md index d77f78c4..1b3da2c7 100644 --- a/EIPS/eip-170.md +++ b/EIPS/eip-170.md @@ -1,4 +1,12 @@ -EDITOR NOTE: below is a copy of the EIP 170 https://github.com/ethereum/EIPs/issues/170#issue-187221797 raw text fetched on 2017-06-23. +``` +EIP: 170 +Title: Contract code size limit +Author: Vitalik Buterin +Type: Standard Track +Category: Core +Status: Draft +Created: 2016-11-04 +``` ### Specification @@ -9,3 +17,7 @@ If `block.number >= FORK_BLKNUM`, then if contract creation initialization retur Currently, there remains one slight quadratic vulnerability in ethereum: when a contract is called, even though the call takes a constant amount of gas, the call can trigger O(n) cost in terms of reading the code from disk, preprocessing the code for VM execution, and also adding O(n) data to the Merkle proof for the block's proof-of-validity. At current gas levels, this is acceptable even if suboptimal. At the higher gas levels that could be triggered in the future, possibly very soon due to dynamic gas limit rules, this would become a greater concern - not nearly as serious as recent denial of service attacks, but still inconvenient especially for future light clients verifying proofs of validity or invalidity. The solution is to put a hard cap on the size of an object that can be saved to the blockchain, and do so non-disruptively by setting the cap at a value slightly higher than what is feasible with current gas limits (an pathological worst-case contract can be created with ~23200 bytes using 4.7 million gas, and a normally created contract can go up to ~18 kb). If this is to be added, it should be added as soon as possible, or at least before any periods of higher than 4.7 million gas usage allow potential attackers to create contracts larger than 24000 bytes. + +### References + +1. EIP-170 issue and discussion: https://github.com/ethereum/EIPs/issues/170