loomchain icon indicating copy to clipboard operation
loomchain copied to clipboard

Remove legacy receipt handlers & refactor receipt handling

Open enlight opened this issue 6 years ago • 2 comments

The legacy receipt handlers can be removed now that PlasmaChain has been migrated to the LevelDB based receipts handler. The receipts code is way too complicated right now, so removing the legacy handlers should allow us to simplify that code a fair bit.

enlight avatar Jun 18 '19 10:06 enlight

Noticed we're still hitting app.db whenever a tx receipt isn't found in receipts_db, need to get rid of that fall back. Migrate the old receipts over to receipts_db, we didn't do it initially for "reasons", but I want this code eliminated as part of the cleanup & refactor so we'll have to move this data (only need to do it on the PlasmaChain non-validator nodes).

https://github.com/loomnetwork/loomchain/blob/61f568925a552c5b1161fa38e4557b16d273b084/receipts/handler/handler.go#L93

enlight avatar Jun 20 '19 09:06 enlight

TODO:

  • [x] Remove legacy code that handled receipts before they were moved to receipts_db (https://github.com/loomnetwork/loomchain/pull/1387)
  • [x] Fix EVM tx hash generation so it's no longer the hash of the receipt.
  • [ ] Remove the hacks where EVM tx receipt info is pulled out of the blockstore.db, the receipt writer should be fixed to include all relevant info in the receipt itself. That way we can prune old blocks from blockstore.db without losing info from receipts written in those blocks.

enlight avatar Aug 06 '19 13:08 enlight