FuelLabs / fuel-core

Rust full node implementation of the Fuel v2 protocol.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add migration for remaining off chain tables

segfault-magnet opened this issue · comments

@xgreenx wrote:

We need to migrate as well:
FuelBlocks - for that we need to disable guard on commit.
FuelBlockIdsToHeights - Cab be generated form the FuelBlocks.
SpentMessages - can be derived from Transactions or removed entirly
ProcessedTransactions - can be derived from Transactions
FuelBlockConsensus

and

Actually, maybe transactions and blocks should be migrated to the off-chain database. Because we are only migrating them for GraphQL service and only to support queries for old data.

and

[...] the idea is to have OldFuelBlocks and OldTransactions as part of the off-chain database. If the requested block is lower than genesis block height, we go to off_chain::OldFuelBlocks , otherwise to on_chain::FuelBlocks. In the case of transactions, yeah, first we go to on_chain::Transactions and if no success, go to off_chain::OldTransactions

From the above, we should have a table for blocks and transactions in the off chain db and populate it upon regenesis.