eip title author type category status created superseded-by
158
State clearing
Vitalik Buterin
Standards Track
Core
Replaced
2016-10-16
161

被EIP-161取代了

Specification

For all blocks where block.number >= FORK_BLKNUM (TBA):

  1. In all cases where a state change is made to an account, and this state change results in the account state being saved with nonce = 0, balance = 0, code empty, storage empty (hereinafter "empty account"), the account is instead deleted.在所有情况下,如果对帐户进行了状态更改,并且此状态更改导致帐户状态保存为nonce = 0、balance = 0、代码为空、存储为空(以下简称为空帐户),则将删除该帐户
  2. If a address is "touched" and that address contains an empty account, then it is deleted. A "touch" is defined as any situation where if the account at the given address were nonexistent it would be created.如果地址被“touch”,而该地址包含一个空帐户,则删除该地址。“touch”被定义为如果给定地址上的帐户不存在,将创建该帐户的情况,下面有写
  3. Whenever the EVM checks if an account exists, emptiness is treated as equivalent to nonexistence. Particularly, note that this implies that, once this change is enabled, there is no longer a meaningful difference between emptiness and nonexistence from the point of view of EVM execution.每当EVM检查帐户是否存在时,空被视为等同于不存在。特别要注意的是,这意味着,一旦启用了这个更改,从EVM执行的观点来看,空和不存在之间就不再有有意义的区别了
  4. Zero-value calls and zero-value suicides no longer consume the 25000 account creation gas cost in any circumstance零值calls和零值suicides在任何情况下都不再消耗25000个账户的创建费用

The cases where a "touch" takes place can be enumerated as follows:

  • Zero-value-bearing CALLs
  • CREATEs (if the code that is ultimately saved is empty and there is no ether remaining in the account when it is saved)
  • Zero-value-bearing SUICIDEs
  • Transaction recipients
  • Contracts created in contract creation transactions
  • Miners receiving transaction fees (note the case where the gasprice is zero, and the account does not yet exist because it only receives the block/uncle/nephew rewards after processing every transaction)

Specification (1b)

When the EVM checks for emptiness (for the purpose of possibly applying the 25000 gas cost), emptiness is defined by is_empty(acct): return get_balance(acct) == 0 and get_code(acct) == "" and get_nonce(acct) == 0; emptiness of storage does not matter. This simplifies client implementation because there is no need to add extra complexity to make caches enumerable in the correct way and does not significantly affect the intended result, as the cases where balance/code/nonce are empty but storage is nonempty where this change would lead to an extra 25000 gas being paid are pathological and have no real use value.

这简化了客户端实现,因为不需要添加额外的复杂性通过正确的方法来使缓存可列举并不明显影响了预想的结果,在balance/代码/ nonce为空但存储非空的情况下,这种变化将导致额外的25000年天然气支付是病态的,没有真正的使用价值。

Specification (1c)

Do not implement point 2 above (ie. no new empty accounts can be created, but existing ones are not automatically destroyed unless their state is actually changed). Instead, during each block starting from (and including) N and ending when there are no null accounts left, select the 1000 null accounts that are left-most in order of sha3(address), and delete them (ordering by hash is necessary so as to allow the accounts to be easily found by iterating the tree).

Rationale

This removes a large number of empty accounts that have been put in the state at very low cost due to flaws in earlier versions of the Ethereum protocol, thereby greatly reducing state size and hence both reducing the hard disk load of a full client and reducing the time for a fast sync. Additionally, it simplifies the protocol in the long term, as once all "empty" objects are cleared out there is no longer any meaningful distinction between an account being empty and being nonexistent, and indeed one can simply view nonexistence as a compact representation of emptiness.

此外,从长远来看,它简化了协议,因为一旦所有的“空”对象都被清除,一个帐户是空的和不存在的之间就不再有任何有意义的区别了,

Note that this proposal does introduce a temporary breaking of existing guarantees, in that by repeatedly zero-value-calling already existing empty accounts one can create a state change at a cost of 700 gas per account instead of the usual 5000 per gas minimum (with SUICIDE refunds this goes down further to 350 gas per account). Allowing such a large number of state writes per block will lead to heightened block processing times and increase uncle rates in the short term while the existing empty accounts are being cleared, and eventually once all empty accounts are cleared this issue will no longer exist.

ethereum/EIPs-158 State clearing 被EIP-161取代的更多相关文章

  1. ethereum/EIPs-161 State trie clearing

    EIP 161: State trie clearing - makes it possible to remove a large number of empty accounts that wer ...

  2. ethereum/EIPs-607 Hardfork Meta: Spurious Dragon硬分叉相关

    eip title author type status created requires 607 Hardfork Meta: Spurious Dragon Alex Beregszaszi Me ...

  3. ethereum/EIPs-1271 smart contract

    https://github.com/PhABC/EIPs/blob/is-valid-signature/EIPS/eip-1271.md Standard Signature Validation ...

  4. ethereum/EIPs-1078 Universal login / signup using ENS subdomains

    https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1078.md eip title author discussions-to status ...

  5. go ethereum源码分析 PartIV Transaction相关

    核心数据结构: core.types.transaction.go type Transaction struct { data txdata // caches hash atomic.Value ...

  6. ethereum/EIPs-1

    https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1.md 介绍了什么是EIP等等的详细信息: eip title status type a ...

  7. ethereum/EIPs-100 挖矿难度计算

    https://github.com/ethereum/EIPs/blob/master/EIPS/eip-100.md 创世纪区块的难度是131,072,有一个特殊的公式用来计算之后的每个块的难度. ...

  8. ethereum/EIPs-712 Ethereum typed structured data hashing and signing

    https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md eip title author discussions-to status ...

  9. ethereum/EIPs-191 Signed Data Standard

    https://github.com/ethereum/EIPs/blob/master/EIPS/eip-191.md eip title author status type category c ...

随机推荐

  1. log4j.appender.file.DatePattern

    DailyRollingFileAppender是日志记录软件包Log4J中的一个Appender,它能够按一定的频度滚动日志记录文件. 我们可以按下面的方式配置DailyRollingFileApp ...

  2. 【Java基础】2、Java中普通代码块,构造代码块,静态代码块区别及代码示例

    Java中普通代码块,构造代码块,静态代码块区别及代码示例.Java中普通代码块,构造代码块,静态代码块区别及代码示例 执行顺序:静态代码块>静态方法(main方法)>构造代码块>构 ...

  3. Android线程

    1.引言 在Android中,几乎完全采用了Java的线程机制,由于Android的特性,主线程只处理和界面相关的事情,子线程处理耗时操作.Android中扮演线程角色的有Thread.AsyncTa ...

  4. 【22】访问者模式(Visitor Pattern)

    一.引言 在这篇博文中,我将为大家分享我对访问者模式的理解. 二.访问者模式介绍 2.1 访问者模式的定义 访问者模式是封装一些施加于某种数据结构之上的操作.一旦这些操作需要修改的话,接受这个操作的数 ...

  5. JavaScript中的递归

    译者按: 程序员应该知道递归,但是你真的知道是怎么回事么? 原文: All About Recursion, PTC, TCO and STC in JavaScript 译者: Fundebug 为 ...

  6. 自定义jq插件,鼠标悬浮展示图片或者视频放大图,可自定义展示内容

    网站项目经常会遇到一些视频或者图片素材的展示功能,那么就需要自己写一个功能,就是在一些列表页面你想要是这个数据的详细内容,弹框在页面某个位置 例如这是视频悬浮展示效果,可自定义自动播放等属性标签 又例 ...

  7. 【读书笔记】iOS-iCloud文件备份

    iOS应用在运行时经常要创建一些文件,不过这些文件要如何存放呢?有没有什么要求呢? 由于手机资源空间有限而且考虑到Apple推出的iCloud,我们确实要对创建出的文件按照作用的不同,分出几种类别出来 ...

  8. SSM环境搭建

    流程 1,maven 依赖 2,spring 配置文件 3,mybatis 配置文件 4,springMVC 配置文件 5,web.xml pom依赖 1,定义版本 <properties> ...

  9. 我的Java之旅 第三课 从Applet到JSP

    一.Applet   Applet是一种特殊的Java程序,它本身不能单独运行(因为本身没有main()),需要嵌入在一个HTML文件中,借助浏览器或者appletviewer来解释执行.   App ...

  10. Android View 绘制流程

    Android 中 Activity 是作为应用程序的载体存在,代表着一个完整的用户界面,提供了一个窗口来绘制各种视图,当 Activity 启动时,我们会通过 setContentView 方法来设 ...