The state of the state of Ethereum

Last week saw record transaction costs on Ethereum, peaking at around $7,000,000 per hour in fees. 

Although this was abnormally high, even at the quietest times fees are approaching $1,000,000 per hour. 

These high fees are one result of the fact that block space is limited. Blocks in Ethereum have room for around 500 transactions, although the exact number is dependent on the complexity of those transactions.  The transactions chosen to go into those blocks are generally chosen on a very simple criterion: who pays most gets in.

A common request is to increase the size of blocks. Clearly, more space in blocks for transactions leads to lower competitive pressure, thus lower fees, and a higher number of transactions per second to boot. Although this is all true in theory, in practice it isn’t so simple. What, then, is the problem, and what is being done about it?

State is the problem

The root cause of the problem is ‘state’. State is information held about an Ethereum address or smart contract.

For example the amount of Ether held by an address or the ownership of a non-fungible token. A major difference between Ethereum’s state and Bitcoin’s “who-holds-what” UTXOs is that the former allows for the creation and operation of smart contracts of arbitrary complexity. 

This feature has been the primary reason for Ethereum’s success over the past five years with ERC-20 tokens, NFTs, and more recently DeFi.

However, Ethereum is currently a victim of its own success.

The more that people use Ethereum, the more state there is. Did you send 0.01 Ether to a different address a couple of years back to see how it worked? The information about that balance is held in state.

Do you have various airdrops of random tokens in your wallet? Each of those require state. Every NFT, every ERC-20, every DeFi project (alive or slumbering) takes up state, and it adds up to a large and increasing problem.

State is growing

As state becomes larger, the time to access any piece of that state increases. Although data access methods in computers continue to improve, the sheer size of the state and unpredictability of access to it means that state access is by far the slowest piece of carrying out Ethereum transactions.

This matters because every transaction on Ethereum does, in some way shape or form, access (and usually update) state. If the time taken to process the transactions in a block becomes too high it results in destabilisation of the chain: more alternative branches, more resources are required to hold a local copy of the chain, and significantly higher risk of denial of service attacks.

There is an on-going battle between the growth of state on one side and the efficiency increases to access that state via faster hardware, optimised algorithms and the like on the other, but state growth is winning. So the focus is shifting from being able to manage the entire state to reducing it.

State must be reduced

There are many ideas around how best to reduce the size of the Ethereum state, but there are three main options. 

The first solution is introducing the concept of “state rent”, where state is paid for on an on-going basis. If a payment is not made the state is removed, resulting in a smaller and more manageable state.  Removed state can be reintroduced if required with a suitable payment.

This has the benefit of being an economic solution, in that once implemented it is down to Ethereum users as to which state they care enough about to pay for.  It is, however, only a partial solution because even with rent in place there are no guarantees on the size or growth of state.

The second solution is providing a two-tier state. “Active” state continues as-is, however if state is not accessed after a while it is considered “inactive” and moved to a second area of storage. 

The costs for accessing inactive state are made significantly higher, representing the cost to move data back to the “active” state.  This is similar to the first solution but is more automated. 

It does, however, make gas usage highly variable from one transaction to the next, and the technical challenges of moving state between active and inactive stores adds significant complexity to clients.

The third solution is removing state entirely.

In its place a single small value called the “state root” is held on Ethereum, and all actual state is kept off-chain. Whenever a transaction is submitted to the Ethereum network the pieces of the state that will be read by the transaction are provided alongside it in a structure known as a “witness”. 

This increases the size of transactions but, crucially, massively reduces the time taken to process the transaction as there is no requirement to fetch state any more. This option also has the highest technical requirements, because the state root needs to be updated with each block in a trustless and decentralised fashion, and transactions themselves need access to state to be able to build the appropriate witness. 

This does, however, fix the entire issue of state growth as far as Ethereum nodes are concerned so a lot of effort is going into this option.

State must remain decentralised

Regardless of the solution or solutions used, they must not impact Ethereum’s fundamental premise of providing a decentralised blockchain. 

This takes time, and the lack of it today is felt especially painfully during times of high network congestion and astronomical fees. 

However, progress continues towards the ultimate goal of a highly scalable solution without compromise.  When additional work such as layer 2 and sharding are added to the mix, that goal is starting to look very close indeed.

Where can I learn more?

A good introduction to Ethereum can be found on the official Ethereum Foundation website.

For more detailed information, please read our technical posts on Ethereum 2 staking.

About the author

Jim McDonald – Chief Technology Officer Attestant Limited

Jim has worked on internet infrastructure for nearly 30 years, including running one of the first public access internet services.  He has worked on hardware and software, in start-ups and multinationals, in technical, management and leadership roles.  His current focus is on Ethereum 2, decentralized infrastructure, and advanced validator strategies.

This article was written by Attestant.io.  Founded in 2019, Attestant has designed, developed, tested, and -since the 1st of December 2020- deployed a non-custodial, institutional-grade, staking service for banks, exchanges, family offices, financial institutions, and HNW individuals with a minimum of 1,000 Ether.

Attestant Limited is registered in England and Wales under company number 12540798 at 7 Albert Buildings, 49 Queen Victoria Street, City of London, EC4N 4SA, Great Britain.





Source link

empty message

empty message

empty message

empty message

empty message