[go: up one dir, main page]

Etherlink/Kernel: Store only last block full informations and last 256 block hashes

Resolves L2-513

What

Update the format and number of data we save about previous blocks. We save only useful information which is :

  • Last 256 block hash (for blockhash opcode)
  • Last block full information (header, content, reciepts, transaction objects) (for storing in the evm_node in a persistent database with all blocks for API calls)

We don't store anymore any useless data that need to be garbage collected and all data are automatically overriden by more updated info and so we don't need any deletion mecanism.

Why

We spotted that in smart-rollup-node we were storing the whole history of blocks of Etherlink which led to hundreds of gigabytes of data. All of this old data will be removed by the migration.

In order to achieve RISC-V migration we need to not use any prefix-based durable storage access, so we needed to rethink the way we store all of this informations and their needs.

How

  • Remove all old data except last block
  • Store all information about last block in keys that are override after each block production
  • Store all transaction objects in a single storage key
  • Store all receipts in a single storage key
  • Update EVM node to use the new storage keys if the storage version is updated

Manually testing the MR

CI

Edited by Aurélien Foucault

Merge request reports

Loading