0

I understand that Ethereum's block history by definition represents the state of the state machine. However, throughout all the blocks, block storage is created and subsequently destroyed.

I'm assuming that a validator node has an in-memory representation of the state machine after applying all the operations defined in the chain that it's then going to apply the next block onto (ie. the nodes will not apply all the operations in the chain from genesis to current block every time a new block is created).

  1. How does this process take place and,
  2. How big is this in-memory representation? (not ledger size).

1 Answer 1

0

Developer advocate from Chainstack here.

Validating on Ethereum needs two clients - consensus client and execution client- to work cohesively together.

In very simple terms:

  • An execution client does the computational heavy lifting- it keeps all state data on Ethereum, produces/execute new blocks, verifies transactions, etc.
  • A consensus client manages the validating schedule. It monitors the number of validators in the network and receives new blocks from other validators.

To answer your first question: > How does this process take place

When a node validates a consensus block, its consensus client processes the block and sends the execution payload to the execution client, which:

  1. Assembles a block on the execution layer.
  2. Verifies pre-conditions.
  3. Executes transactions.
  4. Verifies post-conditions.
  5. Sends the validity result back to the consensus client.
  6. If the block is valid, the execution client includes it in the execution chain and stores the new state in execution state storage.

Source

For your second question: How big is this in-memory representation?

To run an Ethereum node, you don't need all the historical state data from genesis, you just need a snapshot of the current states. But even that requires more than 1 TB of data. This data is stored in your local DB.

Taking Geth as an example, at the time of writing, to run a full Geth node + Consensus client you need:

  1. 16GB RAM
  2. 2TB SSD
  3. quad-core (or dual-core hyperthreaded) CPU

Source

This is for a full node that contains the most recent 128 blocks.

There are other types of nodes that have different storage requirements. For example, an archive node - a node that keeps all historical states - needs 12 TB of disk space. But since you are asking about a validator node, a full node should be sufficient.

If you are interested to learn more we have a technical blog post EVM nodes: A dive into the full nodes vs. archive nodes that may be helpful.

Happy coding.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.