Official Disclosure of Severe Threat Against Ethereum Platform
In this blog post, we aim to officially disclose a severe threat that posed a clear and present danger to the Ethereum platform until the Berlin hardfork.
Ethereum and State
The Ethereum state consists of a patricia-merkle trie, a prefix-tree. As the state grows, the branches in this tree become more dense. Each added account is another leaf, and between the root of the tree and the leaf, there are intermediate nodes. To look up a specific account in this tree, multiple hashes need to be resolved, resulting in multiple database lookups. The number of disk operations is difficult to estimate but can be significant.
In March 2019, an investigation into EVM opcode performance led to the creation of EIP-1884. Subsequently, an exploit utilizing random trie lookups was discovered. Although EIP 1884 had some impact in reducing the effects of the attack, it was not sufficient. This posed a significant threat to the Ethereum platform.
To address the problem, a two-pronged approach was taken. Firstly, work was done on the Ethereum protocol to solve the issue at the protocol layer without breaking contracts or penalizing legitimate behavior. This led to the development of EIP 2929 and EIP 2930, which effectively solved many of the issues.
Secondly, changes were made to the data models and structures within the client software through the implementation of dynamic state snapshots. This allowed for faster state accesses and provided additional benefits such as offline-pruning of the state trie.
The severe threat against the Ethereum platform was addressed through a combination of protocol improvements and software engineering. The implementation of EIP 2929 and EIP 2930, along with the introduction of dynamic state snapshots, has significantly mitigated the risk posed by the exploit. Users and developers can now have greater confidence in the security and stability of the Ethereum platform.