input-output-hk / mantis

A Scala based client for Ethereum-like Blockchains.
Apache License 2.0
231 stars 75 forks source link

[ETCM-1082] Add block metadata storage #1113

Closed leo-bogastry closed 3 years ago

leo-bogastry commented 3 years ago

Description

In order to have explicit and easily queryable information on whether blocks have already been successfully executed, a new storage BlockMetadaStorage (and BlockMetadataProxy ) was added. This storage can easily be extended in the future if we need more metadata block information.

Proposed Solution

Added BlockMetadaStorage, BlockMetadataProxy and modified ConsensusImpl to first check for already executed blocks and only executed those blocks not yet executed. A small step of this implementation is missing, which is to add the initial block metadata with isExecuted=false, because it can only be done once saving blocks is extracted from BlockExecutions and done in a chains manager layers. Follow-up ticket created ETCM-1138 The PR is divided into several commits, that help on the review.

Testing

Tested again ETC mainnet